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