]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm64: dts: rockchip: add gpio-keys to Qnap-TS433
authorHeiko Stuebner <heiko@sntech.de>
Mon, 28 Oct 2024 19:00:26 +0000 (20:00 +0100)
committerKever Yang <kever.yang@rock-chips.com>
Fri, 8 Nov 2024 09:05:35 +0000 (17:05 +0800)
The TS433 has 3 buttons, power and copy in the front as well as a reset
pinhole button on the back. The power-button is connected to the embedded
controller while the other two buttons are just gpio connected.

Add the gpio-keys definition for the two buttons we can handle right now.

Tested-by: Uwe Kleine-König <ukleinek@debian.org>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20240723195538.1133436-11-heiko@sntech.de
[ upstream commit: 9b682d31b24f1f70b5b4d0618095d46e0722b9d8 ]

(cherry picked from commit f0b858c751382ee9faf18f9b19b0817c6b50ac1c)
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
dts/upstream/src/arm64/rockchip/rk3568-qnap-ts433.dts

index 34fc31ea9a39ab4cb15e18dedd70c93db82a6a7c..9f964b6f411c9c1ec43fc3db65926a83b3946c77 100644 (file)
@@ -6,6 +6,7 @@
 
 /dts-v1/;
 
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/leds/common.h>
 #include <dt-bindings/gpio/gpio.h>
 #include "rk3568.dtsi"
                stdout-path = "serial2:115200n8";
        };
 
+       keys {
+               compatible = "gpio-keys";
+               pinctrl-0 = <&copy_button_pin>, <&reset_button_pin>;
+               pinctrl-names = "default";
+
+               key-copy {
+                       label = "copy";
+                       gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_COPY>;
+               };
+
+               key-reset {
+                       label = "reset";
+                       gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_RESTART>;
+               };
+       };
+
        leds {
                compatible = "gpio-leds";
 
 };
 
 &pinctrl {
+       keys {
+               copy_button_pin: copy-button-pin {
+                       rockchip,pins = <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_up>;
+               };
+
+               reset_button_pin: reset-button-pin {
+                       rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>;
+               };
+       };
+
        leds {
                hdd1_led_pin: hdd1-led-pin {
                        rockchip,pins = <1 RK_PD5 RK_FUNC_GPIO &pcfg_pull_up>;