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
8title: AD7476 and similar simple SPI ADCs from multiple manufacturers.
9
10maintainers:
11  - Michael Hennerich <michael.hennerich@analog.com>
12
13description: |
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
18properties:
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  adi,conversion-start-gpios:
70    description: A GPIO used to trigger the start of a conversion
71    maxItems: 1
72
73required:
74  - compatible
75  - reg
76
77allOf:
78  - $ref: /schemas/spi/spi-peripheral-props.yaml#
79
80  # Devices where reference is vcc
81  - if:
82      properties:
83        compatible:
84          contains:
85            enum:
86              - adi,ad7091
87              - adi,ad7276
88              - adi,ad7277
89              - adi,ad7278
90              - adi,ad7466
91              - adi,ad7467
92              - adi,ad7468
93              - adi,ad7940
94              - ti,adc081s
95              - ti,adc101s
96              - ti,adc121s
97              - ti,ads7866
98              - ti,ads7868
99    then:
100      required:
101        - vcc-supply
102  # Devices with a vref
103  - if:
104      properties:
105        compatible:
106          contains:
107            enum:
108              - adi,ad7091r
109              - adi,ad7273
110              - adi,ad7274
111              - adi,ad7475
112              - lltc,ltc2314-14
113    then:
114      properties:
115        vref-supply: true
116    else:
117      properties:
118        vref-supply: false
119  # Devices with a vref where it is not optional
120  - if:
121      properties:
122        compatible:
123          contains:
124            enum:
125              - adi,ad7273
126              - adi,ad7274
127              - adi,ad7475
128              - lltc,ltc2314-14
129    then:
130      required:
131        - vref-supply
132  - if:
133      properties:
134        compatible:
135          contains:
136            enum:
137              - adi,ad7475
138              - adi,ad7495
139    then:
140      properties:
141        vdrive-supply: true
142    else:
143      properties:
144        vdrive-supply: false
145  - if:
146      properties:
147        compatible:
148          contains:
149            enum:
150              - adi,ad7091
151              - adi,ad7091r
152    then:
153      properties:
154        adi,conversion-start-gpios: true
155    else:
156      properties:
157        adi,conversion-start-gpios: false
158
159unevaluatedProperties: false
160
161examples:
162  - |
163    spi {
164      #address-cells = <1>;
165      #size-cells = <0>;
166
167      adc@0 {
168        compatible = "adi,ad7091r";
169        reg = <0>;
170        spi-max-frequency = <5000000>;
171        vcc-supply = <&adc_vcc>;
172        vref-supply = <&adc_vref>;
173      };
174    };
175...
176