arm: dts: rk3288-evb add adc keys
authorJacob Chen <jacob2.chen@rock-chips.com>
Wed, 18 Jan 2017 07:45:08 +0000 (15:45 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Wed, 18 Jan 2017 08:14:41 +0000 (16:14 +0800)
Change-Id: I976f05f9152895c02d44c4eb741b5691d3539969
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
arch/arm/boot/dts/rk3288-evb.dtsi

index db399ca4ca90e1f5658dc5cebc16d64f125fc689..d8a64fd1c1f214f1e9139ec74471fe838a301959 100644 (file)
@@ -39,6 +39,7 @@
  */
 
 #include <dt-bindings/pwm/pwm.h>
+#include <dt-bindings/input/input.h>
 #include "rk3288.dtsi"
 
 / {
                #clock-cells = <0>;
        };
 
+       adc-keys {
+               compatible = "adc-keys";
+               io-channels = <&saradc 1>;
+               io-channel-names = "buttons";
+               poll-interval = <100>;
+               keyup-threshold-microvolt = <1800000>;
+
+               button-up {
+                       label = "Volume Up";
+                       linux,code = <KEY_VOLUMEUP>;
+                       press-threshold-microvolt = <100000>;
+               };
+
+               button-down {
+                       label = "Volume Down";
+                       linux,code = <KEY_VOLUMEDOWN>;
+                       press-threshold-microvolt = <300000>;
+               };
+
+               menu {
+                       label = "Menu";
+                       linux,code = <KEY_MENU>;
+                       press-threshold-microvolt = <640000>;
+               };
+
+               esc {
+                       label = "Esc";
+                       linux,code = <KEY_ESC>;
+                       press-threshold-microvolt = <1000000>;
+               };
+
+               home  {
+                       label = "Home";
+                       linux,code = <KEY_HOME>;
+                       press-threshold-microvolt = <1300000>;
+               };
+       };
+
        gpio-keys {
                compatible = "gpio-keys";
                #address-cells = <1>;
 
                button@0 {
                        gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
-                       linux,code = <116>;
+                       linux,code = <KEY_POWER>;
                        label = "GPIO Key Power";
                        linux,input-type = <1>;
                        gpio-key,wakeup = <1>;
                };
        };
 
+       vccadc_ref: vccadc-ref {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc1v8_sys";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+       };
+
        /* This turns on USB vbus for both host0 (ehci) and host1 (dwc2) */
        vcc_host: vcc-host-regulator {
                compatible = "regulator-fixed";
        };
 };
 
+&saradc {
+       vref-supply = <&vccadc_ref>;
+       status = "okay";
+};
+
 &sdmmc {
        supports-sd;
        bus-width = <4>;