lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 25 Oct 2021 14:04:57 +0100
From:   Kieran Bingham <kieran.bingham+renesas@...asonboard.com>
To:     Geert Uytterhoeven <geert@...der.be>,
        linux-renesas-soc@...r.kernel.org, linux-input@...r.kernel.org
Cc:     Kieran Bingham <kieran.bingham@...asonboard.com>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        Magnus Damm <magnus.damm@...il.com>,
        Rob Herring <robh+dt@...nel.org>,
        devicetree@...r.kernel.org (open list:OPEN FIRMWARE AND FLATTENED
        DEVICE TREE BINDINGS), linux-kernel@...r.kernel.org (open list)
Subject: [PATCH v2] arm64: dts: renesas: r8a779a0: falcon-cpu: Add SW46 switch support

From: Kieran Bingham <kieran.bingham@...asonboard.com>

Add support for SW46-1 and SW46-2 as switches using the gpio-keys
framework.

Signed-off-by: Kieran Bingham <kieran.bingham@...asonboard.com>
---
v2:
 - Don't adjust the pin-config bias

SW_LID and SW_DOCK are selected as low-impact switch events for the
default configuration. Would SW_RFKILL_ALL, and SW_MUTE_DEVICE be
preferred as more 'functional' defaults? (I have otherwise avoided these
to hopefully prevent unwanted / undocumented effects occuring on
development hardware running a full interface which may parse these)

I'd expect them to be overridden by any platform using them anyway.

Testing this with evtest on the board shows this:

	kbingham@...con-v3u:~$ sudo evtest /dev/input/by-path/platform-keys-event
	Input driver version is 1.0.1
	Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
	Input device name: "keys"
	Supported events:
	  Event type 0 (EV_SYN)
	  Event type 1 (EV_KEY)
	    Event code 2 (KEY_1)
	    Event code 3 (KEY_2)
	    Event code 4 (KEY_3)
	  Event type 5 (EV_SW)
	    Event code 0 (SW_LID) state 0
	    Event code 5 (SW_DOCK) state 0
	Properties:
	Testing ... (interrupt to exit)
	Event: time 1635166698.832665, type 5 (EV_SW), code 5 (SW_DOCK), value 1
	Event: time 1635166698.832665, -------------- SYN_REPORT ------------
	Event: time 1635166701.661119, type 5 (EV_SW), code 0 (SW_LID), value 1
	Event: time 1635166701.661119, -------------- SYN_REPORT ------------
	Event: time 1635166711.453056, type 5 (EV_SW), code 5 (SW_DOCK), value 0
	Event: time 1635166711.453056, -------------- SYN_REPORT ------------
	Event: time 1635166712.791572, type 5 (EV_SW), code 0 (SW_LID), value 0
	Event: time 1635166712.791572, -------------- SYN_REPORT ------------

 .../boot/dts/renesas/r8a779a0-falcon-cpu.dtsi  | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a779a0-falcon-cpu.dtsi b/arch/arm64/boot/dts/renesas/r8a779a0-falcon-cpu.dtsi
index 1fe0cf0dcc99..0ca21a057530 100644
--- a/arch/arm64/boot/dts/renesas/r8a779a0-falcon-cpu.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a779a0-falcon-cpu.dtsi
@@ -83,6 +83,24 @@ keys {
 		pinctrl-0 = <&keys_pins>;
 		pinctrl-names = "default";
 
+		sw-1 {
+			gpios = <&gpio1 28 GPIO_ACTIVE_LOW>;
+			linux,code = <SW_LID>;
+			linux,input-type = <EV_SW>;
+			label = "SW46-1";
+			wakeup-source;
+			debounce-interval = <20>;
+		};
+
+		sw-2 {
+			gpios = <&gpio1 29 GPIO_ACTIVE_LOW>;
+			linux,code = <SW_DOCK>;
+			linux,input-type = <EV_SW>;
+			label = "SW46-2";
+			wakeup-source;
+			debounce-interval = <20>;
+		};
+
 		key-1 {
 			gpios = <&gpio6 18 GPIO_ACTIVE_LOW>;
 			linux,code = <KEY_1>;
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ