File Index
Files and directories
Sign in
FILE

adi,ad7173.yaml

File preview with syntax highlighting.

linux-6.19.14/Documentation/devicetree/bindings/iio/adc/adi,ad7173.yaml YAML
  1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
  2# Copyright 2023 Analog Devices Inc.
  3%YAML 1.2
  4---
  5$id: http://devicetree.org/schemas/iio/adc/adi,ad7173.yaml#
  6$schema: http://devicetree.org/meta-schemas/core.yaml#
  7
  8title: Analog Devices AD7173 ADC
  9
 10maintainers:
 11  - Ceclan Dumitru <dumitru.ceclan@analog.com>
 12
 13description: |
 14  Analog Devices AD717x ADC's:
 15  The AD717x family offer a complete integrated Sigma-Delta ADC solution which
 16  can be used in high precision, low noise single channel applications
 17  (Life Science measurements) or higher speed multiplexed applications
 18  (Factory Automation PLC Input modules). The Sigma-Delta ADC is intended
 19  primarily for measurement of signals close to DC but also delivers
 20  outstanding performance with input bandwidths out to ~10kHz.
 21
 22  Analog Devices AD411x ADC's:
 23  The AD411X family encompasses a series of low power, low noise, 24-bit,
 24  sigma-delta analog-to-digital converters that offer a versatile range of
 25  specifications. They integrate an analog front end suitable for processing
 26  fully differential/single-ended and bipolar voltage inputs.
 27
 28  Datasheets for supported chips:
 29    https://www.analog.com/media/en/technical-documentation/data-sheets/AD4111.pdf
 30    https://www.analog.com/media/en/technical-documentation/data-sheets/AD4112.pdf
 31    <AD4113: not released yet>
 32    https://www.analog.com/media/en/technical-documentation/data-sheets/AD4114.pdf
 33    https://www.analog.com/media/en/technical-documentation/data-sheets/AD4115.pdf
 34    https://www.analog.com/media/en/technical-documentation/data-sheets/AD4116.pdf
 35    https://www.analog.com/media/en/technical-documentation/data-sheets/AD7172-2.pdf
 36    https://www.analog.com/media/en/technical-documentation/data-sheets/AD7172-4.pdf
 37    https://www.analog.com/media/en/technical-documentation/data-sheets/AD7173-8.pdf
 38    https://www.analog.com/media/en/technical-documentation/data-sheets/AD7175-2.pdf
 39    https://www.analog.com/media/en/technical-documentation/data-sheets/AD7175-8.pdf
 40    https://www.analog.com/media/en/technical-documentation/data-sheets/AD7176-2.pdf
 41    https://www.analog.com/media/en/technical-documentation/data-sheets/AD7177-2.pdf
 42
 43properties:
 44  compatible:
 45    enum:
 46      - adi,ad4111
 47      - adi,ad4112
 48      - adi,ad4113
 49      - adi,ad4114
 50      - adi,ad4115
 51      - adi,ad4116
 52      - adi,ad7172-2
 53      - adi,ad7172-4
 54      - adi,ad7173-8
 55      - adi,ad7175-2
 56      - adi,ad7175-8
 57      - adi,ad7176-2
 58      - adi,ad7177-2
 59
 60  reg:
 61    maxItems: 1
 62
 63  interrupts:
 64    minItems: 1
 65    items:
 66      - description: |
 67          Ready: multiplexed with SPI data out. While SPI CS is low,
 68          can be used to indicate the completion of a conversion.
 69
 70      - description: |
 71          Error: The three error bits in the status register (ADC_ERROR, CRC_ERROR,
 72          and REG_ERROR) are OR'ed, inverted, and mapped to the ERROR pin.
 73          Therefore, the ERROR pin indicates that an error has occurred.
 74
 75  interrupt-names:
 76    minItems: 1
 77    items:
 78      - const: rdy
 79      - const: err
 80
 81  '#address-cells':
 82    const: 1
 83
 84  '#size-cells':
 85    const: 0
 86
 87  spi-max-frequency:
 88    maximum: 20000000
 89
 90  gpio-controller:
 91    description: Marks the device node as a GPIO controller.
 92
 93  '#gpio-cells':
 94    const: 2
 95    description:
 96      The first cell is the GPIO number and the second cell specifies
 97      GPIO flags, as defined in <dt-bindings/gpio/gpio.h>.
 98
 99  vref-supply:
100    description: |
101      Differential external reference supply used for conversion. The reference
102      voltage (Vref) specified here must be the voltage difference between the
103      REF+ and REF- pins: Vref = (REF+) - (REF-).
104
105  vref2-supply:
106    description: |
107      Differential external reference supply used for conversion. The reference
108      voltage (Vref2) specified here must be the voltage difference between the
109      REF2+ and REF2- pins: Vref2 = (REF2+) - (REF2-).
110
111  avdd-supply:
112    description: Avdd supply, can be used as reference for conversion.
113                 This supply is referenced to AVSS, voltage specified here
114                 represents (AVDD1 - AVSS).
115
116  avdd2-supply:
117    description: Avdd2 supply, used as the input to the internal voltage regulator.
118                 This supply is referenced to AVSS, voltage specified here
119                 represents (AVDD2 - AVSS).
120
121  iovdd-supply:
122    description: iovdd supply, used for the chip digital interface.
123
124  clocks:
125    maxItems: 1
126    description: |
127      Optional external clock source. Can include one clock source: external
128      clock or external crystal.
129
130  clock-names:
131    enum:
132      - ext-clk
133      - xtal
134
135  '#clock-cells':
136    const: 0
137
138  rdy-gpios:
139    description:
140      GPIO reading the R̅D̅Y̅ line. Having such a GPIO is technically optional but
141      highly recommended because DOUT/R̅D̅Y̅ toggles during SPI transfers (in its
142      DOUT aka MISO role) and so usually triggers a spurious interrupt. The
143      distinction between such a spurious event and a real one can only be done
144      by reading such a GPIO. (There is a register telling the same
145      information, but accessing that one needs a SPI transfer which then
146      triggers another interrupt event.)
147    maxItems: 1
148
149patternProperties:
150  "^channel@[0-9a-f]$":
151    type: object
152    $ref: adc.yaml
153    unevaluatedProperties: false
154
155    properties:
156      reg:
157        minimum: 0
158        maximum: 15
159
160      diff-channels:
161        description: |
162          This property is used for defining the inputs of a differential
163          voltage channel. The first value is the positive input and the second
164          value is the negative input of the channel.
165
166          Family AD411x supports a dedicated VINCOM voltage input.
167          To select it set the second channel to 16.
168            (VIN2, VINCOM) -> diff-channels = <2 16>
169
170          There are special values that can be selected besides the voltage
171          analog inputs:
172            21: REF+
173            22: REF−
174
175          Supported only by AD7172-2, AD7172-4, AD7175-2, AD7175-8, AD7177-2,
176          must be paired together and can be used to monitor the power supply
177          of the ADC:
178            19: ((AVDD1 − AVSS)/5)+
179            20: ((AVDD1 − AVSS)/5)−
180
181        items:
182          minimum: 0
183          maximum: 31
184
185      single-channel:
186        description: |
187          This property is used for defining a current channel or the positive
188          input of a voltage channel (single-ended or pseudo-differential).
189
190          Models AD4111 and AD4112 support current channels.
191            Example: (IIN2+, IIN2−) -> single-channel = <2>
192          To correctly configure a current channel set the "adi,current-channel"
193          property to true.
194
195          To configure a single-ended/pseudo-differential channel set the
196          "common-mode-channel" property to the desired negative voltage input.
197
198          When used as a voltage channel, special inputs are valid as well.
199        minimum: 0
200        maximum: 31
201
202      common-mode-channel:
203        description:
204          This property is used for defining the negative input of a
205          single-ended or pseudo-differential voltage channel.
206
207          Special inputs are valid as well.
208        minimum: 0
209        maximum: 31
210
211      adi,reference-select:
212        description: |
213          Select the reference source to use when converting on
214          the specific channel. Valid values are:
215          vref       : REF+  /REF−
216          vref2      : REF2+ /REF2−
217          refout-avss: REFOUT/AVSS (Internal reference)
218          avdd       : AVDD  /AVSS
219
220          External reference ref2 only available on ad7173-8 and ad7172-4.
221          Internal reference refout-avss not available on ad7172-4.
222
223          If not specified, internal reference used (if available).
224        $ref: /schemas/types.yaml#/definitions/string
225        enum:
226          - vref
227          - vref2
228          - refout-avss
229          - avdd
230        default: refout-avss
231
232      adi,current-channel:
233        $ref: /schemas/types.yaml#/definitions/flag
234        description: |
235          Signal that the selected inputs are current channels.
236          Only available on AD4111 and AD4112.
237
238    required:
239      - reg
240
241    allOf:
242      - oneOf:
243          - required: [single-channel]
244            properties:
245              diff-channels: false
246          - required: [diff-channels]
247            properties:
248              single-channel: false
249              adi,current-channel: false
250              common-mode-channel: false
251
252      - if:
253          required: [common-mode-channel]
254        then:
255          properties:
256            adi,current-channel: false
257
258required:
259  - compatible
260  - reg
261
262allOf:
263  - $ref: /schemas/spi/spi-peripheral-props.yaml#
264
265  # Only ad7172-4, ad7173-8 and ad7175-8 support vref2
266  - if:
267      properties:
268        compatible:
269          not:
270            contains:
271              enum:
272                - adi,ad7172-4
273                - adi,ad7173-8
274                - adi,ad7175-8
275    then:
276      properties:
277        vref2-supply: false
278      patternProperties:
279        "^channel@[0-9a-f]$":
280          properties:
281            adi,reference-select:
282              enum:
283                - vref
284                - refout-avss
285                - avdd
286
287  - if:
288      properties:
289        compatible:
290          contains:
291            enum:
292              - adi,ad4114
293              - adi,ad4115
294              - adi,ad4116
295              - adi,ad7173-8
296              - adi,ad7175-8
297    then:
298      patternProperties:
299        "^channel@[0-9a-f]$":
300          properties:
301            reg:
302              maximum: 15
303
304  - if:
305      properties:
306        compatible:
307          contains:
308            enum:
309              - adi,ad7172-2
310              - adi,ad7175-2
311              - adi,ad7176-2
312              - adi,ad7177-2
313    then:
314      patternProperties:
315        "^channel@[0-9a-f]$":
316          properties:
317            reg:
318              maximum: 3
319
320  # Model ad7172-4 does not support internal reference
321  - if:
322      properties:
323        compatible:
324          contains:
325            const: adi,ad7172-4
326    then:
327      patternProperties:
328        "^channel@[0-9a-f]$":
329          properties:
330            reg:
331              maximum: 7
332            adi,reference-select:
333              enum:
334                - vref
335                - vref2
336                - avdd
337          required:
338            - adi,reference-select
339
340  - if:
341      properties:
342        compatible:
343          contains:
344            enum:
345              - adi,ad4111
346              - adi,ad4112
347              - adi,ad4113
348              - adi,ad4114
349              - adi,ad4115
350              - adi,ad4116
351    then:
352      properties:
353        avdd2-supply: false
354
355  - if:
356      properties:
357        compatible:
358          not:
359            contains:
360              enum:
361                - adi,ad4111
362                - adi,ad4112
363    then:
364      patternProperties:
365        "^channel@[0-9a-f]$":
366          properties:
367            adi,current-channel: false
368
369  - if:
370      anyOf:
371        - required: [clock-names]
372        - required: [clocks]
373    then:
374      properties:
375        '#clock-cells': false
376
377unevaluatedProperties: false
378
379examples:
380  # Example AD7173-8 with external reference connected to REF+/REF-:
381  - |
382    #include <dt-bindings/interrupt-controller/irq.h>
383
384    spi {
385      #address-cells = <1>;
386      #size-cells = <0>;
387
388      adc@0 {
389        compatible = "adi,ad7173-8";
390        reg = <0>;
391
392        #address-cells = <1>;
393        #size-cells = <0>;
394
395        interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
396        interrupt-names = "rdy";
397        interrupt-parent = <&gpio>;
398        spi-max-frequency = <5000000>;
399        gpio-controller;
400        #gpio-cells = <2>;
401        #clock-cells = <0>;
402
403        vref-supply = <&dummy_regulator>;
404
405        channel@0 {
406          reg = <0>;
407          bipolar;
408          diff-channels = <0 1>;
409          adi,reference-select = "vref";
410        };
411
412        channel@1 {
413          reg = <1>;
414          diff-channels = <2 3>;
415        };
416
417        channel@2 {
418          reg = <2>;
419          bipolar;
420          diff-channels = <4 5>;
421        };
422
423        channel@3 {
424          reg = <3>;
425          bipolar;
426          diff-channels = <6 7>;
427        };
428
429        channel@4 {
430          reg = <4>;
431          diff-channels = <8 9>;
432          adi,reference-select = "avdd";
433        };
434      };
435    };
436
437  # Example AD4111 with current channel and single-ended channel:
438  - |
439    #include <dt-bindings/gpio/gpio.h>
440    #include <dt-bindings/interrupt-controller/irq.h>
441
442    spi {
443      #address-cells = <1>;
444      #size-cells = <0>;
445
446       adc@0 {
447        compatible = "adi,ad4111";
448        reg = <0>;
449
450        #address-cells = <1>;
451        #size-cells = <0>;
452
453        interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
454        interrupt-names = "rdy";
455        interrupt-parent = <&gpio>;
456        rdy-gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
457        spi-max-frequency = <5000000>;
458        gpio-controller;
459        #gpio-cells = <2>;
460        #clock-cells = <0>;
461
462        channel@0 {
463          reg = <0>;
464          bipolar;
465          diff-channels = <4 5>;
466        };
467
468        // Single ended channel VIN2/VINCOM
469        channel@1 {
470          reg = <1>;
471          bipolar;
472          single-channel = <2>;
473          common-mode-channel = <16>;
474        };
475
476        // Current channel IN2+/IN2-
477        channel@2 {
478          reg = <2>;
479          single-channel = <2>;
480          adi,current-channel;
481        };
482      };
483    };
~/ Read-only file preview.