All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] arm64: dts: renesas: r8a779a0: falcon-cpu: Add SW46 switch support
@ 2021-10-25 13:04 Kieran Bingham
  2021-11-04 17:53 ` [PATCH] Input: add 'safe' user switch codes Kieran Bingham
  0 siblings, 1 reply; 2+ messages in thread
From: Kieran Bingham @ 2021-10-25 13:04 UTC (permalink / raw)
  To: Geert Uytterhoeven, linux-renesas-soc, linux-input
  Cc: Kieran Bingham, Geert Uytterhoeven, Magnus Damm, Rob Herring,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	open list

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

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

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.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@falcon-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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-04 17:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-25 13:04 [PATCH v2] arm64: dts: renesas: r8a779a0: falcon-cpu: Add SW46 switch support Kieran Bingham
2021-11-04 17:53 ` [PATCH] Input: add 'safe' user switch codes Kieran Bingham

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.