All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
To: Geert Uytterhoeven <geert@glider.be>,
	linux-renesas-soc@vger.kernel.org, linux-input@vger.kernel.org
Cc: Kieran Bingham <kieran.bingham@ideasonboard.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Magnus Damm <magnus.damm@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND
	FLATTENED DEVICE TREE BINDINGS),
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v2] arm64: dts: renesas: r8a779a0: falcon-cpu: Add SW46 switch support
Date: Mon, 25 Oct 2021 14:04:57 +0100	[thread overview]
Message-ID: <20211025130457.935122-1-kieran.bingham+renesas@ideasonboard.com> (raw)

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


             reply	other threads:[~2021-10-25 13:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-25 13:04 Kieran Bingham [this message]
2021-11-04 17:53 ` [PATCH] Input: add 'safe' user switch codes Kieran Bingham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211025130457.935122-1-kieran.bingham+renesas@ideasonboard.com \
    --to=kieran.bingham+renesas@ideasonboard.com \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=geert@glider.be \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.