]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - Bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
Import devicetree files from Linux 5.4
[FreeBSD/FreeBSD.git] / 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 Device Tree Bindings
8
9 maintainers:
10   - Chen-Yu Tsai <wens@csie.org>
11   - Maxime Ripard <maxime.ripard@bootlin.com>
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
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
32 patternProperties:
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         allOf:
46           - $ref: /schemas/types.yaml#/definitions/uint32
47           - enum: [0, 1]
48         description: ADC Channel this key is attached to
49
50       voltage:
51         $ref: /schemas/types.yaml#/definitions/uint32
52         description:
53           Voltage in microvolts at LRADC input when this key is
54           pressed
55
56     required:
57       - label
58       - linux,code
59       - channel
60       - voltage
61
62     additionalProperties: false
63
64 required:
65   - compatible
66   - reg
67   - interrupts
68   - vref-supply
69
70 additionalProperties: false
71
72 examples:
73   - |
74     lradc: lradc@1c22800 {
75         compatible = "allwinner,sun4i-a10-lradc-keys";
76         reg = <0x01c22800 0x100>;
77         interrupts = <31>;
78         vref-supply = <&reg_vcc3v0>;
79
80         button-191 {
81             label = "Volume Up";
82             linux,code = <115>;
83             channel = <0>;
84             voltage = <191274>;
85         };
86
87         button-392 {
88             label = "Volume Down";
89             linux,code = <114>;
90             channel = <0>;
91             voltage = <392644>;
92         };
93     };
94
95 ...