arm64: dts: rockchip: Add user button to Radxa E20C
authorJonas Karlman <jonas@kwiboo.se>
Mon, 7 Apr 2025 22:46:44 +0000 (22:46 +0000)
committerKever Yang <kever.yang@rock-chips.com>
Wed, 23 Apr 2025 14:12:03 +0000 (22:12 +0800)
Radxa E20C has two buttons, one SARADC maskrom button and one GPIO user
button.

Add support for the user button using a gpio-keys node.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Link: https://lore.kernel.org/r/20250304201642.831218-3-jonas@kwiboo.se
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
[ upstream commit: ad8afc8813567994164f2720189c819da8c22b99 ]

(cherry picked from commit 6793b56b79df26ab3323e5293b97577d0786ddb3)
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
dts/upstream/src/arm64/rockchip/rk3528-radxa-e20c.dts

index 7f02372..b378774 100644 (file)
@@ -7,6 +7,7 @@
 
 /dts-v1/;
 
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/leds/common.h>
 #include "rk3528.dtsi"
 
                stdout-path = "serial0:1500000n8";
        };
 
+       gpio-keys {
+               compatible = "gpio-keys";
+               pinctrl-names = "default";
+               pinctrl-0 = <&user_key>;
+
+               button-user {
+                       gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_LOW>;
+                       label = "USER";
+                       linux,code = <BTN_1>;
+                       wakeup-source;
+               };
+       };
+
        leds {
                compatible = "gpio-leds";
                pinctrl-names = "default";
 };
 
 &pinctrl {
+       gpio-keys {
+               user_key: user-key {
+                       rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>;
+               };
+       };
+
        leds {
                lan_led_g: lan-led-g {
                        rockchip,pins = <4 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;