hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
ROCKCHIP ADC attached resistor ladder buttons
------------------------------------
 
Required properties:
 - compatible: "rockchip,key"
 - io-channels: Phandle to an ADC channel
 
Each button (key) is represented as a sub-node of "rockchip,key":
 
Required subnode-properties:
   - label: Descriptive name of the key.
   - linux,code: Keycode to emit.
   - rockchip,adc_value:: Voltage ADC input when this key is pressed.
 
Example:
 
#include <dt-bindings/input/input.h>
 
   rk_key: rockchip-key {
       compatible = "rockchip,key";
       status = "okay";
 
       io-channels = <&saradc 1>;
 
       vol-up-key {
           linux,code = <115>;
           label = "volume up";
           rockchip,adc_value = <1>;
       };
 
       vol-down-key {
           linux,code = <114>;
           label = "volume down";
           rockchip,adc_value = <170>;
       };
 
       power-key {
           gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
           linux,code = <116>;
           pinctrl-names = "default";
           pinctrl-0 = <&pwrbtn>;
           label = "power";
           gpio-key,wakeup;
       };
 
       menu-key {
           linux,code = <59>;
           label = "menu";
           rockchip,adc_value = <355>;
       };
 
       home-key {
           linux,code = <102>;
           label = "home";
           rockchip,adc_value = <746>;
       };
 
       back-key {
           linux,code = <158>;
           label = "back";
           rockchip,adc_value = <560>;
       };
 
       camera-key {
           linux,code = <212>;
           label = "camera";
           rockchip,adc_value = <450>;
       };
   };