ARM: dts: rockchip: add recovery button for Rock2 Square
authorJohn Keeping <john@metanate.com>
Sun, 18 Feb 2018 17:03:35 +0000 (17:03 +0000)
committerHeiko Stuebner <heiko@sntech.de>
Mon, 19 Feb 2018 05:53:05 +0000 (06:53 +0100)
The recovery button is connected to ADC1.  This is the same setup as the
Firefly board, but for Rock2 the power supply is connected on the module
and all of the inputs are wired up to the edge connector, so use of the
ADC depends on the carrier board.

Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
arch/arm/boot/dts/rk3288-rock2-som.dtsi
arch/arm/boot/dts/rk3288-rock2-square.dts

index b9c471fcbd42b080305e2c89318dd2bea4036603..51f36a1b698ef8a30ca5cc29fe50df2f1dec5b8b 100644 (file)
        };
 };
 
+&saradc {
+       vref-supply = <&vcc_18>;
+};
+
 &tsadc {
        rockchip,hw-tshut-mode = <0>; /* tshut mode 0:CRU 1:GPIO */
        rockchip,hw-tshut-polarity = <0>; /* tshut polarity 0:LOW 1:HIGH */
index 6adeb331452fa5e8f5b4a72dc6ffb59cbb0ebd82..0ea2a3a1fa51a7b8fb89ae5896358da4602bef09 100644 (file)
                stdout-path = "serial2:115200n8";
        };
 
+       adc-keys {
+               compatible = "adc-keys";
+               io-channels = <&saradc 1>;
+               io-channel-names = "buttons";
+               keyup-threshold-microvolt = <1800000>;
+
+               button-recovery {
+                       label = "Recovery";
+                       linux,code = <KEY_VENDOR>;
+                       press-threshold-microvolt = <0>;
+               };
+       };
+
        gpio-keys {
                compatible = "gpio-keys";
 
        };
 };
 
+&saradc {
+       status = "okay";
+};
+
 &spdif {
        status = "okay";
 };