xref: /linux/Documentation/devicetree/bindings/iio/adc/adi,ad4695.yaml (revision b40cafc1143600122719ae335359722538ed06e3)
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  interrupts:
88    minItems: 1
89    items:
90      - description: Signal coming from the BSY_ALT_GP0 pin (ALERT or BUSY).
91      - description: Signal coming from the GP2 pin (ALERT).
92      - description: Signal coming from the GP3 pin (BUSY).
93
94  interrupt-names:
95    minItems: 1
96    items:
97      - const: gp0
98      - const: gp2
99      - const: gp3
100
101  gpio-controller: true
102
103  "#gpio-cells":
104    const: 2
105    description: |
106      The first cell is the GPn number: 0 to 3.
107      The second cell takes standard GPIO flags.
108
109  "#address-cells":
110    const: 1
111
112  "#size-cells":
113    const: 0
114
115patternProperties:
116  "^in(?:[13579]|1[135])-supply$":
117    description:
118      Optional voltage supply for odd numbered channels when they are used as
119      the negative input for a pseudo-differential channel.
120
121  "^channel@[0-9a-f]$":
122    type: object
123    $ref: adc.yaml
124    unevaluatedProperties: false
125    description:
126      Describes each individual channel. In addition the properties defined
127      below, bipolar from adc.yaml is also supported.
128
129    properties:
130      reg:
131        maximum: 15
132
133      common-mode-channel:
134        description:
135          Describes the common mode channel for single channels. 0xFF is REFGND
136          and OxFE is COM. Macros are available for these values in
137          dt-bindings/iio/adi,ad4695.h. Values 1 to 15 correspond to INx inputs.
138          Only odd numbered INx inputs can be used as common mode channels.
139        items:
140          enum: [1, 3, 5, 7, 9, 11, 13, 15, 0xFE, 0xFF]
141        default: 0xFF
142
143      adi,no-high-z:
144        $ref: /schemas/types.yaml#/definitions/flag
145        description:
146          Enable this flag if the input pin requires the Analog Input High-Z
147          Mode to be disabled for proper operation.
148
149    required:
150      - reg
151
152    allOf:
153      # bipolar mode can't be used with REFGND
154      - if:
155          properties:
156            common-mode-channel:
157              const: 0xFF
158        then:
159          properties:
160            bipolar: false
161
162required:
163  - compatible
164  - reg
165  - avdd-supply
166  - vio-supply
167
168allOf:
169  - oneOf:
170      - required:
171          - ldo-in-supply
172      - required:
173          - vdd-supply
174
175  - oneOf:
176      - required:
177          - ref-supply
178      - required:
179          - refin-supply
180
181  # the internal reference buffer always requires high-z mode
182  - if:
183      required:
184        - refin-supply
185    then:
186      properties:
187        adi,no-ref-high-z: false
188
189  # limit channels for 8-channel chips
190  - if:
191      properties:
192        compatible:
193          contains:
194            enum:
195              - adi,ad4697
196              - adi,ad4698
197    then:
198      patternProperties:
199        "^in(?:9|1[135])-supply$": false
200        "^channel@[0-7]$":
201          properties:
202            reg:
203              maximum: 7
204            common-mode-channel:
205              items:
206                enum: [1, 3, 5, 7, 0xFE, 0xFF]
207        "^channel@[8-9a-f]$": false
208
209unevaluatedProperties: false
210
211examples:
212  - |
213    #include <dt-bindings/gpio/gpio.h>
214    #include <dt-bindings/iio/adi,ad4695.h>
215
216    spi {
217        #address-cells = <1>;
218        #size-cells = <0>;
219
220        adc@0 {
221            compatible = "adi,ad4695";
222            reg = <0>;
223            spi-cpol;
224            spi-cpha;
225            spi-max-frequency = <80000000>;
226            avdd-supply = <&power_supply>;
227            ldo-in-supply = <&power_supply>;
228            vio-supply = <&io_supply>;
229            refin-supply = <&supply_5V>;
230            com-supply = <&supply_2V5>;
231            in3-supply = <&supply_2V5>;
232            reset-gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
233
234            #address-cells = <1>;
235            #size-cells = <0>;
236
237            /* Pseudo-differential channel between IN0 and REFGND. */
238            channel@0 {
239                reg = <0>;
240            };
241
242            /* Pseudo-differential channel between IN1 and COM. */
243            channel@1 {
244                reg = <1>;
245                common-mode-channel = <AD4695_COMMON_MODE_COM>;
246                bipolar;
247            };
248
249            /* Pseudo-differential channel between IN2 and IN3. */
250            channel@2 {
251                reg = <2>;
252                common-mode-channel = <3>;
253                bipolar;
254            };
255        };
256    };
257