xref: /linux/Documentation/devicetree/bindings/iio/adc/adi,ad4695.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,ad4695.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Analog Devices Easy Drive Multiplexed SAR Analog to Digital Converters
8
9maintainers:
10  - Michael Hennerich <Michael.Hennerich@analog.com>
11  - Nuno Sá <nuno.sa@analog.com>
12
13description: |
14  A family of similar multi-channel analog to digital converters with SPI bus.
15
16  * https://www.analog.com/en/products/ad4695.html
17  * https://www.analog.com/en/products/ad4696.html
18  * https://www.analog.com/en/products/ad4697.html
19  * https://www.analog.com/en/products/ad4698.html
20
21$ref: /schemas/spi/spi-peripheral-props.yaml#
22
23properties:
24  compatible:
25    enum:
26      - adi,ad4695
27      - adi,ad4696
28      - adi,ad4697
29      - adi,ad4698
30
31  reg:
32    maxItems: 1
33
34  spi-max-frequency:
35    maximum: 80000000
36
37  spi-cpol: true
38  spi-cpha: true
39
40  spi-rx-bus-width:
41    minimum: 1
42    maximum: 4
43
44  avdd-supply:
45    description: Analog power supply.
46
47  vio-supply:
48    description: I/O pin power supply.
49
50  ldo-in-supply:
51    description: Internal LDO Input. Mutually exclusive with vdd-supply.
52
53  vdd-supply:
54    description: Core power supply. Mutually exclusive with ldo-in-supply.
55
56  ref-supply:
57    description:
58      External reference voltage. Mutually exclusive with refin-supply.
59
60  refin-supply:
61    description:
62      Internal reference buffer input. Mutually exclusive with ref-supply.
63
64  com-supply:
65    description: Common voltage supply for pseudo-differential analog inputs.
66
67  adi,no-ref-current-limit:
68    $ref: /schemas/types.yaml#/definitions/flag
69    description:
70      When this flag is present, the REF Overvoltage Reduced Current protection
71      is disabled.
72
73  adi,no-ref-high-z:
74    $ref: /schemas/types.yaml#/definitions/flag
75    description:
76      Enable this flag if the ref-supply requires Reference Input High-Z Mode
77      to be disabled for proper operation.
78
79  cnv-gpios:
80    description: The Convert Input (CNV). If omitted, CNV is tied to SPI CS.
81    maxItems: 1
82
83  reset-gpios:
84    description: The Reset Input (RESET). Should be configured GPIO_ACTIVE_LOW.
85    maxItems: 1
86
87  pwms:
88    description: PWM signal connected to the CNV pin.
89    maxItems: 1
90
91  interrupts:
92    minItems: 1
93    items:
94      - description: Signal coming from the BSY_ALT_GP0 pin (ALERT or BUSY).
95      - description: Signal coming from the GP2 pin (ALERT).
96      - description: Signal coming from the GP3 pin (BUSY).
97
98  interrupt-names:
99    minItems: 1
100    items:
101      - const: gp0
102      - const: gp2
103      - const: gp3
104
105  gpio-controller: true
106
107  "#gpio-cells":
108    const: 2
109    description: |
110      The first cell is the GPn number: 0 to 3.
111      The second cell takes standard GPIO flags.
112
113  '#trigger-source-cells':
114    description: |
115      First cell indicates the output signal: 0 = BUSY, 1 = ALERT.
116      Second cell indicates which GPn pin is used: 0, 2 or 3.
117
118      For convenience, macros for these values are available in
119      dt-bindings/iio/adc/adi,ad4695.h.
120    const: 2
121
122  "#address-cells":
123    const: 1
124
125  "#size-cells":
126    const: 0
127
128patternProperties:
129  "^in(?:[13579]|1[135])-supply$":
130    description:
131      Optional voltage supply for odd numbered channels when they are used as
132      the negative input for a pseudo-differential channel.
133
134  "^channel@[0-9a-f]$":
135    type: object
136    $ref: adc.yaml
137    unevaluatedProperties: false
138    description:
139      Describes each individual channel. In addition the properties defined
140      below, bipolar from adc.yaml is also supported.
141
142    properties:
143      reg:
144        maximum: 15
145
146      common-mode-channel:
147        description:
148          Describes the common mode channel for single channels. 0xFF is REFGND
149          and OxFE is COM. Macros are available for these values in
150          dt-bindings/iio/adc/adi,ad4695.h. Values 1 to 15 correspond to INx
151          inputs. Only odd numbered INx inputs can be used as common mode
152          channels.
153        enum: [1, 3, 5, 7, 9, 11, 13, 15, 0xFE, 0xFF]
154        default: 0xFF
155
156      adi,no-high-z:
157        $ref: /schemas/types.yaml#/definitions/flag
158        description:
159          Enable this flag if the input pin requires the Analog Input High-Z
160          Mode to be disabled for proper operation.
161
162    required:
163      - reg
164
165    allOf:
166      # bipolar mode can't be used with REFGND
167      - if:
168          properties:
169            common-mode-channel:
170              const: 0xFF
171        then:
172          properties:
173            bipolar: false
174
175required:
176  - compatible
177  - reg
178  - avdd-supply
179  - vio-supply
180
181allOf:
182  - oneOf:
183      - required:
184          - ldo-in-supply
185      - required:
186          - vdd-supply
187
188  - oneOf:
189      - required:
190          - ref-supply
191      - required:
192          - refin-supply
193
194  # the internal reference buffer always requires high-z mode
195  - if:
196      required:
197        - refin-supply
198    then:
199      properties:
200        adi,no-ref-high-z: false
201
202  # limit channels for 8-channel chips
203  - if:
204      properties:
205        compatible:
206          contains:
207            enum:
208              - adi,ad4697
209              - adi,ad4698
210    then:
211      patternProperties:
212        "^in(?:9|1[135])-supply$": false
213        "^channel@[0-7]$":
214          properties:
215            reg:
216              maximum: 7
217            common-mode-channel:
218              enum: [1, 3, 5, 7, 0xFE, 0xFF]
219        "^channel@[8-9a-f]$": false
220
221unevaluatedProperties: false
222
223examples:
224  - |
225    #include <dt-bindings/gpio/gpio.h>
226    #include <dt-bindings/iio/adc/adi,ad4695.h>
227
228    spi {
229        #address-cells = <1>;
230        #size-cells = <0>;
231
232        adc@0 {
233            compatible = "adi,ad4695";
234            reg = <0>;
235            spi-cpol;
236            spi-cpha;
237            spi-max-frequency = <80000000>;
238            avdd-supply = <&power_supply>;
239            ldo-in-supply = <&power_supply>;
240            vio-supply = <&io_supply>;
241            refin-supply = <&supply_5V>;
242            com-supply = <&supply_2V5>;
243            in3-supply = <&supply_2V5>;
244            reset-gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
245
246            #address-cells = <1>;
247            #size-cells = <0>;
248
249            /* Pseudo-differential channel between IN0 and REFGND. */
250            channel@0 {
251                reg = <0>;
252            };
253
254            /* Pseudo-differential channel between IN1 and COM. */
255            channel@1 {
256                reg = <1>;
257                common-mode-channel = <AD4695_COMMON_MODE_COM>;
258                bipolar;
259            };
260
261            /* Pseudo-differential channel between IN2 and IN3. */
262            channel@2 {
263                reg = <2>;
264                common-mode-channel = <3>;
265                bipolar;
266            };
267        };
268    };
269