From patchwork Sat Feb 15 17:02:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Merlijn Wajer X-Patchwork-Id: 11383925 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 66136159A for ; Sat, 15 Feb 2020 17:00:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 47C1E217F4 for ; Sat, 15 Feb 2020 17:00:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wizzup.org header.i=@wizzup.org header.b="i3pOjcr0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726266AbgBORAe (ORCPT ); Sat, 15 Feb 2020 12:00:34 -0500 Received: from a80-127-99-228.adsl.xs4all.nl ([80.127.99.228]:45178 "EHLO hetgrotebos.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726209AbgBORAe (ORCPT ); Sat, 15 Feb 2020 12:00:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=wizzup.org; s=mail; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=xuSqKQckl8muEwKshU/FzUtts9aWAxkpxm3IlAs7oE0=; b=i3pOjcr07cSYOV1hufyJQR5jBO qSSk62inBHZ1/2kXDe1fQDwqRaFLJjuecxX/PR5NaaEraMc2KcGTiHKfYc6ORw4xPDTZv0pBSawnl mETCSN56iH0aKVUguFcI6+T3Vc+wNqGOFU+AI1K3x96M43uX7lhy5zrQ0f2sEa6wufOQnYu5mUbXg x6/gZVYOlsk/UJhlhaf9uYuwRujJGr01+IK4EAfJnpBKc8I4Azziy94WRtNY0ACljEkHOU5jox/uK CTJyfb1evVRnV95CeRflGw02/rglMf2Q+NZuqjKmu6hu4yTrxVg+EAf8Og+o9SbgvBlOW+CctTOUP 7LB2oAjw==; Received: from kgpe-d16.fritz.box ([192.168.178.22]) by hetgrotebos.org with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1j30ni-00037p-CU; Sat, 15 Feb 2020 17:00:18 +0000 From: Merlijn Wajer Cc: Merlijn Wajer , Sebastian Reichel , =?utf-8?q?Beno=C3=AEt_?= =?utf-8?q?Cousson?= , Tony Lindgren , Rob Herring , Mark Rutland , Dmitry Torokhov , "Darren Hart (VMware)" , Mattias Jacobsson <2pi@mok.nu>, linux-omap@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Subject: [PATCH 1/2] Input: add `SW_MACHINE_COVER` Date: Sat, 15 Feb 2020 18:02:14 +0100 Message-Id: <20200215170216.14397-2-merlijn@wizzup.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200215170216.14397-1-merlijn@wizzup.org> References: <20200215170216.14397-1-merlijn@wizzup.org> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org This event code represents the state of a removable cover of a device. Value 0 means that the cover is open or removed, value 1 means that the cover is closed. Reviewed-by: Sebastian Reichel Signed-off-by: Merlijn Wajer --- include/linux/mod_devicetable.h | 2 +- include/uapi/linux/input-event-codes.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 448621c32e4d..4c692cb3cc1d 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -299,7 +299,7 @@ struct pcmcia_device_id { #define INPUT_DEVICE_ID_LED_MAX 0x0f #define INPUT_DEVICE_ID_SND_MAX 0x07 #define INPUT_DEVICE_ID_FF_MAX 0x7f -#define INPUT_DEVICE_ID_SW_MAX 0x0f +#define INPUT_DEVICE_ID_SW_MAX 0x10 #define INPUT_DEVICE_ID_PROP_MAX 0x1f #define INPUT_DEVICE_ID_MATCH_BUS 1 diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h index 64cee116928e..68f8ad8377a1 100644 --- a/include/uapi/linux/input-event-codes.h +++ b/include/uapi/linux/input-event-codes.h @@ -807,7 +807,8 @@ #define SW_LINEIN_INSERT 0x0d /* set = inserted */ #define SW_MUTE_DEVICE 0x0e /* set = device disabled */ #define SW_PEN_INSERTED 0x0f /* set = pen inserted */ -#define SW_MAX 0x0f +#define SW_MACHINE_COVER 0x10 /* set = cover closed */ +#define SW_MAX 0x10 #define SW_CNT (SW_MAX+1) /* From patchwork Sat Feb 15 17:02:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Merlijn Wajer X-Patchwork-Id: 11383927 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C11A6186E for ; Sat, 15 Feb 2020 17:00:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A13B7217F4 for ; Sat, 15 Feb 2020 17:00:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wizzup.org header.i=@wizzup.org header.b="ONIshqSG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726438AbgBORAe (ORCPT ); Sat, 15 Feb 2020 12:00:34 -0500 Received: from a80-127-99-228.adsl.xs4all.nl ([80.127.99.228]:45180 "EHLO hetgrotebos.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726143AbgBORAe (ORCPT ); Sat, 15 Feb 2020 12:00:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=wizzup.org; s=mail; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=5mloNwlHrXdn4IwVWhbhGXhiCRauDyoDgJnxMxS8A3Y=; b=ONIshqSGcrrUtCYNbDJGk63TWb FSLz2TT8D24qgDUtIGDPmVXp9BxfwjjprtJXuZZPOL+4uSrSFWijbiHMao5rScoEfvNkI631I8w6S +eQtNwMg0WfBM9nTe1V9V1IkE/l9MFObWuiVtJfZpMMVMdzQT78Znc/QaavJd38moOGzyIZy4PJUM +SzifJhAL4Vy78nBHWuFYDwSWmAFokD7K7Bt4wArYXWZt83viyKbe5gnu59dwks1Adla/Nkv1lZCk Dc+4JlmVOOZCFd+ZjLeNcqmQJZ/8CVD0an2XxZPdMRxaEYPxir0xaDpRXVI6seNnLwKpHZejhKoBd 7sX48b7w==; Received: from kgpe-d16.fritz.box ([192.168.178.22]) by hetgrotebos.org with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1j30nj-00037p-C4; Sat, 15 Feb 2020 17:00:19 +0000 From: Merlijn Wajer Cc: Merlijn Wajer , Sebastian Reichel , =?utf-8?q?Beno=C3=AEt_?= =?utf-8?q?Cousson?= , Tony Lindgren , Rob Herring , Mark Rutland , Dmitry Torokhov , Mattias Jacobsson <2pi@mok.nu>, "Darren Hart (VMware)" , linux-omap@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Subject: [PATCH 2/2] ARM: dts: n900: remove mmc1 card detect gpio Date: Sat, 15 Feb 2020 18:02:15 +0100 Message-Id: <20200215170216.14397-3-merlijn@wizzup.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200215170216.14397-1-merlijn@wizzup.org> References: <20200215170216.14397-1-merlijn@wizzup.org> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Instead, expose the key via the input framework, as SW_MACHINE_COVER The chip-detect GPIO is actually detecting if the cover is closed. Technically it's possible to use the SD card with open cover. The only downside is risk of battery falling out and user being able to physically remove the card. The behaviour of SD card not being available when the device is open is unexpected and creates more problems than it solves. There is a high chance, that more people accidently break their rootfs by opening the case without physically removing the card. Signed-off-by: Merlijn Wajer Reviewed-by: Sebastian Reichel --- arch/arm/boot/dts/omap3-n900.dts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts index 7028a7cb2849..ed773e1609a5 100644 --- a/arch/arm/boot/dts/omap3-n900.dts +++ b/arch/arm/boot/dts/omap3-n900.dts @@ -108,6 +108,14 @@ linux,code = ; linux,can-disable; }; + + machine_cover { + label = "Machine Cover"; + gpios = <&gpio6 0 GPIO_ACTIVE_LOW>; /* 160 */ + linux,input-type = ; + linux,code = ; + linux,can-disable; + }; }; isp1707: isp1707 { @@ -805,10 +813,6 @@ pinctrl-0 = <&mmc1_pins>; vmmc-supply = <&vmmc1>; bus-width = <4>; - /* For debugging, it is often good idea to remove this GPIO. - It means you can remove back cover (to reboot by removing - battery) and still use the MMC card. */ - cd-gpios = <&gpio6 0 GPIO_ACTIVE_LOW>; /* 160 */ }; /* most boards use vaux3, only some old versions use vmmc2 instead */