arm64: dts: rockchip: add adc key support for rk3399 linux project.
authorwenping.zhang <wenping.zhang@rock-chips.com>
Mon, 16 Jan 2017 03:44:23 +0000 (11:44 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 16 Jan 2017 11:20:30 +0000 (19:20 +0800)
we use linux upstream adc key driver to support adc keyboard.

Change-Id: Id93a4ab3d58ff92ce0fc11b35abd4d4b8d3737e0
Signed-off-by: wenping.zhang <wenping.zhang@rock-chips.com>
arch/arm64/boot/dts/rockchip/rk3399-sapphire-excavator-linux.dts

index 64b37120e26325f4413421006caa437b6e4b0d44..32b45420646e6433af73761d28b2fb89f19f004a 100644 (file)
                        debounce-interval = <100>;
                };
        };
+
+       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>;
+       };
+
+       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>;
+               };
+
+               back {
+                       label = "Back";
+                       linux,code = <KEY_BACK>;
+                       press-threshold-microvolt = <985000>;
+               };
+
+               menu {
+                       label = "Menu";
+                       linux,code = <KEY_MENU>;
+                       press-threshold-microvolt = <1314000>;
+               };
+       };
+};
+
+&saradc {
+       vref-supply = <&vccadc_ref>;
 };
 
 &vpu {