Devicetree
 help / color / mirror / Atom feed
* [PATCH 0/2] arm64: tegra: Add gpio-keys for Jetson AGX Thor DevKit
@ 2026-08-27 14:54 Thierry Reding
  2026-08-27 14:54 ` [PATCH 1/2] arm64: tegra: Use consistent key code for force-recovery button Thierry Reding
  2026-08-27 14:54 ` [PATCH 2/2] arm64: tegra: Enable GPIO keys on Jetson AGX Thor Thierry Reding
  0 siblings, 2 replies; 3+ messages in thread
From: Thierry Reding @ 2026-08-27 14:54 UTC (permalink / raw)
  To: Thierry Reding, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Jonathan Hunter
  Cc: devicetree, linux-tegra, linux-kernel, Thierry Reding

This set of patches cleans up some existing gpio-keys DT nodes and adds
support for the power and force-recovery keys on Jetson AGX Thor.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
Thierry Reding (2):
      arm64: tegra: Use consistent key code for force-recovery button
      arm64: tegra: Enable GPIO keys on Jetson AGX Thor

 arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts |  2 +-
 .../boot/dts/nvidia/tegra234-p3737-0000+p3701.dtsi |  9 +--------
 .../dts/nvidia/tegra234-p3740-0002+p3701-0008.dts  |  9 +--------
 .../boot/dts/nvidia/tegra234-p3768-0000+p3767.dtsi |  2 +-
 .../boot/dts/nvidia/tegra264-p4071-0000+p3834.dtsi | 23 ++++++++++++++++++++++
 arch/arm64/boot/dts/nvidia/tegra264.dtsi           |  1 +
 6 files changed, 28 insertions(+), 18 deletions(-)
---
base-commit: 6a746cd265aed59107ebdaa9ce039bb832922969
change-id: 20260817-tegra264-gpio-keys-95479ebd99fc

Best regards,
--  
Thierry Reding <treding@nvidia.com>


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

* [PATCH 1/2] arm64: tegra: Use consistent key code for force-recovery button
  2026-08-27 14:54 [PATCH 0/2] arm64: tegra: Add gpio-keys for Jetson AGX Thor DevKit Thierry Reding
@ 2026-08-27 14:54 ` Thierry Reding
  2026-08-27 14:54 ` [PATCH 2/2] arm64: tegra: Enable GPIO keys on Jetson AGX Thor Thierry Reding
  1 sibling, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2026-08-27 14:54 UTC (permalink / raw)
  To: Thierry Reding, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Jonathan Hunter
  Cc: devicetree, linux-tegra, linux-kernel, Thierry Reding

From: Thierry Reding <treding@nvidia.com>

Some boards use the KEY_SLEEP input key code for the force-recovery
button, whereas others use BTN_1. The latter isn't valid because it only
applies to devices marked CAP_POINTER. Use KEY_SLEEP consistently for
all devices.

On certain Tegra234 devices there are definitions for a suspend key that
uses KEY_SLEEP, but I couldn't find any references to this key in any of
the board documents, so remove them.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts            | 2 +-
 arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701.dtsi     | 9 +--------
 arch/arm64/boot/dts/nvidia/tegra234-p3740-0002+p3701-0008.dts | 9 +--------
 arch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767.dtsi     | 2 +-
 4 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts b/arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts
index d78b9bd45df6..6c5f1b4765fc 100644
--- a/arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts
+++ b/arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts
@@ -1750,7 +1750,7 @@ key-force-recovery {
 			label = "Force Recovery";
 			gpios = <&gpio TEGRA_GPIO(X, 6) GPIO_ACTIVE_LOW>;
 			linux,input-type = <EV_KEY>;
-			linux,code = <BTN_1>;
+			linux,code = <KEY_SLEEP>;
 			debounce-interval = <30>;
 		};
 
diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701.dtsi b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701.dtsi
index 420858a8f4a8..9b990d1cef3f 100644
--- a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701.dtsi
@@ -391,7 +391,7 @@ key-force-recovery {
 			label = "Force Recovery";
 			gpios = <&gpio TEGRA234_MAIN_GPIO(G, 0) GPIO_ACTIVE_LOW>;
 			linux,input-type = <EV_KEY>;
-			linux,code = <BTN_1>;
+			linux,code = <KEY_SLEEP>;
 		};
 
 		key-power {
@@ -402,13 +402,6 @@ key-power {
 			wakeup-event-action = <EV_ACT_ASSERTED>;
 			wakeup-source;
 		};
-
-		key-suspend {
-			label = "Suspend";
-			gpios = <&gpio TEGRA234_MAIN_GPIO(G, 2) GPIO_ACTIVE_LOW>;
-			linux,input-type = <EV_KEY>;
-			linux,code = <KEY_SLEEP>;
-		};
 	};
 
 	fan: pwm-fan {
diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3740-0002+p3701-0008.dts b/arch/arm64/boot/dts/nvidia/tegra234-p3740-0002+p3701-0008.dts
index 97cede1fcb70..f5fb2d327650 100644
--- a/arch/arm64/boot/dts/nvidia/tegra234-p3740-0002+p3701-0008.dts
+++ b/arch/arm64/boot/dts/nvidia/tegra234-p3740-0002+p3701-0008.dts
@@ -337,7 +337,7 @@ key-force-recovery {
 			label = "Force Recovery";
 			gpios = <&gpio TEGRA234_MAIN_GPIO(G, 0) GPIO_ACTIVE_LOW>;
 			linux,input-type = <EV_KEY>;
-			linux,code = <BTN_1>;
+			linux,code = <KEY_SLEEP>;
 		};
 
 		key-power {
@@ -348,13 +348,6 @@ key-power {
 			wakeup-event-action = <EV_ACT_ASSERTED>;
 			wakeup-source;
 		};
-
-		key-suspend {
-			label = "Suspend";
-			gpios = <&gpio TEGRA234_MAIN_GPIO(G, 2) GPIO_ACTIVE_LOW>;
-			linux,input-type = <EV_KEY>;
-			linux,code = <KEY_SLEEP>;
-		};
 	};
 
 	serial {
diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767.dtsi b/arch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767.dtsi
index 41821354bbda..9b93074e5aed 100644
--- a/arch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra234-p3768-0000+p3767.dtsi
@@ -216,7 +216,7 @@ key-force-recovery {
 			label = "Force Recovery";
 			gpios = <&gpio TEGRA234_MAIN_GPIO(G, 0) GPIO_ACTIVE_LOW>;
 			linux,input-type = <EV_KEY>;
-			linux,code = <BTN_1>;
+			linux,code = <KEY_SLEEP>;
 		};
 
 		key-power {

-- 
2.55.0


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

* [PATCH 2/2] arm64: tegra: Enable GPIO keys on Jetson AGX Thor
  2026-08-27 14:54 [PATCH 0/2] arm64: tegra: Add gpio-keys for Jetson AGX Thor DevKit Thierry Reding
  2026-08-27 14:54 ` [PATCH 1/2] arm64: tegra: Use consistent key code for force-recovery button Thierry Reding
@ 2026-08-27 14:54 ` Thierry Reding
  1 sibling, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2026-08-27 14:54 UTC (permalink / raw)
  To: Thierry Reding, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Jonathan Hunter
  Cc: devicetree, linux-tegra, linux-kernel, Thierry Reding

From: Thierry Reding <treding@nvidia.com>

The power and force-recovery keys are mapped to standard GPIOs so they
can be enabled for all derived boards. In addition, the power key can be
used to wake the system from sleep, so it needs to be marked as a wakeup
source.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 .../boot/dts/nvidia/tegra264-p4071-0000+p3834.dtsi | 23 ++++++++++++++++++++++
 arch/arm64/boot/dts/nvidia/tegra264.dtsi           |  1 +
 2 files changed, 24 insertions(+)

diff --git a/arch/arm64/boot/dts/nvidia/tegra264-p4071-0000+p3834.dtsi b/arch/arm64/boot/dts/nvidia/tegra264-p4071-0000+p3834.dtsi
index 45f8df9bbfd6..c4ba3322ed9a 100644
--- a/arch/arm64/boot/dts/nvidia/tegra264-p4071-0000+p3834.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra264-p4071-0000+p3834.dtsi
@@ -1,5 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
 
+#include <dt-bindings/input/linux-event-codes.h>
+#include <dt-bindings/input/gpio-keys.h>
+
 / {
 	aliases {
 		serial0 = &{/bus@0/serial@c4e0000};
@@ -9,4 +12,24 @@ aliases {
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		key-force-recovery {
+			label = "Force Recovery";
+			gpios = <&gpio_aon TEGRA264_AON_GPIO(EE, 1) GPIO_ACTIVE_LOW>;
+			linux,input-type = <EV_KEY>;
+			linux,code = <KEY_SLEEP>;
+		};
+
+		key-power {
+			label = "Power";
+			gpios = <&gpio_aon TEGRA264_AON_GPIO(AA, 5) GPIO_ACTIVE_LOW>;
+			linux,input-type = <EV_KEY>;
+			linux,code = <KEY_POWER>;
+			wakeup-event-action = <EV_ACT_ASSERTED>;
+			wakeup-source;
+		};
+	};
 };
diff --git a/arch/arm64/boot/dts/nvidia/tegra264.dtsi b/arch/arm64/boot/dts/nvidia/tegra264.dtsi
index 013228a81723..a1a86022d638 100644
--- a/arch/arm64/boot/dts/nvidia/tegra264.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra264.dtsi
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
 
 #include <dt-bindings/clock/nvidia,tegra264.h>
+#include <dt-bindings/gpio/nvidia,tegra264-gpio.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/mailbox/tegra186-hsp.h>
 #include <dt-bindings/memory/nvidia,tegra264.h>

-- 
2.55.0


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

end of thread, other threads:[~2026-08-27 14:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-27 14:54 [PATCH 0/2] arm64: tegra: Add gpio-keys for Jetson AGX Thor DevKit Thierry Reding
2026-08-27 14:54 ` [PATCH 1/2] arm64: tegra: Use consistent key code for force-recovery button Thierry Reding
2026-08-27 14:54 ` [PATCH 2/2] arm64: tegra: Enable GPIO keys on Jetson AGX Thor Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox