From patchwork Fri Jun 12 12:53:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Merlijn Wajer X-Patchwork-Id: 11601621 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 DA2DE618 for ; Fri, 12 Jun 2020 12:53:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BEFF220792 for ; Fri, 12 Jun 2020 12:53:38 +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="n9xCzWBI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726357AbgFLMxd (ORCPT ); Fri, 12 Jun 2020 08:53:33 -0400 Received: from a80-127-99-228.adsl.xs4all.nl ([80.127.99.228]:52328 "EHLO hetgrotebos.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726085AbgFLMxd (ORCPT ); Fri, 12 Jun 2020 08:53:33 -0400 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=88k7VznXwntBsfIcECn4Bn66c20yCtluMZj15PpGTT0=; b=n9xCzWBIjUliFxUGk9LFXu+0OI YO+hTAV3pbeJOqx1E/J+t+QR/aWWrM53GxZxn3vwpM++pNQs5gCRAFEfTujU2Y4TEjWU97pC7g8U3 75yXadbinIQ1SPyWdfFvnsDoU7SHKI4+HjsjwBPWwjvW1PVxj5eX7drsIz9HnNqrpE110LacAH23M rrfrO8QhRQZmJC8zk2Kq63OHtFJpT8Ve7QOgmmFVcpIjOAncP1IYqEbinpBoGpLtCkl8NuJvs6o+T 8oegnvJ0UHmAT7+g+R4GWPxAkrQYv35/vtiZr5/NzhQDM2DGyxT/+3DCSl/sPI2Fp4sTy5KVwmFEP aQLgaIVA==; Received: from kgpe-d16.fritz.box ([192.168.178.62]) by hetgrotebos.org with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1jjjBF-0007uZ-7z; Fri, 12 Jun 2020 12:53:09 +0000 From: Merlijn Wajer Cc: pavel@ucw.cz, Merlijn Wajer , Sebastian Reichel , Tony Lindgren , =?utf-8?q?Beno=C3=AEt_Cousson?= , Rob Herring , Dmitry Torokhov , Greg Kroah-Hartman , Borislav Petkov , Andy Shevchenko , Manivannan Sadhasivam , Thomas Gleixner , Mattias Jacobsson <2pi@mok.nu>, Mark Gross , Russell King , linux-omap@vger.kernel.org (open list:OMAP DEVICE TREE SUPPORT), devicetree@vger.kernel.org (open list:OMAP DEVICE TREE SUPPORT), linux-kernel@vger.kernel.org (open list), linux-input@vger.kernel.org (open list:INPUT (KEYBOARD, MOUSE, JOYSTICK , TOUCHSCREEN)...) Subject: [PATCH 1/2] Input: add `SW_MACHINE_COVER` Date: Fri, 12 Jun 2020 14:53:58 +0200 Message-Id: <20200612125402.18393-2-merlijn@wizzup.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200612125402.18393-1-merlijn@wizzup.org> References: <20200612125402.18393-1-merlijn@wizzup.org> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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 Acked-by: Tony Lindgren 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 0754b8d71262..8a84f11bf124 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -318,7 +318,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 b6a835d37826..0c2e27d28e0a 100644 --- a/include/uapi/linux/input-event-codes.h +++ b/include/uapi/linux/input-event-codes.h @@ -888,7 +888,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 Fri Jun 12 12:53:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Merlijn Wajer X-Patchwork-Id: 11601613 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 757076A2 for ; Fri, 12 Jun 2020 12:53:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5D4FF20801 for ; Fri, 12 Jun 2020 12:53:25 +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="DMMaGp+k" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726108AbgFLMxY (ORCPT ); Fri, 12 Jun 2020 08:53:24 -0400 Received: from a80-127-99-228.adsl.xs4all.nl ([80.127.99.228]:52324 "EHLO hetgrotebos.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726085AbgFLMxY (ORCPT ); Fri, 12 Jun 2020 08:53:24 -0400 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=/oDe5myc/Ti4esVHRdNG0fK0PcMUaPBw4fimceYfdN4=; b=DMMaGp+kni2FpKPElUqBNLHjTg GTB1aW+e1IiFfdnITjlbm0YPGo8GcLJKZvg5v75gXHMSvQa9ea/+rFMxZGXEdnkzGKMQnf6dix78w MySNiAfbTYSNn9tc0nfxjiVWkP7jEdlfiPQsAwHYPzUZ4hBWc/7o9o62ZoWTtPJC1pWoQNW6/gbQY Z+/Fndi7mhzNLHj7lDuybsySkzg2HqrQJL9eQkBSrcB1I90DkQUelgjs0JnGseEhj1ZhFoaNxJY17 5pAlLHrrAkWeUfiH/LoZpOfRDDUrCtGx+9UE3JZY69E7XrlZ5WhF22QrdtIAPPvBRR/8oxd5uzzMT HcH9H4SA==; Received: from kgpe-d16.fritz.box ([192.168.178.62]) by hetgrotebos.org with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1jjjBI-0007uZ-9c; Fri, 12 Jun 2020 12:53:12 +0000 From: Merlijn Wajer Cc: pavel@ucw.cz, Merlijn Wajer , Sebastian Reichel , Tony Lindgren , =?utf-8?q?Beno=C3=AEt_Cousson?= , Rob Herring , Dmitry Torokhov , Greg Kroah-Hartman , Jeffrey Hugo , Mattias Jacobsson <2pi@mok.nu>, Andy Shevchenko , Thomas Gleixner , Manivannan Sadhasivam , Russell King , Mark Gross , linux-omap@vger.kernel.org (open list:OMAP DEVICE TREE SUPPORT), devicetree@vger.kernel.org (open list:OMAP DEVICE TREE SUPPORT), linux-kernel@vger.kernel.org (open list), linux-input@vger.kernel.org (open list:INPUT (KEYBOARD, MOUSE, JOYSTICK , TOUCHSCREEN)...) Subject: [PATCH 2/2] ARM: dts: n900: remove mmc1 card detect gpio Date: Fri, 12 Jun 2020 14:53:59 +0200 Message-Id: <20200612125402.18393-3-merlijn@wizzup.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200612125402.18393-1-merlijn@wizzup.org> References: <20200612125402.18393-1-merlijn@wizzup.org> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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. Reviewed-by: Sebastian Reichel Acked-by: Tony Lindgren Signed-off-by: Merlijn Wajer --- 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 4089d97405c9..3dbcae3d60d2 100644 --- a/arch/arm/boot/dts/omap3-n900.dts +++ b/arch/arm/boot/dts/omap3-n900.dts @@ -105,6 +105,14 @@ proximity_sensor { 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 { @@ -819,10 +827,6 @@ &mmc1 { 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 */