xref: /linux/Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml (revision 8d71a5d8685025a0a95a73d3b130a45c91eaf8a4)
1416f882cSBeniamin Bia# SPDX-License-Identifier: GPL-2.0
2416f882cSBeniamin Bia%YAML 1.2
3416f882cSBeniamin Bia---
4416f882cSBeniamin Bia$id: http://devicetree.org/schemas/iio/adc/adi,ad7606.yaml#
5416f882cSBeniamin Bia$schema: http://devicetree.org/meta-schemas/core.yaml#
6416f882cSBeniamin Bia
7416f882cSBeniamin Biatitle: Analog Devices AD7606 Simultaneous Sampling ADC
8416f882cSBeniamin Bia
9416f882cSBeniamin Biamaintainers:
102e645db3SKrzysztof Kozlowski  - Michael Hennerich <michael.hennerich@analog.com>
11416f882cSBeniamin Bia
12416f882cSBeniamin Biadescription: |
13416f882cSBeniamin Bia  Analog Devices AD7606 Simultaneous Sampling ADC
1493a81104SGuillaume Stols  https://www.analog.com/media/en/technical-documentation/data-sheets/AD7605-4.pdf
15416f882cSBeniamin Bia  https://www.analog.com/media/en/technical-documentation/data-sheets/ad7606_7606-6_7606-4.pdf
166b4d6822SBeniamin Bia  https://www.analog.com/media/en/technical-documentation/data-sheets/AD7606B.pdf
17416f882cSBeniamin Bia  https://www.analog.com/media/en/technical-documentation/data-sheets/AD7616.pdf
18416f882cSBeniamin Bia
19416f882cSBeniamin Biaproperties:
20416f882cSBeniamin Bia  compatible:
21416f882cSBeniamin Bia    enum:
22416f882cSBeniamin Bia      - adi,ad7605-4
23416f882cSBeniamin Bia      - adi,ad7606-4
24555b1a1fSGuillaume Stols      - adi,ad7606-6
25555b1a1fSGuillaume Stols      - adi,ad7606-8  # Referred to as AD7606 (without -8) in the datasheet
266b4d6822SBeniamin Bia      - adi,ad7606b
27416f882cSBeniamin Bia      - adi,ad7616
28416f882cSBeniamin Bia
29416f882cSBeniamin Bia  reg:
30416f882cSBeniamin Bia    maxItems: 1
31416f882cSBeniamin Bia
32416f882cSBeniamin Bia  spi-cpha: true
33416f882cSBeniamin Bia
344828556dSRob Herring  spi-cpol: true
354828556dSRob Herring
36f3dde260SRob Herring  avcc-supply: true
37416f882cSBeniamin Bia
387248e099SGuillaume Stols  vdrive-supply:
397248e099SGuillaume Stols    description:
407248e099SGuillaume Stols      Determines the voltage level at which the interface logic pins will
417248e099SGuillaume Stols      operate.
427248e099SGuillaume Stols
437248e099SGuillaume Stols  refin-supply:
447248e099SGuillaume Stols    description:
457248e099SGuillaume Stols      The voltage supply for optional external reference voltage.
467248e099SGuillaume Stols
47416f882cSBeniamin Bia  interrupts:
48786cbd7cSGuillaume Stols    description:
49786cbd7cSGuillaume Stols      The BUSY pin falling edge indicates that the conversion is over, and thus
50786cbd7cSGuillaume Stols      new data is available.
51416f882cSBeniamin Bia    maxItems: 1
52416f882cSBeniamin Bia
53416f882cSBeniamin Bia  adi,conversion-start-gpios:
54416f882cSBeniamin Bia    description:
55*8d71a5d8SGuillaume Stols      Must be the device tree identifier of the CONVST pin(s). This logic input
56*8d71a5d8SGuillaume Stols      is used to initiate conversions on the analog input channels. As the line
57*8d71a5d8SGuillaume Stols      is active high, it should be marked GPIO_ACTIVE_HIGH.
58*8d71a5d8SGuillaume Stols    minItems: 1
59*8d71a5d8SGuillaume Stols    maxItems: 2
60416f882cSBeniamin Bia
61416f882cSBeniamin Bia  reset-gpios:
62416f882cSBeniamin Bia    description:
63a3b4a48fSGuillaume Stols      Must be the device tree identifier of the RESET pin. If specified, it will
64786cbd7cSGuillaume Stols      be asserted during driver probe. On the AD7606x, as the line is active
65786cbd7cSGuillaume Stols      high, it should be marked GPIO_ACTIVE_HIGH. On the AD7616, as the line is
66786cbd7cSGuillaume Stols      active low, it should be marked GPIO_ACTIVE_LOW.
67416f882cSBeniamin Bia    maxItems: 1
68416f882cSBeniamin Bia
69416f882cSBeniamin Bia  standby-gpios:
70416f882cSBeniamin Bia    description:
71a3b4a48fSGuillaume Stols      Must be the device tree identifier of the STBY pin. This pin is used to
72a3b4a48fSGuillaume Stols      place the AD7606 into one of two power-down modes, Standby mode or
73416f882cSBeniamin Bia      Shutdown mode. As the line is active low, it should be marked
74416f882cSBeniamin Bia      GPIO_ACTIVE_LOW.
75416f882cSBeniamin Bia    maxItems: 1
76416f882cSBeniamin Bia
77416f882cSBeniamin Bia  adi,first-data-gpios:
78416f882cSBeniamin Bia    description:
79a3b4a48fSGuillaume Stols      Must be the device tree identifier of the FRSTDATA pin. The FRSTDATA
80a3b4a48fSGuillaume Stols      output indicates when the first channel, V1, is being read back on either
81a3b4a48fSGuillaume Stols      the parallel, byte or serial interface. As the line is active high, it
82a3b4a48fSGuillaume Stols      should be marked GPIO_ACTIVE_HIGH.
83416f882cSBeniamin Bia    maxItems: 1
84416f882cSBeniamin Bia
85416f882cSBeniamin Bia  adi,range-gpios:
86416f882cSBeniamin Bia    description:
87786cbd7cSGuillaume Stols      Must be the device tree identifier of the RANGE pin. The state on this
88a3b4a48fSGuillaume Stols      pin determines the input range of the analog input channels. If this pin
89a3b4a48fSGuillaume Stols      is tied to a logic high, the analog input range is ±10V for all channels.
90786cbd7cSGuillaume Stols      On the AD760X, if this pin is tied to a logic low, the analog input range
91786cbd7cSGuillaume Stols      is ±5V for all channels. As the line is active high, it should be marked
92*8d71a5d8SGuillaume Stols      GPIO_ACTIVE_HIGH. On the AD7616, there are 2 pins, and if the 2 pins are
93*8d71a5d8SGuillaume Stols      tied to a logic high, software mode is enabled, otherwise one of the 3
94*8d71a5d8SGuillaume Stols      possible range values is selected.
95*8d71a5d8SGuillaume Stols    minItems: 1
96*8d71a5d8SGuillaume Stols    maxItems: 2
97416f882cSBeniamin Bia
98416f882cSBeniamin Bia  adi,oversampling-ratio-gpios:
99416f882cSBeniamin Bia    description:
100a3b4a48fSGuillaume Stols      Must be the device tree identifier of the over-sampling mode pins. As the
101786cbd7cSGuillaume Stols      line is active high, it should be marked GPIO_ACTIVE_HIGH. On the AD7606X
102786cbd7cSGuillaume Stols      parts that support it, if all 3 pins are tied to a logic high, software
103786cbd7cSGuillaume Stols      mode is enabled.
104a6c4f77cSBeniamin Bia    maxItems: 3
105416f882cSBeniamin Bia
106416f882cSBeniamin Bia  adi,sw-mode:
107416f882cSBeniamin Bia    description:
108786cbd7cSGuillaume Stols      Software mode of operation, so far available only for AD7616 and AD7606B.
109a3b4a48fSGuillaume Stols      It is enabled when all three oversampling mode pins are connected to high
110786cbd7cSGuillaume Stols      level for the AD7606B, or both the range selection are connected to high
111786cbd7cSGuillaume Stols      level for the AD7616. The device is configured by the corresponding
112786cbd7cSGuillaume Stols      registers. If the adi,oversampling-ratio-gpios property is defined, then
113786cbd7cSGuillaume Stols      the driver will set the oversampling gpios to high. Otherwise, it is
114786cbd7cSGuillaume Stols      assumed that the pins are hardwired to VDD.
115416f882cSBeniamin Bia    type: boolean
116416f882cSBeniamin Bia
117416f882cSBeniamin Biarequired:
118416f882cSBeniamin Bia  - compatible
119416f882cSBeniamin Bia  - reg
120416f882cSBeniamin Bia  - spi-cpha
121416f882cSBeniamin Bia  - avcc-supply
1227248e099SGuillaume Stols  - vdrive-supply
123416f882cSBeniamin Bia  - interrupts
124416f882cSBeniamin Bia  - adi,conversion-start-gpios
125416f882cSBeniamin Bia
12680137388SKrzysztof KozlowskiallOf:
12780137388SKrzysztof Kozlowski  - $ref: /schemas/spi/spi-peripheral-props.yaml#
12880137388SKrzysztof Kozlowski
129*8d71a5d8SGuillaume Stols  - if:
130*8d71a5d8SGuillaume Stols      properties:
131*8d71a5d8SGuillaume Stols        compatible:
132*8d71a5d8SGuillaume Stols          contains:
133*8d71a5d8SGuillaume Stols            const: adi,ad7616
134*8d71a5d8SGuillaume Stols    then:
135*8d71a5d8SGuillaume Stols      properties:
136*8d71a5d8SGuillaume Stols        adi,first-data-gpios: false
137*8d71a5d8SGuillaume Stols        standby-gpios: false
138*8d71a5d8SGuillaume Stols        adi,range-gpios:
139*8d71a5d8SGuillaume Stols          maxItems: 2
140*8d71a5d8SGuillaume Stols    else:
141*8d71a5d8SGuillaume Stols      properties:
142*8d71a5d8SGuillaume Stols        adi,range-gpios:
143*8d71a5d8SGuillaume Stols          maxItems: 1
144*8d71a5d8SGuillaume Stols
145*8d71a5d8SGuillaume Stols  - if:
146*8d71a5d8SGuillaume Stols      properties:
147*8d71a5d8SGuillaume Stols        compatible:
148*8d71a5d8SGuillaume Stols          contains:
149*8d71a5d8SGuillaume Stols            enum:
150*8d71a5d8SGuillaume Stols              - adi,ad7605-4
151*8d71a5d8SGuillaume Stols              - adi,ad7616
152*8d71a5d8SGuillaume Stols    then:
153*8d71a5d8SGuillaume Stols      properties:
154*8d71a5d8SGuillaume Stols        adi,oversampling-ratio-gpios: false
155*8d71a5d8SGuillaume Stols
156*8d71a5d8SGuillaume Stols  - if:
157*8d71a5d8SGuillaume Stols      properties:
158*8d71a5d8SGuillaume Stols        compatible:
159*8d71a5d8SGuillaume Stols          contains:
160*8d71a5d8SGuillaume Stols            enum:
161*8d71a5d8SGuillaume Stols              - adi,ad7605-4
162*8d71a5d8SGuillaume Stols              - adi,ad7606-4
163*8d71a5d8SGuillaume Stols              - adi,ad7606-6
164*8d71a5d8SGuillaume Stols              - adi,ad7606-8
165*8d71a5d8SGuillaume Stols    then:
166*8d71a5d8SGuillaume Stols      properties:
167*8d71a5d8SGuillaume Stols        adi,sw-mode: false
168*8d71a5d8SGuillaume Stols    else:
169*8d71a5d8SGuillaume Stols      properties:
170*8d71a5d8SGuillaume Stols        adi,conversion-start-gpios:
171*8d71a5d8SGuillaume Stols          maxItems: 1
172*8d71a5d8SGuillaume Stols
17380137388SKrzysztof KozlowskiunevaluatedProperties: false
1746fdc6e23SRob Herring
175416f882cSBeniamin Biaexamples:
176416f882cSBeniamin Bia  - |
177416f882cSBeniamin Bia    #include <dt-bindings/gpio/gpio.h>
178416f882cSBeniamin Bia    #include <dt-bindings/interrupt-controller/irq.h>
17946908557SKrzysztof Kozlowski    spi {
180416f882cSBeniamin Bia        #address-cells = <1>;
181416f882cSBeniamin Bia        #size-cells = <0>;
182416f882cSBeniamin Bia
183416f882cSBeniamin Bia        adc@0 {
184416f882cSBeniamin Bia            compatible = "adi,ad7606-8";
185416f882cSBeniamin Bia            reg = <0>;
186416f882cSBeniamin Bia            spi-max-frequency = <1000000>;
187416f882cSBeniamin Bia            spi-cpol;
188416f882cSBeniamin Bia            spi-cpha;
189416f882cSBeniamin Bia
190416f882cSBeniamin Bia            avcc-supply = <&adc_vref>;
1917248e099SGuillaume Stols            vdrive-supply = <&vdd_supply>;
192416f882cSBeniamin Bia
193416f882cSBeniamin Bia            interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
194416f882cSBeniamin Bia            interrupt-parent = <&gpio>;
195416f882cSBeniamin Bia
196416f882cSBeniamin Bia            adi,conversion-start-gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
197416f882cSBeniamin Bia            reset-gpios = <&gpio 27 GPIO_ACTIVE_HIGH>;
198416f882cSBeniamin Bia            adi,first-data-gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
199a6c4f77cSBeniamin Bia            adi,oversampling-ratio-gpios = <&gpio 18 GPIO_ACTIVE_HIGH>,
200a6c4f77cSBeniamin Bia                                           <&gpio 23 GPIO_ACTIVE_HIGH>,
201a6c4f77cSBeniamin Bia                                           <&gpio 26 GPIO_ACTIVE_HIGH>;
202416f882cSBeniamin Bia            standby-gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
203416f882cSBeniamin Bia        };
204416f882cSBeniamin Bia    };
205416f882cSBeniamin Bia...
206