]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
arm64: dts: rockchip: enable button for 100ASK DshanPi A1
authorChukun Pan <amadeus@jmu.edu.cn>
Thu, 20 Nov 2025 12:00:09 +0000 (20:00 +0800)
committerHeiko Stuebner <heiko@sntech.de>
Fri, 21 Nov 2025 21:39:06 +0000 (22:39 +0100)
The 100ASK DshanPi A1 board has three ADC buttons and one
GPIO button. Enable them.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Link: https://patch.msgid.link/20251120120011.279104-4-amadeus@jmu.edu.cn
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
arch/arm64/boot/dts/rockchip/rk3576-100ask-dshanpi-a1.dts

index 815f75e7cd7041b2ebd399c1ac3cc1175d6a7338..9ef41f0c6920f1cb3107ac5a906714dd3eba0826 100644 (file)
@@ -7,6 +7,7 @@
 /dts-v1/;
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/leds/common.h>
 #include <dt-bindings/pinctrl/rockchip.h>
 #include <dt-bindings/soc/rockchip,vop2.h>
                };
        };
 
+       keys-0 {
+               compatible = "adc-keys";
+               io-channels = <&saradc 0>;
+               io-channel-names = "buttons";
+               keyup-threshold-microvolt = <1800000>;
+               poll-interval = <100>;
+
+               button-maskrom {
+                       label = "MASKROM";
+                       linux,code = <KEY_SETUP>;
+                       press-threshold-microvolt = <0>;
+               };
+       };
+
+       keys-1 {
+               compatible = "adc-keys";
+               io-channels = <&saradc 1>;
+               io-channel-names = "buttons";
+               keyup-threshold-microvolt = <1800000>;
+               poll-interval = <100>;
+
+               button-recovery {
+                       label = "RECOVERY";
+                       linux,code = <KEY_VENDOR>;
+                       press-threshold-microvolt = <0>;
+               };
+       };
+
+       keys-2 {
+               compatible = "adc-keys";
+               io-channels = <&saradc 4>;
+               io-channel-names = "buttons";
+               keyup-threshold-microvolt = <1800000>;
+               poll-interval = <100>;
+
+               button-user2 {
+                       label = "USER2";
+                       linux,code = <BTN_2>;
+                       press-threshold-microvolt = <0>;
+               };
+       };
+
+       keys-3 {
+               compatible = "gpio-keys";
+               pinctrl-names = "default";
+               pinctrl-0 = <&gpio0_a0_d>;
+
+               button-user1 {
+                       gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_LOW>;
+                       label = "USER1";
+                       linux,code = <BTN_1>;
+                       wakeup-source;
+               };
+       };
+
        vcc_in: regulator-vcc-12v0-dcin {
                compatible = "regulator-fixed";
                regulator-name = "vcc_in";
                };
        };
 
+       gpio-keys {
+               gpio0_a0_d: gpio0-a0-d {
+                       rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>;
+               };
+       };
+
        headphone {
                hp_det: hp-det {
                        rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
        status = "okay";
 };
 
+&saradc {
+       vref-supply = <&vcca1v8_pldo2_s0>;
+       status = "okay";
+};
+
 &sdhci {
        bus-width = <8>;
        full-pwr-cycle-in-suspend;