xref: /linux/Documentation/devicetree/bindings/iio/adc/adi,ad7380.yaml (revision 184e56e77c06a7eef68a021e9d4b11a11a8ab096)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/iio/adc/adi,ad7380.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Analog Devices Simultaneous Sampling Analog to Digital Converters
8
9maintainers:
10  - Michael Hennerich <Michael.Hennerich@analog.com>
11  - Nuno Sá <nuno.sa@analog.com>
12
13description: |
14  * https://www.analog.com/en/products/ad7380.html
15  * https://www.analog.com/en/products/ad7381.html
16  * https://www.analog.com/en/products/ad7383.html
17  * https://www.analog.com/en/products/ad7384.html
18  * https://www.analog.com/en/products/ad7386.html
19  * https://www.analog.com/en/products/ad7387.html
20  * https://www.analog.com/en/products/ad7388.html
21  * https://www.analog.com/en/products/ad7380-4.html
22  * https://www.analog.com/en/products/ad7381-4.html
23  * https://www.analog.com/en/products/ad7383-4.html
24  * https://www.analog.com/en/products/ad7384-4.html
25  * https://www.analog.com/en/products/ad7386-4.html
26  * https://www.analog.com/en/products/ad7387-4.html
27  * https://www.analog.com/en/products/ad7388-4.html
28  * https://www.analog.com/en/products/adaq4370-4.html
29  * https://www.analog.com/en/products/adaq4380-4.html
30  * https://www.analog.com/en/products/adaq4381-4.html
31
32
33$ref: /schemas/spi/spi-peripheral-props.yaml#
34
35properties:
36  compatible:
37    enum:
38      - adi,ad7380
39      - adi,ad7381
40      - adi,ad7383
41      - adi,ad7384
42      - adi,ad7386
43      - adi,ad7387
44      - adi,ad7388
45      - adi,ad7380-4
46      - adi,ad7381-4
47      - adi,ad7383-4
48      - adi,ad7384-4
49      - adi,ad7386-4
50      - adi,ad7387-4
51      - adi,ad7388-4
52      - adi,adaq4370-4
53      - adi,adaq4380-4
54      - adi,adaq4381-4
55
56  reg:
57    maxItems: 1
58
59  spi-max-frequency:
60    maximum: 80000000
61  spi-cpol: true
62  spi-cpha: true
63
64  vcc-supply:
65    description: A 3V to 3.6V supply that powers the chip.
66
67  vlogic-supply:
68    description:
69      A 1.65V to 3.6V supply for the logic pins.
70
71  refio-supply:
72    description:
73      A 2.5V to 3.3V supply for the external reference voltage. When omitted,
74      the internal 2.5V reference is used.
75
76  refin-supply:
77    description:
78      A 2.5V to 3.3V supply for external reference voltage, for ad7380-4 only.
79      For adaq devices, a 5V supply voltage. A 3.3V internal reference is
80      derived from it. Connect to vs-p-supply for normal operation.
81
82  vs-p-supply:
83    description:
84      Amplifiers positive supply.
85
86  vs-n-supply:
87    description:
88      Amplifiers negative supply.
89
90  ldo-supply:
91    description:
92      LDO supply. Connect to vs-p-supply or a 3.6 to 5.5 V supply.
93
94  aina-supply:
95    description:
96      The common mode voltage supply for the AINA- pin on pseudo-differential
97      chips.
98
99  ainb-supply:
100    description:
101      The common mode voltage supply for the AINB- pin on pseudo-differential
102      chips.
103
104  ainc-supply:
105    description:
106      The common mode voltage supply for the AINC- pin on pseudo-differential
107      chips.
108
109  aind-supply:
110    description:
111      The common mode voltage supply for the AIND- pin on pseudo-differential
112      chips.
113
114  interrupts:
115    description:
116      When the device is using 1-wire mode, this property is used to optionally
117      specify the ALERT interrupt.
118    maxItems: 1
119
120  "#address-cells":
121    const: 1
122
123  "#size-cells":
124    const: 0
125
126required:
127  - compatible
128  - reg
129  - vcc-supply
130  - vlogic-supply
131
132patternProperties:
133  "^channel@[0-3]$":
134    $ref: adc.yaml
135    type: object
136
137    properties:
138      reg:
139        description:
140          The channel number. From 0 to 3 corresponding to channels A,B,C,D
141        minimum: 0
142        maximum: 3
143
144      adi,gain-milli:
145        description:
146          The hardware gain applied to the ADC input (in milli units).
147          If not present, default to 1000 (no actual gain applied).
148          Refer to the typical connection diagrams section of the datasheet for
149          pin wiring.
150        $ref: /schemas/types.yaml#/definitions/uint16
151        enum: [300, 600, 1000, 1600]
152        default: 1000
153
154    required:
155      - reg
156
157    additionalProperties: false
158
159unevaluatedProperties: false
160
161allOf:
162  # pseudo-differential chips require common mode voltage supplies,
163  # true differential chips don't use them
164  - if:
165      properties:
166        compatible:
167          enum:
168            - adi,ad7383
169            - adi,ad7384
170            - adi,ad7383-4
171            - adi,ad7384-4
172    then:
173      required:
174        - aina-supply
175        - ainb-supply
176    else:
177      properties:
178        aina-supply: false
179        ainb-supply: false
180  - if:
181      properties:
182        compatible:
183          enum:
184            - adi,ad7383-4
185            - adi,ad7384-4
186    then:
187      required:
188        - ainc-supply
189        - aind-supply
190    else:
191      properties:
192        ainc-supply: false
193        aind-supply: false
194
195  # ad7380-4 uses refin-supply as external reference.
196  # adaq devices use internal reference only, derived from refin-supply
197  # All other chips from ad738x family use refio as optional external reference.
198  # When refio-supply is omitted, internal reference is used.
199  - if:
200      properties:
201        compatible:
202          enum:
203            - adi,ad7380-4
204            - adi,adaq4370-4
205            - adi,adaq4380-4
206            - adi,adaq4381-4
207    then:
208      properties:
209        refio-supply: false
210      required:
211        - refin-supply
212    else:
213      properties:
214        refin-supply: false
215
216  # adaq devices need more supplies and using channel to declare gain property
217  # only applies to adaq devices
218  - if:
219      properties:
220        compatible:
221          enum:
222            - adi,adaq4370-4
223            - adi,adaq4380-4
224            - adi,adaq4381-4
225    then:
226      required:
227        - vs-p-supply
228        - vs-n-supply
229        - ldo-supply
230    else:
231      properties:
232        vs-p-supply: false
233        vs-n-supply: false
234        ldo-supply: false
235      patternProperties:
236        "^channel@[0-3]$": false
237
238examples:
239  - |
240    #include <dt-bindings/interrupt-controller/irq.h>
241
242    spi {
243        #address-cells = <1>;
244        #size-cells = <0>;
245
246        adc@0 {
247            compatible = "adi,ad7380";
248            reg = <0>;
249
250            spi-cpol;
251            spi-cpha;
252            spi-max-frequency = <80000000>;
253
254            interrupts = <27 IRQ_TYPE_EDGE_FALLING>;
255            interrupt-parent = <&gpio0>;
256
257            vcc-supply = <&supply_3_3V>;
258            vlogic-supply = <&supply_3_3V>;
259            refio-supply = <&supply_2_5V>;
260        };
261    };
262
263  - |
264    #include <dt-bindings/interrupt-controller/irq.h>
265
266    spi {
267        #address-cells = <1>;
268        #size-cells = <0>;
269
270        adc@0 {
271            compatible = "adi,adaq4380-4";
272            reg = <0>;
273
274            spi-cpol;
275            spi-cpha;
276            spi-max-frequency = <80000000>;
277
278            interrupts = <27 IRQ_TYPE_EDGE_FALLING>;
279            interrupt-parent = <&gpio0>;
280
281            vcc-supply = <&supply_3_3V>;
282            vlogic-supply = <&supply_3_3V>;
283            refin-supply = <&supply_5V>;
284            vs-p-supply = <&supply_5V>;
285            vs-n-supply = <&supply_0V>;
286            ldo-supply = <&supply_5V>;
287
288            #address-cells = <1>;
289            #size-cells = <0>;
290
291            channel@0 {
292                reg = <0>;
293                adi,gain-milli = /bits/ 16 <300>;
294            };
295
296            channel@2 {
297                reg = <2>;
298                adi,gain-milli = /bits/ 16 <600>;
299            };
300
301            channel@3 {
302                reg = <3>;
303                adi,gain-milli = /bits/ 16 <1000>;
304            };
305        };
306    };
307