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