1*4882a593SmuzhiyunADC attached resistor ladder buttons 2*4882a593Smuzhiyun------------------------------------ 3*4882a593Smuzhiyun 4*4882a593SmuzhiyunRequired properties: 5*4882a593Smuzhiyun - compatible: "adc-keys" 6*4882a593Smuzhiyun - io-channels: Phandle to an ADC channel 7*4882a593Smuzhiyun - io-channel-names = "buttons"; 8*4882a593Smuzhiyun - keyup-threshold-microvolt: Voltage at which all the keys are considered up. 9*4882a593Smuzhiyun 10*4882a593SmuzhiyunOptional properties: 11*4882a593Smuzhiyun - poll-interval: Poll interval time in milliseconds 12*4882a593Smuzhiyun - autorepeat: Boolean, Enable auto repeat feature of Linux input 13*4882a593Smuzhiyun subsystem. 14*4882a593Smuzhiyun 15*4882a593SmuzhiyunEach button (key) is represented as a sub-node of "adc-keys": 16*4882a593Smuzhiyun 17*4882a593SmuzhiyunRequired subnode-properties: 18*4882a593Smuzhiyun - label: Descriptive name of the key. 19*4882a593Smuzhiyun - linux,code: Keycode to emit. 20*4882a593Smuzhiyun - press-threshold-microvolt: Voltage ADC input when this key is pressed. 21*4882a593Smuzhiyun 22*4882a593SmuzhiyunExample: 23*4882a593Smuzhiyun 24*4882a593Smuzhiyun#include <dt-bindings/input/input.h> 25*4882a593Smuzhiyun 26*4882a593Smuzhiyun adc-keys { 27*4882a593Smuzhiyun compatible = "adc-keys"; 28*4882a593Smuzhiyun io-channels = <&lradc 0>; 29*4882a593Smuzhiyun io-channel-names = "buttons"; 30*4882a593Smuzhiyun keyup-threshold-microvolt = <2000000>; 31*4882a593Smuzhiyun 32*4882a593Smuzhiyun button-up { 33*4882a593Smuzhiyun label = "Volume Up"; 34*4882a593Smuzhiyun linux,code = <KEY_VOLUMEUP>; 35*4882a593Smuzhiyun press-threshold-microvolt = <1500000>; 36*4882a593Smuzhiyun }; 37*4882a593Smuzhiyun 38*4882a593Smuzhiyun button-down { 39*4882a593Smuzhiyun label = "Volume Down"; 40*4882a593Smuzhiyun linux,code = <KEY_VOLUMEDOWN>; 41*4882a593Smuzhiyun press-threshold-microvolt = <1000000>; 42*4882a593Smuzhiyun }; 43*4882a593Smuzhiyun 44*4882a593Smuzhiyun button-enter { 45*4882a593Smuzhiyun label = "Enter"; 46*4882a593Smuzhiyun linux,code = <KEY_ENTER>; 47*4882a593Smuzhiyun press-threshold-microvolt = <500000>; 48*4882a593Smuzhiyun }; 49*4882a593Smuzhiyun }; 50