Path: blob/master/Documentation/devicetree/bindings/iio/adc/adi,ad7173.yaml
26309 views
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)1# Copyright 2023 Analog Devices Inc.2%YAML 1.23---4$id: http://devicetree.org/schemas/iio/adc/adi,ad7173.yaml#5$schema: http://devicetree.org/meta-schemas/core.yaml#67title: Analog Devices AD7173 ADC89maintainers:10- Ceclan Dumitru <dumitru.ceclan@analog.com>1112description: |13Analog Devices AD717x ADC's:14The AD717x family offer a complete integrated Sigma-Delta ADC solution which15can be used in high precision, low noise single channel applications16(Life Science measurements) or higher speed multiplexed applications17(Factory Automation PLC Input modules). The Sigma-Delta ADC is intended18primarily for measurement of signals close to DC but also delivers19outstanding performance with input bandwidths out to ~10kHz.2021Analog Devices AD411x ADC's:22The AD411X family encompasses a series of low power, low noise, 24-bit,23sigma-delta analog-to-digital converters that offer a versatile range of24specifications. They integrate an analog front end suitable for processing25fully differential/single-ended and bipolar voltage inputs.2627Datasheets for supported chips:28https://www.analog.com/media/en/technical-documentation/data-sheets/AD4111.pdf29https://www.analog.com/media/en/technical-documentation/data-sheets/AD4112.pdf30<AD4113: not released yet>31https://www.analog.com/media/en/technical-documentation/data-sheets/AD4114.pdf32https://www.analog.com/media/en/technical-documentation/data-sheets/AD4115.pdf33https://www.analog.com/media/en/technical-documentation/data-sheets/AD4116.pdf34https://www.analog.com/media/en/technical-documentation/data-sheets/AD7172-2.pdf35https://www.analog.com/media/en/technical-documentation/data-sheets/AD7172-4.pdf36https://www.analog.com/media/en/technical-documentation/data-sheets/AD7173-8.pdf37https://www.analog.com/media/en/technical-documentation/data-sheets/AD7175-2.pdf38https://www.analog.com/media/en/technical-documentation/data-sheets/AD7175-8.pdf39https://www.analog.com/media/en/technical-documentation/data-sheets/AD7176-2.pdf40https://www.analog.com/media/en/technical-documentation/data-sheets/AD7177-2.pdf4142properties:43compatible:44enum:45- adi,ad411146- adi,ad411247- adi,ad411348- adi,ad411449- adi,ad411550- adi,ad411651- adi,ad7172-252- adi,ad7172-453- adi,ad7173-854- adi,ad7175-255- adi,ad7175-856- adi,ad7176-257- adi,ad7177-25859reg:60maxItems: 16162interrupts:63minItems: 164items:65- description: |66Ready: multiplexed with SPI data out. While SPI CS is low,67can be used to indicate the completion of a conversion.6869- description: |70Error: The three error bits in the status register (ADC_ERROR, CRC_ERROR,71and REG_ERROR) are OR'ed, inverted, and mapped to the ERROR pin.72Therefore, the ERROR pin indicates that an error has occurred.7374interrupt-names:75minItems: 176items:77- const: rdy78- const: err7980'#address-cells':81const: 18283'#size-cells':84const: 08586spi-max-frequency:87maximum: 200000008889gpio-controller:90description: Marks the device node as a GPIO controller.9192'#gpio-cells':93const: 294description:95The first cell is the GPIO number and the second cell specifies96GPIO flags, as defined in <dt-bindings/gpio/gpio.h>.9798vref-supply:99description: |100Differential external reference supply used for conversion. The reference101voltage (Vref) specified here must be the voltage difference between the102REF+ and REF- pins: Vref = (REF+) - (REF-).103104vref2-supply:105description: |106Differential external reference supply used for conversion. The reference107voltage (Vref2) specified here must be the voltage difference between the108REF2+ and REF2- pins: Vref2 = (REF2+) - (REF2-).109110avdd-supply:111description: Avdd supply, can be used as reference for conversion.112This supply is referenced to AVSS, voltage specified here113represents (AVDD1 - AVSS).114115avdd2-supply:116description: Avdd2 supply, used as the input to the internal voltage regulator.117This supply is referenced to AVSS, voltage specified here118represents (AVDD2 - AVSS).119120iovdd-supply:121description: iovdd supply, used for the chip digital interface.122123clocks:124maxItems: 1125description: |126Optional external clock source. Can include one clock source: external127clock or external crystal.128129clock-names:130enum:131- ext-clk132- xtal133134'#clock-cells':135const: 0136137rdy-gpios:138description:139GPIO reading the R̅D̅Y̅ line. Having such a GPIO is technically optional but140highly recommended because DOUT/R̅D̅Y̅ toggles during SPI transfers (in its141DOUT aka MISO role) and so usually triggers a spurious interrupt. The142distinction between such a spurious event and a real one can only be done143by reading such a GPIO. (There is a register telling the same144information, but accessing that one needs a SPI transfer which then145triggers another interrupt event.)146maxItems: 1147148patternProperties:149"^channel@[0-9a-f]$":150type: object151$ref: adc.yaml152unevaluatedProperties: false153154properties:155reg:156minimum: 0157maximum: 15158159diff-channels:160description: |161This property is used for defining the inputs of a differential162voltage channel. The first value is the positive input and the second163value is the negative input of the channel.164165Family AD411x supports a dedicated VINCOM voltage input.166To select it set the second channel to 16.167(VIN2, VINCOM) -> diff-channels = <2 16>168169There are special values that can be selected besides the voltage170analog inputs:17121: REF+17222: REF−173174Supported only by AD7172-2, AD7172-4, AD7175-2, AD7175-8, AD7177-2,175must be paired together and can be used to monitor the power supply176of the ADC:17719: ((AVDD1 − AVSS)/5)+17820: ((AVDD1 − AVSS)/5)−179180items:181minimum: 0182maximum: 31183184single-channel:185description: |186This property is used for defining a current channel or the positive187input of a voltage channel (single-ended or pseudo-differential).188189Models AD4111 and AD4112 support current channels.190Example: (IIN2+, IIN2−) -> single-channel = <2>191To correctly configure a current channel set the "adi,current-channel"192property to true.193194To configure a single-ended/pseudo-differential channel set the195"common-mode-channel" property to the desired negative voltage input.196197When used as a voltage channel, special inputs are valid as well.198minimum: 0199maximum: 31200201common-mode-channel:202description:203This property is used for defining the negative input of a204single-ended or pseudo-differential voltage channel.205206Special inputs are valid as well.207minimum: 0208maximum: 31209210adi,reference-select:211description: |212Select the reference source to use when converting on213the specific channel. Valid values are:214vref : REF+ /REF−215vref2 : REF2+ /REF2−216refout-avss: REFOUT/AVSS (Internal reference)217avdd : AVDD /AVSS218219External reference ref2 only available on ad7173-8 and ad7172-4.220Internal reference refout-avss not available on ad7172-4.221222If not specified, internal reference used (if available).223$ref: /schemas/types.yaml#/definitions/string224enum:225- vref226- vref2227- refout-avss228- avdd229default: refout-avss230231adi,current-channel:232$ref: /schemas/types.yaml#/definitions/flag233description: |234Signal that the selected inputs are current channels.235Only available on AD4111 and AD4112.236237required:238- reg239240allOf:241- oneOf:242- required: [single-channel]243properties:244diff-channels: false245- required: [diff-channels]246properties:247single-channel: false248adi,current-channel: false249common-mode-channel: false250251- if:252required: [common-mode-channel]253then:254properties:255adi,current-channel: false256257required:258- compatible259- reg260261allOf:262- $ref: /schemas/spi/spi-peripheral-props.yaml#263264# Only ad7172-4, ad7173-8 and ad7175-8 support vref2265- if:266properties:267compatible:268not:269contains:270enum:271- adi,ad7172-4272- adi,ad7173-8273- adi,ad7175-8274then:275properties:276vref2-supply: false277patternProperties:278"^channel@[0-9a-f]$":279properties:280adi,reference-select:281enum:282- vref283- refout-avss284- avdd285286- if:287properties:288compatible:289contains:290enum:291- adi,ad4114292- adi,ad4115293- adi,ad4116294- adi,ad7173-8295- adi,ad7175-8296then:297patternProperties:298"^channel@[0-9a-f]$":299properties:300reg:301maximum: 15302303- if:304properties:305compatible:306contains:307enum:308- adi,ad7172-2309- adi,ad7175-2310- adi,ad7176-2311- adi,ad7177-2312then:313patternProperties:314"^channel@[0-9a-f]$":315properties:316reg:317maximum: 3318319# Model ad7172-4 does not support internal reference320- if:321properties:322compatible:323contains:324const: adi,ad7172-4325then:326patternProperties:327"^channel@[0-9a-f]$":328properties:329reg:330maximum: 7331adi,reference-select:332enum:333- vref334- vref2335- avdd336required:337- adi,reference-select338339- if:340properties:341compatible:342contains:343enum:344- adi,ad4111345- adi,ad4112346- adi,ad4113347- adi,ad4114348- adi,ad4115349- adi,ad4116350then:351properties:352avdd2-supply: false353354- if:355properties:356compatible:357not:358contains:359enum:360- adi,ad4111361- adi,ad4112362then:363patternProperties:364"^channel@[0-9a-f]$":365properties:366adi,current-channel: false367368- if:369anyOf:370- required: [clock-names]371- required: [clocks]372then:373properties:374'#clock-cells': false375376unevaluatedProperties: false377378examples:379# Example AD7173-8 with external reference connected to REF+/REF-:380- |381#include <dt-bindings/gpio/gpio.h>382#include <dt-bindings/interrupt-controller/irq.h>383384spi {385#address-cells = <1>;386#size-cells = <0>;387388adc@0 {389compatible = "adi,ad7173-8";390reg = <0>;391392#address-cells = <1>;393#size-cells = <0>;394395interrupts = <25 IRQ_TYPE_EDGE_FALLING>;396interrupt-names = "rdy";397interrupt-parent = <&gpio>;398spi-max-frequency = <5000000>;399gpio-controller;400#gpio-cells = <2>;401#clock-cells = <0>;402403vref-supply = <&dummy_regulator>;404405channel@0 {406reg = <0>;407bipolar;408diff-channels = <0 1>;409adi,reference-select = "vref";410};411412channel@1 {413reg = <1>;414diff-channels = <2 3>;415};416417channel@2 {418reg = <2>;419bipolar;420diff-channels = <4 5>;421};422423channel@3 {424reg = <3>;425bipolar;426diff-channels = <6 7>;427};428429channel@4 {430reg = <4>;431diff-channels = <8 9>;432adi,reference-select = "avdd";433};434};435};436437# 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>441442spi {443#address-cells = <1>;444#size-cells = <0>;445446adc@0 {447compatible = "adi,ad4111";448reg = <0>;449450#address-cells = <1>;451#size-cells = <0>;452453interrupts = <25 IRQ_TYPE_EDGE_FALLING>;454interrupt-names = "rdy";455interrupt-parent = <&gpio>;456rdy-gpios = <&gpio 25 GPIO_ACTIVE_LOW>;457spi-max-frequency = <5000000>;458gpio-controller;459#gpio-cells = <2>;460#clock-cells = <0>;461462channel@0 {463reg = <0>;464bipolar;465diff-channels = <4 5>;466};467468// Single ended channel VIN2/VINCOM469channel@1 {470reg = <1>;471bipolar;472single-channel = <2>;473common-mode-channel = <16>;474};475476// Current channel IN2+/IN2-477channel@2 {478reg = <2>;479single-channel = <2>;480adi,current-channel;481};482};483};484485486