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
7title: Allwinner A10 LRADC Device Tree Bindings
8
9maintainers:
10  - Chen-Yu Tsai <wens@csie.org>
11  - Maxime Ripard <mripard@kernel.org>
12
13properties:
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
22  reg:
23    maxItems: 1
24
25  interrupts:
26    maxItems: 1
27
28  vref-supply:
29    description:
30      Regulator for the LRADC reference voltage
31
32patternProperties:
33  "^button-[0-9]+$":
34    type: object
35    properties:
36      label:
37        $ref: /schemas/types.yaml#/definitions/string
38        description: Descriptive name of the key
39
40      linux,code:
41        $ref: /schemas/types.yaml#/definitions/uint32
42        description: Keycode to emit
43
44      channel:
45        $ref: /schemas/types.yaml#/definitions/uint32
46        enum: [0, 1]
47        description: ADC Channel this key is attached to
48
49      voltage:
50        $ref: /schemas/types.yaml#/definitions/uint32
51        description:
52          Voltage in microvolts at LRADC input when this key is
53          pressed
54
55    required:
56      - label
57      - linux,code
58      - channel
59      - voltage
60
61    additionalProperties: false
62
63required:
64  - compatible
65  - reg
66  - interrupts
67  - vref-supply
68
69additionalProperties: false
70
71examples:
72  - |
73    lradc: lradc@1c22800 {
74        compatible = "allwinner,sun4i-a10-lradc-keys";
75        reg = <0x01c22800 0x100>;
76        interrupts = <31>;
77        vref-supply = <&reg_vcc3v0>;
78
79        button-191 {
80            label = "Volume Up";
81            linux,code = <115>;
82            channel = <0>;
83            voltage = <191274>;
84        };
85
86        button-392 {
87            label = "Volume Down";
88            linux,code = <114>;
89            channel = <0>;
90            voltage = <392644>;
91        };
92    };
93
94...
95