]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
arm64: dts: rockchip: Add saradc and adc buttons to Khadas Edge 2 and enable tsadc
authorMuhammed Efe Cetin <efectn@protonmail.com>
Mon, 19 Feb 2024 22:34:22 +0000 (01:34 +0300)
committerHeiko Stuebner <heiko@sntech.de>
Wed, 10 Apr 2024 07:46:33 +0000 (09:46 +0200)
This commit enables tsadc, saradc and the
function button on saradc line for Khadas Edge 2.

Signed-off-by: Muhammed Efe Cetin <efectn@protonmail.com>
Link: https://lore.kernel.org/r/03feaafefd0c13268ba1630251558749654a567d.1708381247.git.efectn@protonmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
arch/arm64/boot/dts/rockchip/rk3588s-khadas-edge2.dts

index 8f012ce7a5c47c0b406455245d0120aecc859c6f..4600ed2f232b19f18c1564cb0e2470a167e910f5 100644 (file)
@@ -3,6 +3,7 @@
 /dts-v1/;
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/pinctrl/rockchip.h>
 #include <dt-bindings/leds/common.h>
 #include "rk3588s.dtsi"
                stdout-path = "serial2:1500000n8";
        };
 
+       adc-keys {
+               compatible = "adc-keys";
+               io-channels = <&saradc 1>;
+               io-channel-names = "buttons";
+               keyup-threshold-microvolt = <1800000>;
+               poll-interval = <100>;
+
+               button-function {
+                       label = "Function";
+                       linux,code = <KEY_FN>;
+                       press-threshold-microvolt = <17000>;
+               };
+       };
+
        ir-receiver {
                compatible = "gpio-ir-receiver";
                gpios = <&gpio1 RK_PA7 GPIO_ACTIVE_LOW>;
        status = "okay";
 };
 
+&saradc {
+       vref-supply = <&avcc_1v8_s0>;
+       status = "okay";
+};
+
 &sdhci {
        bus-width = <8>;
        no-sdio;
        };
 };
 
+&tsadc {
+       status = "okay";
+};
+
 &uart2 {
        pinctrl-0 = <&uart2m0_xfer>;
        status = "okay";