1 # SPDX-License-Identifier: GPL-2.0
4 $id: http://devicetree.org/schemas/input/adc-keys.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
7 title: ADC attached resistor ladder buttons
10 - Alexandre Belloni <alexandre.belloni@bootlin.com>
25 keyup-threshold-microvolt:
27 Voltage above or equal to which all the keys are considered up.
36 additionalProperties: false
38 Each button (key) is represented as a sub-node.
45 press-threshold-microvolt:
47 Voltage above or equal to which this key is considered pressed. No
48 two values of press-threshold-microvolt may be the same. All values
49 of press-threshold-microvolt must be less than
50 keyup-threshold-microvolt.
54 - press-threshold-microvolt
60 - keyup-threshold-microvolt
62 additionalProperties: false
66 #include <dt-bindings/input/input.h>
67 // +--------------------------------+------------------------+
68 // | 2.000.000 <= value | no key pressed |
69 // +--------------------------------+------------------------+
70 // | 1.500.000 <= value < 2.000.000 | KEY_VOLUMEUP pressed |
71 // +--------------------------------+------------------------+
72 // | 1.000.000 <= value < 1.500.000 | KEY_VOLUMEDOWN pressed |
73 // +--------------------------------+------------------------+
74 // | 500.000 <= value < 1.000.000 | KEY_ENTER pressed |
75 // +--------------------------------+------------------------+
76 // | value < 500.000 | no key pressed |
77 // +--------------------------------+------------------------+
80 compatible = "adc-keys";
81 io-channels = <&lradc 0>;
82 io-channel-names = "buttons";
83 keyup-threshold-microvolt = <2000000>;
87 linux,code = <KEY_VOLUMEUP>;
88 press-threshold-microvolt = <1500000>;
92 label = "Volume Down";
93 linux,code = <KEY_VOLUMEDOWN>;
94 press-threshold-microvolt = <1000000>;
99 linux,code = <KEY_ENTER>;
100 press-threshold-microvolt = <500000>;