xref: /freebsd/sys/contrib/device-tree/Bindings/input/allwinner,sun4i-a10-lradc-keys.yaml (revision 8bab661a3316d8bd9b9fbd11a3b4371b91507bd2)
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
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          - enum:
20              - allwinner,suniv-f1c100s-lradc
21              - allwinner,sun50i-a64-lradc
22          - const: allwinner,sun8i-a83t-r-lradc
23      - const: allwinner,sun50i-r329-lradc
24      - items:
25          - const: allwinner,sun20i-d1-lradc
26          - const: allwinner,sun50i-r329-lradc
27
28  reg:
29    maxItems: 1
30
31  clocks:
32    maxItems: 1
33
34  resets:
35    maxItems: 1
36
37  interrupts:
38    maxItems: 1
39
40  vref-supply:
41    description:
42      Regulator for the LRADC reference voltage
43
44  wakeup-source: true
45
46patternProperties:
47  "^button-[0-9]+$":
48    type: object
49    $ref: input.yaml#
50    properties:
51      label:
52        $ref: /schemas/types.yaml#/definitions/string
53        description: Descriptive name of the key
54
55      linux,code: true
56
57      channel:
58        $ref: /schemas/types.yaml#/definitions/uint32
59        enum: [0, 1]
60        description: ADC Channel this key is attached to
61
62      voltage:
63        $ref: /schemas/types.yaml#/definitions/uint32
64        description:
65          Voltage in microvolts at LRADC input when this key is
66          pressed
67
68    required:
69      - label
70      - linux,code
71      - channel
72      - voltage
73
74    additionalProperties: false
75
76required:
77  - compatible
78  - reg
79  - interrupts
80  - vref-supply
81
82if:
83  properties:
84    compatible:
85      contains:
86        enum:
87          - allwinner,sun50i-r329-lradc
88
89then:
90  required:
91    - clocks
92    - resets
93
94additionalProperties: false
95
96examples:
97  - |
98    lradc: lradc@1c22800 {
99        compatible = "allwinner,sun4i-a10-lradc-keys";
100        reg = <0x01c22800 0x100>;
101        interrupts = <31>;
102        vref-supply = <&reg_vcc3v0>;
103
104        button-191 {
105            label = "Volume Up";
106            linux,code = <115>;
107            channel = <0>;
108            voltage = <191274>;
109        };
110
111        button-392 {
112            label = "Volume Down";
113            linux,code = <114>;
114            channel = <0>;
115            voltage = <392644>;
116        };
117    };
118
119...
120