xref: /freebsd/sys/contrib/device-tree/Bindings/iio/adc/adi,ad4000.yaml (revision b2d2a78ad80ec68d4a17f5aef97d21686cb1e29b)
1*b2d2a78aSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*b2d2a78aSEmmanuel Vadot%YAML 1.2
3*b2d2a78aSEmmanuel Vadot---
4*b2d2a78aSEmmanuel Vadot$id: http://devicetree.org/schemas/iio/adc/adi,ad4000.yaml#
5*b2d2a78aSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*b2d2a78aSEmmanuel Vadot
7*b2d2a78aSEmmanuel Vadottitle: Analog Devices AD4000 and similar Analog to Digital Converters
8*b2d2a78aSEmmanuel Vadot
9*b2d2a78aSEmmanuel Vadotmaintainers:
10*b2d2a78aSEmmanuel Vadot  - Marcelo Schmitt <marcelo.schmitt@analog.com>
11*b2d2a78aSEmmanuel Vadot
12*b2d2a78aSEmmanuel Vadotdescription: |
13*b2d2a78aSEmmanuel Vadot  Analog Devices AD4000 family of Analog to Digital Converters with SPI support.
14*b2d2a78aSEmmanuel Vadot  Specifications can be found at:
15*b2d2a78aSEmmanuel Vadot    https://www.analog.com/media/en/technical-documentation/data-sheets/ad4000-4004-4008.pdf
16*b2d2a78aSEmmanuel Vadot    https://www.analog.com/media/en/technical-documentation/data-sheets/ad4001-4005.pdf
17*b2d2a78aSEmmanuel Vadot    https://www.analog.com/media/en/technical-documentation/data-sheets/ad4002-4006-4010.pdf
18*b2d2a78aSEmmanuel Vadot    https://www.analog.com/media/en/technical-documentation/data-sheets/ad4003-4007-4011.pdf
19*b2d2a78aSEmmanuel Vadot    https://www.analog.com/media/en/technical-documentation/data-sheets/ad4020-4021-4022.pdf
20*b2d2a78aSEmmanuel Vadot    https://www.analog.com/media/en/technical-documentation/data-sheets/adaq4001.pdf
21*b2d2a78aSEmmanuel Vadot    https://www.analog.com/media/en/technical-documentation/data-sheets/adaq4003.pdf
22*b2d2a78aSEmmanuel Vadot
23*b2d2a78aSEmmanuel Vadot$ref: /schemas/spi/spi-peripheral-props.yaml#
24*b2d2a78aSEmmanuel Vadot
25*b2d2a78aSEmmanuel Vadotproperties:
26*b2d2a78aSEmmanuel Vadot  compatible:
27*b2d2a78aSEmmanuel Vadot    oneOf:
28*b2d2a78aSEmmanuel Vadot      - const: adi,ad4000
29*b2d2a78aSEmmanuel Vadot      - items:
30*b2d2a78aSEmmanuel Vadot          - enum:
31*b2d2a78aSEmmanuel Vadot              - adi,ad4004
32*b2d2a78aSEmmanuel Vadot              - adi,ad4008
33*b2d2a78aSEmmanuel Vadot          - const: adi,ad4000
34*b2d2a78aSEmmanuel Vadot
35*b2d2a78aSEmmanuel Vadot      - const: adi,ad4001
36*b2d2a78aSEmmanuel Vadot      - items:
37*b2d2a78aSEmmanuel Vadot          - enum:
38*b2d2a78aSEmmanuel Vadot              - adi,ad4005
39*b2d2a78aSEmmanuel Vadot          - const: adi,ad4001
40*b2d2a78aSEmmanuel Vadot
41*b2d2a78aSEmmanuel Vadot      - const: adi,ad4002
42*b2d2a78aSEmmanuel Vadot      - items:
43*b2d2a78aSEmmanuel Vadot          - enum:
44*b2d2a78aSEmmanuel Vadot              - adi,ad4006
45*b2d2a78aSEmmanuel Vadot              - adi,ad4010
46*b2d2a78aSEmmanuel Vadot          - const: adi,ad4002
47*b2d2a78aSEmmanuel Vadot
48*b2d2a78aSEmmanuel Vadot      - const: adi,ad4003
49*b2d2a78aSEmmanuel Vadot      - items:
50*b2d2a78aSEmmanuel Vadot          - enum:
51*b2d2a78aSEmmanuel Vadot              - adi,ad4007
52*b2d2a78aSEmmanuel Vadot              - adi,ad4011
53*b2d2a78aSEmmanuel Vadot          - const: adi,ad4003
54*b2d2a78aSEmmanuel Vadot
55*b2d2a78aSEmmanuel Vadot      - const: adi,ad4020
56*b2d2a78aSEmmanuel Vadot      - items:
57*b2d2a78aSEmmanuel Vadot          - enum:
58*b2d2a78aSEmmanuel Vadot              - adi,ad4021
59*b2d2a78aSEmmanuel Vadot              - adi,ad4022
60*b2d2a78aSEmmanuel Vadot          - const: adi,ad4020
61*b2d2a78aSEmmanuel Vadot
62*b2d2a78aSEmmanuel Vadot      - const: adi,adaq4001
63*b2d2a78aSEmmanuel Vadot
64*b2d2a78aSEmmanuel Vadot      - const: adi,adaq4003
65*b2d2a78aSEmmanuel Vadot
66*b2d2a78aSEmmanuel Vadot  reg:
67*b2d2a78aSEmmanuel Vadot    maxItems: 1
68*b2d2a78aSEmmanuel Vadot
69*b2d2a78aSEmmanuel Vadot  spi-max-frequency:
70*b2d2a78aSEmmanuel Vadot    maximum: 102040816 # for VIO > 2.7 V, 81300813 for VIO > 1.7 V
71*b2d2a78aSEmmanuel Vadot
72*b2d2a78aSEmmanuel Vadot  adi,sdi-pin:
73*b2d2a78aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/string
74*b2d2a78aSEmmanuel Vadot    enum: [ high, low, cs, sdi ]
75*b2d2a78aSEmmanuel Vadot    default: sdi
76*b2d2a78aSEmmanuel Vadot    description:
77*b2d2a78aSEmmanuel Vadot      Describes how the ADC SDI pin is wired. A value of "sdi" indicates that
78*b2d2a78aSEmmanuel Vadot      the ADC SDI is connected to host SDO. "high" indicates that the ADC SDI
79*b2d2a78aSEmmanuel Vadot      pin is hard-wired to logic high (VIO). "low" indicates that it is
80*b2d2a78aSEmmanuel Vadot      hard-wired low (GND). "cs" indicates that the ADC SDI pin is connected to
81*b2d2a78aSEmmanuel Vadot      the host CS line.
82*b2d2a78aSEmmanuel Vadot
83*b2d2a78aSEmmanuel Vadot  '#daisy-chained-devices': true
84*b2d2a78aSEmmanuel Vadot
85*b2d2a78aSEmmanuel Vadot  vdd-supply:
86*b2d2a78aSEmmanuel Vadot    description: A 1.8V supply that powers the chip (VDD).
87*b2d2a78aSEmmanuel Vadot
88*b2d2a78aSEmmanuel Vadot  vio-supply:
89*b2d2a78aSEmmanuel Vadot    description:
90*b2d2a78aSEmmanuel Vadot      A 1.8V to 5.5V supply for the digital inputs and outputs (VIO).
91*b2d2a78aSEmmanuel Vadot
92*b2d2a78aSEmmanuel Vadot  ref-supply:
93*b2d2a78aSEmmanuel Vadot    description:
94*b2d2a78aSEmmanuel Vadot      A 2.5 to 5V supply for the external reference voltage (REF).
95*b2d2a78aSEmmanuel Vadot
96*b2d2a78aSEmmanuel Vadot  cnv-gpios:
97*b2d2a78aSEmmanuel Vadot    description:
98*b2d2a78aSEmmanuel Vadot      When provided, this property indicates the GPIO that is connected to the
99*b2d2a78aSEmmanuel Vadot      CNV pin.
100*b2d2a78aSEmmanuel Vadot    maxItems: 1
101*b2d2a78aSEmmanuel Vadot
102*b2d2a78aSEmmanuel Vadot  adi,high-z-input:
103*b2d2a78aSEmmanuel Vadot    type: boolean
104*b2d2a78aSEmmanuel Vadot    description:
105*b2d2a78aSEmmanuel Vadot      High-Z mode allows the amplifier and RC filter in front of the ADC to be
106*b2d2a78aSEmmanuel Vadot      chosen based on the signal bandwidth of interest, rather than the settling
107*b2d2a78aSEmmanuel Vadot      requirements of the switched capacitor SAR ADC inputs.
108*b2d2a78aSEmmanuel Vadot
109*b2d2a78aSEmmanuel Vadot  adi,gain-milli:
110*b2d2a78aSEmmanuel Vadot    description: |
111*b2d2a78aSEmmanuel Vadot      The hardware gain applied to the ADC input (in milli units).
112*b2d2a78aSEmmanuel Vadot      The gain provided by the ADC input scaler is defined by the hardware
113*b2d2a78aSEmmanuel Vadot      connections between chip pins OUT+, R1K-, R1K1-, R1K+, R1K1+, and OUT-.
114*b2d2a78aSEmmanuel Vadot      If not present, default to 1000 (no actual gain applied).
115*b2d2a78aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint16
116*b2d2a78aSEmmanuel Vadot    enum: [454, 909, 1000, 1900]
117*b2d2a78aSEmmanuel Vadot    default: 1000
118*b2d2a78aSEmmanuel Vadot
119*b2d2a78aSEmmanuel Vadot  interrupts:
120*b2d2a78aSEmmanuel Vadot    description:
121*b2d2a78aSEmmanuel Vadot      The SDO pin can also function as a busy indicator. This node should be
122*b2d2a78aSEmmanuel Vadot      connected to an interrupt that is triggered when the SDO line goes low
123*b2d2a78aSEmmanuel Vadot      while the SDI line is high and the CNV line is low ("3-wire" mode) or the
124*b2d2a78aSEmmanuel Vadot      SDI line is low and the CNV line is high ("4-wire" mode); or when the SDO
125*b2d2a78aSEmmanuel Vadot      line goes high while the SDI and CNV lines are high (chain mode),
126*b2d2a78aSEmmanuel Vadot    maxItems: 1
127*b2d2a78aSEmmanuel Vadot
128*b2d2a78aSEmmanuel Vadotrequired:
129*b2d2a78aSEmmanuel Vadot  - compatible
130*b2d2a78aSEmmanuel Vadot  - reg
131*b2d2a78aSEmmanuel Vadot  - vdd-supply
132*b2d2a78aSEmmanuel Vadot  - vio-supply
133*b2d2a78aSEmmanuel Vadot  - ref-supply
134*b2d2a78aSEmmanuel Vadot
135*b2d2a78aSEmmanuel VadotallOf:
136*b2d2a78aSEmmanuel Vadot  # The configuration register can only be accessed if SDI is connected to MOSI
137*b2d2a78aSEmmanuel Vadot  - if:
138*b2d2a78aSEmmanuel Vadot      required:
139*b2d2a78aSEmmanuel Vadot        - adi,sdi-pin
140*b2d2a78aSEmmanuel Vadot    then:
141*b2d2a78aSEmmanuel Vadot      properties:
142*b2d2a78aSEmmanuel Vadot        adi,high-z-input: false
143*b2d2a78aSEmmanuel Vadot  # chain mode has lower SCLK max rate
144*b2d2a78aSEmmanuel Vadot  - if:
145*b2d2a78aSEmmanuel Vadot      required:
146*b2d2a78aSEmmanuel Vadot        - '#daisy-chained-devices'
147*b2d2a78aSEmmanuel Vadot    then:
148*b2d2a78aSEmmanuel Vadot      properties:
149*b2d2a78aSEmmanuel Vadot        spi-max-frequency:
150*b2d2a78aSEmmanuel Vadot          maximum: 50000000 # for VIO > 2.7 V, 40000000 for VIO > 1.7 V
151*b2d2a78aSEmmanuel Vadot  # Gain property only applies to ADAQ devices
152*b2d2a78aSEmmanuel Vadot  - if:
153*b2d2a78aSEmmanuel Vadot      properties:
154*b2d2a78aSEmmanuel Vadot        compatible:
155*b2d2a78aSEmmanuel Vadot          not:
156*b2d2a78aSEmmanuel Vadot            contains:
157*b2d2a78aSEmmanuel Vadot              enum:
158*b2d2a78aSEmmanuel Vadot                - adi,adaq4001
159*b2d2a78aSEmmanuel Vadot                - adi,adaq4003
160*b2d2a78aSEmmanuel Vadot    then:
161*b2d2a78aSEmmanuel Vadot      properties:
162*b2d2a78aSEmmanuel Vadot        adi,gain-milli: false
163*b2d2a78aSEmmanuel Vadot
164*b2d2a78aSEmmanuel VadotunevaluatedProperties: false
165*b2d2a78aSEmmanuel Vadot
166*b2d2a78aSEmmanuel Vadotexamples:
167*b2d2a78aSEmmanuel Vadot  - |
168*b2d2a78aSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
169*b2d2a78aSEmmanuel Vadot    spi {
170*b2d2a78aSEmmanuel Vadot        #address-cells = <1>;
171*b2d2a78aSEmmanuel Vadot        #size-cells = <0>;
172*b2d2a78aSEmmanuel Vadot        adc@0 {
173*b2d2a78aSEmmanuel Vadot            compatible = "adi,ad4020";
174*b2d2a78aSEmmanuel Vadot            reg = <0>;
175*b2d2a78aSEmmanuel Vadot            spi-max-frequency = <71000000>;
176*b2d2a78aSEmmanuel Vadot            vdd-supply = <&supply_1_8V>;
177*b2d2a78aSEmmanuel Vadot            vio-supply = <&supply_1_8V>;
178*b2d2a78aSEmmanuel Vadot            ref-supply = <&supply_5V>;
179*b2d2a78aSEmmanuel Vadot            adi,sdi-pin = "cs";
180*b2d2a78aSEmmanuel Vadot            cnv-gpios = <&gpio0 88 GPIO_ACTIVE_HIGH>;
181*b2d2a78aSEmmanuel Vadot        };
182*b2d2a78aSEmmanuel Vadot    };
183*b2d2a78aSEmmanuel Vadot  - |
184*b2d2a78aSEmmanuel Vadot    spi {
185*b2d2a78aSEmmanuel Vadot        #address-cells = <1>;
186*b2d2a78aSEmmanuel Vadot        #size-cells = <0>;
187*b2d2a78aSEmmanuel Vadot        adc@0 {
188*b2d2a78aSEmmanuel Vadot            compatible = "adi,adaq4003";
189*b2d2a78aSEmmanuel Vadot            reg = <0>;
190*b2d2a78aSEmmanuel Vadot            spi-max-frequency = <80000000>;
191*b2d2a78aSEmmanuel Vadot            vdd-supply = <&supply_1_8V>;
192*b2d2a78aSEmmanuel Vadot            vio-supply = <&supply_1_8V>;
193*b2d2a78aSEmmanuel Vadot            ref-supply = <&supply_5V>;
194*b2d2a78aSEmmanuel Vadot            adi,high-z-input;
195*b2d2a78aSEmmanuel Vadot            adi,gain-milli = /bits/ 16 <454>;
196*b2d2a78aSEmmanuel Vadot        };
197*b2d2a78aSEmmanuel Vadot    };
198