keypad: add gpio and adc keypad support
authorXingyu Chen <xingyu.chen@amlogic.com>
Wed, 20 Jun 2018 09:25:40 +0000 (17:25 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Fri, 29 Jun 2018 07:46:21 +0000 (00:46 -0700)
PD#165090: keypad: add gpio and adc keypad support

Change-Id: Icf4ea20d8523eefa76abf70b8b844922ab1ca43e
Signed-off-by: Xingyu Chen <xingyu.chen@amlogic.com>
arch/arm64/boot/dts/amlogic/g12b_a311d_skt.dts
arch/arm64/boot/dts/amlogic/g12b_a311d_w400.dts

index d253603284104933c82ca8d63afcc7a0b4b6f7d1..32691520350de802a62fa6c32b5c6b6f5a23ed73 100644 (file)
                status = "okay";
        };
 
+       gpio_keypad {
+               compatible = "amlogic, gpio_keypad";
+               status = "okay";
+               scan_period = <20>;
+               key_num = <1>;
+               key_name = "power";
+               key_code = <116>;
+               key_pin = <&gpio_ao  GPIOAO_3  GPIO_ACTIVE_HIGH>;
+       };
+
+       adc_keypad {
+               compatible = "amlogic, adc_keypad";
+               status = "okay";
+               key_name = "menu", "vol-", "vol+", "esc", "home";
+               key_num = <5>;
+               io-channels = <&saradc SARADC_CH2>;
+               io-channel-names = "key-chan-2";
+               key_chan = <SARADC_CH2 SARADC_CH2 SARADC_CH2
+                       SARADC_CH2 SARADC_CH2>;
+               key_code = <139 114 115 1 102>;
+               key_val = <0 143 266 389 512>; //val=voltage/1800mV*1023
+               key_tolerance = <40 40 40 40 40>;
+       };
+
        unifykey{
                compatible = "amlogic, unifykey";
                status = "ok";
index 99520130412b455e3158247e28e48e024511d911..de012fac69e4e4d95df65ee7148676c7a4670135 100644 (file)
                status = "okay";
        };
 
+       gpio_keypad {
+               compatible = "amlogic, gpio_keypad";
+               status = "okay";
+               scan_period = <20>;
+               key_num = <1>;
+               key_name = "power";
+               key_code = <116>;
+               key_pin = <&gpio_ao  GPIOAO_3  GPIO_ACTIVE_HIGH>;
+       };
+
+       adc_keypad {
+               compatible = "amlogic, adc_keypad";
+               status = "okay";
+               key_name = "vol-", "vol+", "enter";
+               key_num = <3>;
+               io-channels = <&saradc SARADC_CH2>;
+               io-channel-names = "key-chan-2";
+               key_chan = <SARADC_CH2 SARADC_CH2 SARADC_CH2>;
+               key_code = <114 115 28>;
+               key_val = <143 266 389>; //val=voltage/1800mV*1023
+               key_tolerance = <40 40 40>;
+       };
+
        unifykey{
                compatible = "amlogic, unifykey";
                status = "ok";