GNU Linux-libre 6.1.90-gnu
[releases.git] / Documentation / devicetree / bindings / input / allwinner,sun4i-a10-lradc-keys.yaml
1 # SPDX-License-Identifier: GPL-2.0
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/input/allwinner,sun4i-a10-lradc-keys.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Allwinner A10 LRADC
8
9 maintainers:
10   - Chen-Yu Tsai <wens@csie.org>
11   - Maxime Ripard <mripard@kernel.org>
12
13 properties:
14   compatible:
15     oneOf:
16       - const: allwinner,sun4i-a10-lradc-keys
17       - const: allwinner,sun8i-a83t-r-lradc
18       - items:
19           - const: allwinner,sun50i-a64-lradc
20           - const: allwinner,sun8i-a83t-r-lradc
21       - const: allwinner,sun50i-r329-lradc
22       - items:
23           - const: allwinner,sun20i-d1-lradc
24           - const: allwinner,sun50i-r329-lradc
25
26   reg:
27     maxItems: 1
28
29   clocks:
30     maxItems: 1
31
32   resets:
33     maxItems: 1
34
35   interrupts:
36     maxItems: 1
37
38   vref-supply:
39     description:
40       Regulator for the LRADC reference voltage
41
42   wakeup-source: true
43
44 patternProperties:
45   "^button-[0-9]+$":
46     type: object
47     $ref: input.yaml#
48     properties:
49       label:
50         $ref: /schemas/types.yaml#/definitions/string
51         description: Descriptive name of the key
52
53       linux,code: true
54
55       channel:
56         $ref: /schemas/types.yaml#/definitions/uint32
57         enum: [0, 1]
58         description: ADC Channel this key is attached to
59
60       voltage:
61         $ref: /schemas/types.yaml#/definitions/uint32
62         description:
63           Voltage in microvolts at LRADC input when this key is
64           pressed
65
66     required:
67       - label
68       - linux,code
69       - channel
70       - voltage
71
72     additionalProperties: false
73
74 required:
75   - compatible
76   - reg
77   - interrupts
78   - vref-supply
79
80 if:
81   properties:
82     compatible:
83       contains:
84         enum:
85           - allwinner,sun50i-r329-lradc
86
87 then:
88   required:
89     - clocks
90     - resets
91
92 additionalProperties: false
93
94 examples:
95   - |
96     lradc: lradc@1c22800 {
97         compatible = "allwinner,sun4i-a10-lradc-keys";
98         reg = <0x01c22800 0x100>;
99         interrupts = <31>;
100         vref-supply = <&reg_vcc3v0>;
101
102         button-191 {
103             label = "Volume Up";
104             linux,code = <115>;
105             channel = <0>;
106             voltage = <191274>;
107         };
108
109         button-392 {
110             label = "Volume Down";
111             linux,code = <114>;
112             channel = <0>;
113             voltage = <392644>;
114         };
115     };
116
117 ...