Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux-2.6-microblaze.git] / Documentation / devicetree / bindings / iio / adc / adi,ad7476.yaml
1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2 # Copyright 2019 Analog Devices Inc.
3 %YAML 1.2
4 ---
5 $id: http://devicetree.org/schemas/iio/adc/adi,ad7476.yaml#
6 $schema: http://devicetree.org/meta-schemas/core.yaml#
7
8 title: AD7476 and similar simple SPI ADCs from multiple manufacturers.
9
10 maintainers:
11   - Michael Hennerich <michael.hennerich@analog.com>
12
13 description: |
14   A lot of simple SPI ADCs have very straight forward interfaces.
15   They typically don't provide a MOSI pin, simply reading out data
16   on MISO when the clock toggles.
17
18 properties:
19   compatible:
20     enum:
21       - adi,ad7091
22       - adi,ad7091r
23       - adi,ad7273
24       - adi,ad7274
25       - adi,ad7276
26       - adi,ad7277
27       - adi,ad7278
28       - adi,ad7466
29       - adi,ad7467
30       - adi,ad7468
31       - adi,ad7475
32       - adi,ad7476
33       - adi,ad7476a
34       - adi,ad7477
35       - adi,ad7477a
36       - adi,ad7478
37       - adi,ad7478a
38       - adi,ad7495
39       - adi,ad7910
40       - adi,ad7920
41       - adi,ad7940
42       - ti,adc081s
43       - ti,adc101s
44       - ti,adc121s
45       - ti,ads7866
46       - ti,ads7867
47       - ti,ads7868
48       - lltc,ltc2314-14
49
50   reg:
51     maxItems: 1
52
53   vcc-supply:
54     description:
55       Main powersupply voltage for the chips, sometimes referred to as VDD on
56       datasheets.  If there is no separate vref-supply, then this is needed
57       to establish channel scaling.
58
59   vdrive-supply:
60     description:
61       Some devices have separate supply for their digital control side.
62
63   vref-supply:
64     description:
65       Some devices have a specific reference voltage supplied on a different pin
66       to the other supplies. Needed to be able to establish channel scaling
67       unless there is also an internal reference available (e.g. ad7091r)
68
69   spi-max-frequency: true
70
71   adi,conversion-start-gpios:
72     description: A GPIO used to trigger the start of a conversion
73     maxItems: 1
74
75 required:
76   - compatible
77   - reg
78
79 additionalProperties: false
80
81 allOf:
82   # Devices where reference is vcc
83   - if:
84       properties:
85         compatible:
86           contains:
87             enum:
88               - adi,ad7091
89               - adi,ad7276
90               - adi,ad7277
91               - adi,ad7278
92               - adi,ad7466
93               - adi,ad7467
94               - adi,ad7468
95               - adi,ad7940
96               - ti,adc081s
97               - ti,adc101s
98               - ti,adc121s
99               - ti,ads7866
100               - ti,ads7868
101       required:
102         - vcc-supply
103   # Devices with a vref
104   - if:
105       properties:
106         compatible:
107           contains:
108             enum:
109               - adi,ad7091r
110               - adi,ad7273
111               - adi,ad7274
112               - adi,ad7475
113               - lltc,ltc2314-14
114     then:
115       properties:
116         vref-supply: true
117     else:
118       properties:
119         vref-supply: false
120   # Devices with a vref where it is not optional
121   - if:
122       properties:
123         compatible:
124           contains:
125             enum:
126               - adi,ad7273
127               - adi,ad7274
128               - adi,ad7475
129               - lltc,ltc2314-14
130     then:
131       required:
132         - vref-supply
133   - if:
134       properties:
135         compatible:
136           contains:
137             enum:
138               - adi,ad7475
139               - adi,ad7495
140     then:
141       properties:
142         vdrive-supply: true
143     else:
144       properties:
145         vdrive-supply: false
146   - if:
147       properties:
148         compatible:
149           contains:
150             enum:
151               - adi,ad7091
152               - adi,ad7091r
153     then:
154       properties:
155         adi,conversion-start-gpios: true
156     else:
157       properties:
158         adi,conversion-start-gpios: false
159
160 examples:
161   - |
162     spi {
163       #address-cells = <1>;
164       #size-cells = <0>;
165
166       adc@0 {
167         compatible = "adi,ad7091r";
168         reg = <0>;
169         spi-max-frequency = <5000000>;
170         vcc-supply = <&adc_vcc>;
171         vref-supply = <&adc_vref>;
172       };
173     };
174 ...