linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Jon Hunter <jonathanh@nvidia.com>,
	Prathamesh Shete <pshete@nvidia.com>,
	linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org
Subject: [PATCH v3 6/6] arm64: tegra: Enable gpio-keys on Jetson AGX Orin Developer Kit
Date: Wed,  8 Dec 2021 18:30:47 +0100	[thread overview]
Message-ID: <20211208173047.558108-6-thierry.reding@gmail.com> (raw)
In-Reply-To: <20211208173047.558108-1-thierry.reding@gmail.com>

From: Thierry Reding <treding@nvidia.com>

Expose power, force-recovery and sleep buttons via a gpio-keys device so
that userspace can receive events from them.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 .../nvidia/tegra234-p3737-0000+p3701-0000.dts | 31 +++++++++++++++++++
 arch/arm64/boot/dts/nvidia/tegra234.dtsi      |  1 +
 2 files changed, 32 insertions(+)

diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts
index e3bb874869df..699eaa66824d 100644
--- a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts
+++ b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts
@@ -1,6 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0
 /dts-v1/;
 
+#include <dt-bindings/input/linux-event-codes.h>
+#include <dt-bindings/input/gpio-keys.h>
+
 #include "tegra234-p3701-0000.dtsi"
 #include "tegra234-p3737-0000.dtsi"
 
@@ -18,6 +21,34 @@ chosen {
 		stdout-path = "serial0:115200n8";
 	};
 
+	gpio-keys {
+		compatible = "gpio-keys";
+		status = "okay";
+
+		force-recovery {
+			label = "Force Recovery";
+			gpios = <&gpio TEGRA234_MAIN_GPIO(G, 0) GPIO_ACTIVE_LOW>;
+			linux,input-type = <EV_KEY>;
+			linux,code = <BTN_1>;
+		};
+
+		power-key {
+			label = "Power";
+			gpios = <&gpio_aon TEGRA234_AON_GPIO(EE, 4) GPIO_ACTIVE_LOW>;
+			linux,input-type = <EV_KEY>;
+			linux,code = <KEY_POWER>;
+			wakeup-event-action = <EV_ACT_ASSERTED>;
+			wakeup-source;
+		};
+
+		suspend {
+			label = "Suspend";
+			gpios = <&gpio TEGRA234_MAIN_GPIO(G, 2) GPIO_ACTIVE_LOW>;
+			linux,input-type = <EV_KEY>;
+			linux,code = <KEY_SLEEP>;
+		};
+	};
+
 	tcu {
 		status = "okay";
 	};
diff --git a/arch/arm64/boot/dts/nvidia/tegra234.dtsi b/arch/arm64/boot/dts/nvidia/tegra234.dtsi
index f715671f0333..f8061b452046 100644
--- a/arch/arm64/boot/dts/nvidia/tegra234.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra234.dtsi
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 
 #include <dt-bindings/clock/tegra234-clock.h>
+#include <dt-bindings/gpio/tegra234-gpio.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/mailbox/tegra186-hsp.h>
 #include <dt-bindings/reset/tegra234-reset.h>
-- 
2.34.1


  parent reply	other threads:[~2021-12-08 17:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-08 17:30 [PATCH v3 1/6] dt-bindings: gpio: tegra: Convert to json-schema Thierry Reding
2021-12-08 17:30 ` [PATCH v3 2/6] dt-bindings: gpio: tegra186: " Thierry Reding
2021-12-08 19:21   ` Rob Herring
2021-12-10  1:47   ` Linus Walleij
2021-12-08 17:30 ` [PATCH v3 3/6] dt-bindings: gpio: Add Tegra234 support Thierry Reding
2021-12-08 19:22   ` Rob Herring
2021-12-10  1:48   ` Linus Walleij
2021-12-08 17:30 ` [PATCH v3 4/6] gpio: tegra186: Add support for Tegra234 Thierry Reding
2021-12-10  1:46   ` Linus Walleij
2021-12-08 17:30 ` [PATCH v3 5/6] arm64: tegra: Add main and AON GPIO controllers on Tegra234 Thierry Reding
2021-12-08 17:30 ` Thierry Reding [this message]
2021-12-08 19:01 ` [PATCH v3 1/6] dt-bindings: gpio: tegra: Convert to json-schema Rob Herring
2021-12-10  1:47 ` Linus Walleij

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=20211208173047.558108-6-thierry.reding@gmail.com \
    --to=thierry.reding@gmail.com \
    --cc=brgl@bgdev.pl \
    --cc=jonathanh@nvidia.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=pshete@nvidia.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).