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