xref: /freebsd/sys/contrib/device-tree/Bindings/iio/adc/adi,ad4170-4.yaml (revision 833e5d42ab135b0238e61c5b3c19b8619677cbfa)
1*833e5d42SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*833e5d42SEmmanuel Vadot%YAML 1.2
3*833e5d42SEmmanuel Vadot---
4*833e5d42SEmmanuel Vadot$id: http://devicetree.org/schemas/iio/adc/adi,ad4170-4.yaml#
5*833e5d42SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*833e5d42SEmmanuel Vadot
7*833e5d42SEmmanuel Vadottitle: Analog Devices AD4170-4 and similar Analog to Digital Converters
8*833e5d42SEmmanuel Vadot
9*833e5d42SEmmanuel Vadotmaintainers:
10*833e5d42SEmmanuel Vadot  - Marcelo Schmitt <marcelo.schmitt@analog.com>
11*833e5d42SEmmanuel Vadot
12*833e5d42SEmmanuel Vadotdescription: |
13*833e5d42SEmmanuel Vadot  Analog Devices AD4170-4 series of Sigma-delta Analog to Digital Converters.
14*833e5d42SEmmanuel Vadot  Specifications can be found at:
15*833e5d42SEmmanuel Vadot    https://www.analog.com/media/en/technical-documentation/data-sheets/ad4170-4.pdf
16*833e5d42SEmmanuel Vadot    https://www.analog.com/media/en/technical-documentation/data-sheets/ad4190-4.pdf
17*833e5d42SEmmanuel Vadot    https://www.analog.com/media/en/technical-documentation/data-sheets/ad4195-4.pdf
18*833e5d42SEmmanuel Vadot
19*833e5d42SEmmanuel Vadot$ref: /schemas/spi/spi-peripheral-props.yaml#
20*833e5d42SEmmanuel Vadot
21*833e5d42SEmmanuel Vadot$defs:
22*833e5d42SEmmanuel Vadot  reference-buffer:
23*833e5d42SEmmanuel Vadot    description: |
24*833e5d42SEmmanuel Vadot      Enable precharge buffer, full buffer, or skip reference buffering of
25*833e5d42SEmmanuel Vadot      the positive/negative voltage reference. Because the output impedance
26*833e5d42SEmmanuel Vadot      of the source driving the voltage reference inputs may be dynamic,
27*833e5d42SEmmanuel Vadot      resistive/capacitive combinations of those inputs can cause DC gain
28*833e5d42SEmmanuel Vadot      errors if the reference inputs go unbuffered into the ADC. Enable
29*833e5d42SEmmanuel Vadot      reference buffering if the provided reference source has dynamic high
30*833e5d42SEmmanuel Vadot      impedance output. Note the absolute voltage allowed on REFINn+ and REFINn-
31*833e5d42SEmmanuel Vadot      inputs is from AVSS - 50 mV to AVDD + 50 mV when the reference buffers are
32*833e5d42SEmmanuel Vadot      disabled but narrows to AVSS to AVDD when reference buffering is enabled
33*833e5d42SEmmanuel Vadot      or in precharge mode.
34*833e5d42SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/string
35*833e5d42SEmmanuel Vadot    enum: [ precharge, full, disabled ]
36*833e5d42SEmmanuel Vadot    default: full
37*833e5d42SEmmanuel Vadot
38*833e5d42SEmmanuel Vadotproperties:
39*833e5d42SEmmanuel Vadot  compatible:
40*833e5d42SEmmanuel Vadot    enum:
41*833e5d42SEmmanuel Vadot      - adi,ad4170-4
42*833e5d42SEmmanuel Vadot      - adi,ad4190-4
43*833e5d42SEmmanuel Vadot      - adi,ad4195-4
44*833e5d42SEmmanuel Vadot
45*833e5d42SEmmanuel Vadot  avss-supply:
46*833e5d42SEmmanuel Vadot    description:
47*833e5d42SEmmanuel Vadot      Reference voltage supply for AVSS. A2.625V minimum and 0V maximum supply
48*833e5d42SEmmanuel Vadot      that powers the chip. If not provided, AVSS is assumed to be at system
49*833e5d42SEmmanuel Vadot      ground (0V).
50*833e5d42SEmmanuel Vadot
51*833e5d42SEmmanuel Vadot  avdd-supply:
52*833e5d42SEmmanuel Vadot    description:
53*833e5d42SEmmanuel Vadot      A supply of 4.75V to 5.25V relative to AVSS that powers the chip (AVDD).
54*833e5d42SEmmanuel Vadot
55*833e5d42SEmmanuel Vadot  iovdd-supply:
56*833e5d42SEmmanuel Vadot    description: 1.7V to 5.25V reference supply to the serial interface (IOVDD).
57*833e5d42SEmmanuel Vadot
58*833e5d42SEmmanuel Vadot  refin1p-supply:
59*833e5d42SEmmanuel Vadot    description: REFIN+ supply that can be used as reference for conversion.
60*833e5d42SEmmanuel Vadot
61*833e5d42SEmmanuel Vadot  refin1n-supply:
62*833e5d42SEmmanuel Vadot    description: REFIN- supply that can be used as reference for conversion.
63*833e5d42SEmmanuel Vadot
64*833e5d42SEmmanuel Vadot  refin2p-supply:
65*833e5d42SEmmanuel Vadot    description: REFIN2+ supply that can be used as reference for conversion.
66*833e5d42SEmmanuel Vadot
67*833e5d42SEmmanuel Vadot  refin2n-supply:
68*833e5d42SEmmanuel Vadot    description: REFIN2- supply that can be used as reference for conversion.
69*833e5d42SEmmanuel Vadot
70*833e5d42SEmmanuel Vadot  spi-cpol: true
71*833e5d42SEmmanuel Vadot
72*833e5d42SEmmanuel Vadot  spi-cpha: true
73*833e5d42SEmmanuel Vadot
74*833e5d42SEmmanuel Vadot  interrupts:
75*833e5d42SEmmanuel Vadot    description:
76*833e5d42SEmmanuel Vadot      Interrupt for signaling the completion of conversion results. The data
77*833e5d42SEmmanuel Vadot      ready signal (RDY) used as interrupt is by default provided on the SDO
78*833e5d42SEmmanuel Vadot      pin. Alternatively, it can be provided on the DIG_AUX1 pin in which case
79*833e5d42SEmmanuel Vadot      the chip disables the RDY function on SDO. Thus, there can be only one
80*833e5d42SEmmanuel Vadot      data ready interrupt enabled at a time.
81*833e5d42SEmmanuel Vadot
82*833e5d42SEmmanuel Vadot  interrupt-names:
83*833e5d42SEmmanuel Vadot    description:
84*833e5d42SEmmanuel Vadot      Specify which pin should be configured as Data Ready interrupt.
85*833e5d42SEmmanuel Vadot    enum:
86*833e5d42SEmmanuel Vadot      - sdo
87*833e5d42SEmmanuel Vadot      - dig_aux1
88*833e5d42SEmmanuel Vadot
89*833e5d42SEmmanuel Vadot  clocks:
90*833e5d42SEmmanuel Vadot    maxItems: 1
91*833e5d42SEmmanuel Vadot    description:
92*833e5d42SEmmanuel Vadot      Optional external clock source. Can specify either an external clock or
93*833e5d42SEmmanuel Vadot      external crystal.
94*833e5d42SEmmanuel Vadot
95*833e5d42SEmmanuel Vadot  clock-names:
96*833e5d42SEmmanuel Vadot    enum:
97*833e5d42SEmmanuel Vadot      - ext-clk
98*833e5d42SEmmanuel Vadot      - xtal
99*833e5d42SEmmanuel Vadot    default: ext-clk
100*833e5d42SEmmanuel Vadot
101*833e5d42SEmmanuel Vadot  '#clock-cells':
102*833e5d42SEmmanuel Vadot    const: 0
103*833e5d42SEmmanuel Vadot
104*833e5d42SEmmanuel Vadot  clock-output-names:
105*833e5d42SEmmanuel Vadot    maxItems: 1
106*833e5d42SEmmanuel Vadot
107*833e5d42SEmmanuel Vadot  gpio-controller: true
108*833e5d42SEmmanuel Vadot
109*833e5d42SEmmanuel Vadot  "#gpio-cells":
110*833e5d42SEmmanuel Vadot    const: 2
111*833e5d42SEmmanuel Vadot    description: |
112*833e5d42SEmmanuel Vadot      The first cell is for the GPIO number: 0 to 3.
113*833e5d42SEmmanuel Vadot      The second cell takes standard GPIO flags.
114*833e5d42SEmmanuel Vadot
115*833e5d42SEmmanuel Vadot  ldac-gpios:
116*833e5d42SEmmanuel Vadot    description:
117*833e5d42SEmmanuel Vadot      GPIO connected to DIG_AUX2 pin to be used as LDAC toggle to control the
118*833e5d42SEmmanuel Vadot      transfer of data from the DAC_INPUT_A register to the DAC.
119*833e5d42SEmmanuel Vadot    maxItems: 1
120*833e5d42SEmmanuel Vadot
121*833e5d42SEmmanuel Vadot  '#address-cells':
122*833e5d42SEmmanuel Vadot    const: 1
123*833e5d42SEmmanuel Vadot
124*833e5d42SEmmanuel Vadot  '#size-cells':
125*833e5d42SEmmanuel Vadot    const: 0
126*833e5d42SEmmanuel Vadot
127*833e5d42SEmmanuel Vadot  adi,vbias-pins:
128*833e5d42SEmmanuel Vadot    description: Analog inputs to apply a voltage bias of (AVDD − AVSS) / 2 to.
129*833e5d42SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32-array
130*833e5d42SEmmanuel Vadot    minItems: 1
131*833e5d42SEmmanuel Vadot    maxItems: 9
132*833e5d42SEmmanuel Vadot    items:
133*833e5d42SEmmanuel Vadot      minimum: 0
134*833e5d42SEmmanuel Vadot      maximum: 8
135*833e5d42SEmmanuel Vadot
136*833e5d42SEmmanuel VadotallOf:
137*833e5d42SEmmanuel Vadot  # Some devices don't have integrated DAC
138*833e5d42SEmmanuel Vadot  - if:
139*833e5d42SEmmanuel Vadot      properties:
140*833e5d42SEmmanuel Vadot        compatible:
141*833e5d42SEmmanuel Vadot          contains:
142*833e5d42SEmmanuel Vadot            enum:
143*833e5d42SEmmanuel Vadot              - adi,ad4190-4
144*833e5d42SEmmanuel Vadot              - adi,ad4195-4
145*833e5d42SEmmanuel Vadot    then:
146*833e5d42SEmmanuel Vadot      properties:
147*833e5d42SEmmanuel Vadot        ldac-gpios: false
148*833e5d42SEmmanuel Vadot
149*833e5d42SEmmanuel Vadot  # Require to specify the interrupt pin when using interrupts
150*833e5d42SEmmanuel Vadot  - if:
151*833e5d42SEmmanuel Vadot      required:
152*833e5d42SEmmanuel Vadot        - interrupts
153*833e5d42SEmmanuel Vadot    then:
154*833e5d42SEmmanuel Vadot      required:
155*833e5d42SEmmanuel Vadot        - interrupt-names
156*833e5d42SEmmanuel Vadot
157*833e5d42SEmmanuel Vadot  # If an external clock is set, the internal clock cannot go out and vice versa
158*833e5d42SEmmanuel Vadot  - oneOf:
159*833e5d42SEmmanuel Vadot      - required: [clocks]
160*833e5d42SEmmanuel Vadot        properties:
161*833e5d42SEmmanuel Vadot          '#clock-cells': false
162*833e5d42SEmmanuel Vadot      - required: ['#clock-cells']
163*833e5d42SEmmanuel Vadot        properties:
164*833e5d42SEmmanuel Vadot          clocks: false
165*833e5d42SEmmanuel Vadot
166*833e5d42SEmmanuel Vadotrequired:
167*833e5d42SEmmanuel Vadot  - compatible
168*833e5d42SEmmanuel Vadot  - reg
169*833e5d42SEmmanuel Vadot  - avdd-supply
170*833e5d42SEmmanuel Vadot  - iovdd-supply
171*833e5d42SEmmanuel Vadot  - spi-cpol
172*833e5d42SEmmanuel Vadot  - spi-cpha
173*833e5d42SEmmanuel Vadot
174*833e5d42SEmmanuel VadotunevaluatedProperties: false
175*833e5d42SEmmanuel Vadot
176*833e5d42SEmmanuel VadotpatternProperties:
177*833e5d42SEmmanuel Vadot  "^channel@[0-9a-f]$":
178*833e5d42SEmmanuel Vadot    $ref: /schemas/iio/adc/adc.yaml#
179*833e5d42SEmmanuel Vadot    unevaluatedProperties: false
180*833e5d42SEmmanuel Vadot    description:
181*833e5d42SEmmanuel Vadot      Represents the external channels which are connected to the ADC.
182*833e5d42SEmmanuel Vadot
183*833e5d42SEmmanuel Vadot    properties:
184*833e5d42SEmmanuel Vadot      reg:
185*833e5d42SEmmanuel Vadot        description:
186*833e5d42SEmmanuel Vadot          The channel number.
187*833e5d42SEmmanuel Vadot        minimum: 0
188*833e5d42SEmmanuel Vadot        maximum: 15
189*833e5d42SEmmanuel Vadot
190*833e5d42SEmmanuel Vadot      diff-channels:
191*833e5d42SEmmanuel Vadot        description: |
192*833e5d42SEmmanuel Vadot          This property is used for defining the inputs of a differential
193*833e5d42SEmmanuel Vadot          voltage channel. The first value is the positive input and the second
194*833e5d42SEmmanuel Vadot          value is the negative input of the channel.
195*833e5d42SEmmanuel Vadot
196*833e5d42SEmmanuel Vadot          Besides the analog input pins AIN0 to AIN8, there are special inputs
197*833e5d42SEmmanuel Vadot          that can be selected with the following values:
198*833e5d42SEmmanuel Vadot          17: Internal temperature sensor
199*833e5d42SEmmanuel Vadot          18: (AVDD-AVSS)/5
200*833e5d42SEmmanuel Vadot          19: (IOVDD-DGND)/5
201*833e5d42SEmmanuel Vadot          20: DAC output
202*833e5d42SEmmanuel Vadot          21: ALDO
203*833e5d42SEmmanuel Vadot          22: DLDO
204*833e5d42SEmmanuel Vadot          23: AVSS
205*833e5d42SEmmanuel Vadot          24: DGND
206*833e5d42SEmmanuel Vadot          25: REFIN+
207*833e5d42SEmmanuel Vadot          26: REFIN-
208*833e5d42SEmmanuel Vadot          27: REFIN2+
209*833e5d42SEmmanuel Vadot          28: REFIN2-
210*833e5d42SEmmanuel Vadot          29: REFOUT
211*833e5d42SEmmanuel Vadot          For the internal temperature sensor, use the input number for both
212*833e5d42SEmmanuel Vadot          inputs (i.e. diff-channels = <17 17>).
213*833e5d42SEmmanuel Vadot        items:
214*833e5d42SEmmanuel Vadot          enum: [0, 1, 2, 3, 4, 5, 6, 7, 8, 17, 18, 19, 20, 21, 22, 23, 24, 25,
215*833e5d42SEmmanuel Vadot                 26, 27, 28, 29]
216*833e5d42SEmmanuel Vadot
217*833e5d42SEmmanuel Vadot      adi,reference-select:
218*833e5d42SEmmanuel Vadot        description: |
219*833e5d42SEmmanuel Vadot          Select the reference source to use when converting on the
220*833e5d42SEmmanuel Vadot          specific channel. Valid values are:
221*833e5d42SEmmanuel Vadot          0: REFIN+/REFIN-
222*833e5d42SEmmanuel Vadot          1: REFIN2+/REFIN2−
223*833e5d42SEmmanuel Vadot          2: REFOUT/AVSS (internal reference)
224*833e5d42SEmmanuel Vadot          3: AVDD/AVSS
225*833e5d42SEmmanuel Vadot          If not specified, REFOUT/AVSS is used.
226*833e5d42SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
227*833e5d42SEmmanuel Vadot        enum: [0, 1, 2, 3]
228*833e5d42SEmmanuel Vadot        default: 1
229*833e5d42SEmmanuel Vadot
230*833e5d42SEmmanuel Vadot      adi,positive-reference-buffer:
231*833e5d42SEmmanuel Vadot        $ref: '#/$defs/reference-buffer'
232*833e5d42SEmmanuel Vadot
233*833e5d42SEmmanuel Vadot      adi,negative-reference-buffer:
234*833e5d42SEmmanuel Vadot        $ref: '#/$defs/reference-buffer'
235*833e5d42SEmmanuel Vadot
236*833e5d42SEmmanuel Vadot      adi,sensor-type:
237*833e5d42SEmmanuel Vadot        description:
238*833e5d42SEmmanuel Vadot          The AD4170-4 and similar designs have features to aid interfacing with
239*833e5d42SEmmanuel Vadot          load cell weigh scale, RTD, and thermocouple sensors. Each of those
240*833e5d42SEmmanuel Vadot          sensor types requires either distinct wiring configuration or
241*833e5d42SEmmanuel Vadot          external circuitry for proper sensor operation and can use different
242*833e5d42SEmmanuel Vadot          ADC chip functionality on their setups. A key characteristic of those
243*833e5d42SEmmanuel Vadot          external sensors is that they must be excited either by voltage supply
244*833e5d42SEmmanuel Vadot          or by ADC chip excitation signals. The sensor can then be read through
245*833e5d42SEmmanuel Vadot          a pair of analog inputs. This property specifies which particular
246*833e5d42SEmmanuel Vadot          sensor type is connected to the ADC so it can be properly setup and
247*833e5d42SEmmanuel Vadot          handled. Omit this property for conventional (not weigh scale, RTD, or
248*833e5d42SEmmanuel Vadot          thermocouple) ADC channel setups.
249*833e5d42SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/string
250*833e5d42SEmmanuel Vadot        enum: [ weighscale, rtd, thermocouple ]
251*833e5d42SEmmanuel Vadot
252*833e5d42SEmmanuel Vadot      adi,excitation-pin-0:
253*833e5d42SEmmanuel Vadot        description:
254*833e5d42SEmmanuel Vadot          Analog input to apply excitation current to while the channel
255*833e5d42SEmmanuel Vadot          is active.
256*833e5d42SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
257*833e5d42SEmmanuel Vadot        minimum: 0
258*833e5d42SEmmanuel Vadot        maximum: 20
259*833e5d42SEmmanuel Vadot        default: 0
260*833e5d42SEmmanuel Vadot
261*833e5d42SEmmanuel Vadot      adi,excitation-pin-1:
262*833e5d42SEmmanuel Vadot        description:
263*833e5d42SEmmanuel Vadot          Analog input to apply excitation current to while the channel
264*833e5d42SEmmanuel Vadot          is active.
265*833e5d42SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
266*833e5d42SEmmanuel Vadot        minimum: 0
267*833e5d42SEmmanuel Vadot        maximum: 20
268*833e5d42SEmmanuel Vadot        default: 0
269*833e5d42SEmmanuel Vadot
270*833e5d42SEmmanuel Vadot      adi,excitation-pin-2:
271*833e5d42SEmmanuel Vadot        description:
272*833e5d42SEmmanuel Vadot          Analog input to apply excitation current to while the channel
273*833e5d42SEmmanuel Vadot          is active.
274*833e5d42SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
275*833e5d42SEmmanuel Vadot        minimum: 0
276*833e5d42SEmmanuel Vadot        maximum: 20
277*833e5d42SEmmanuel Vadot        default: 0
278*833e5d42SEmmanuel Vadot
279*833e5d42SEmmanuel Vadot      adi,excitation-pin-3:
280*833e5d42SEmmanuel Vadot        description:
281*833e5d42SEmmanuel Vadot          Analog input to apply excitation current to while the channel
282*833e5d42SEmmanuel Vadot          is active.
283*833e5d42SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
284*833e5d42SEmmanuel Vadot        minimum: 0
285*833e5d42SEmmanuel Vadot        maximum: 20
286*833e5d42SEmmanuel Vadot        default: 0
287*833e5d42SEmmanuel Vadot
288*833e5d42SEmmanuel Vadot      adi,excitation-current-0-microamp:
289*833e5d42SEmmanuel Vadot        description:
290*833e5d42SEmmanuel Vadot          Excitation current in microamperes to be applied to pin specified in
291*833e5d42SEmmanuel Vadot          adi,excitation-pin-0 while this channel is active.
292*833e5d42SEmmanuel Vadot        enum: [0, 10, 50, 100, 250, 500, 1000, 1500]
293*833e5d42SEmmanuel Vadot        default: 0
294*833e5d42SEmmanuel Vadot
295*833e5d42SEmmanuel Vadot      adi,excitation-current-1-microamp:
296*833e5d42SEmmanuel Vadot        description:
297*833e5d42SEmmanuel Vadot          Excitation current in microamperes to be applied to pin specified in
298*833e5d42SEmmanuel Vadot          adi,excitation-pin-1 while this channel is active.
299*833e5d42SEmmanuel Vadot        enum: [0, 10, 50, 100, 250, 500, 1000, 1500]
300*833e5d42SEmmanuel Vadot        default: 0
301*833e5d42SEmmanuel Vadot
302*833e5d42SEmmanuel Vadot      adi,excitation-current-2-microamp:
303*833e5d42SEmmanuel Vadot        description:
304*833e5d42SEmmanuel Vadot          Excitation current in microamperes to be applied to pin specified in
305*833e5d42SEmmanuel Vadot          adi,excitation-pin-2 while this channel is active.
306*833e5d42SEmmanuel Vadot        enum: [0, 10, 50, 100, 250, 500, 1000, 1500]
307*833e5d42SEmmanuel Vadot        default: 0
308*833e5d42SEmmanuel Vadot
309*833e5d42SEmmanuel Vadot      adi,excitation-current-3-microamp:
310*833e5d42SEmmanuel Vadot        description:
311*833e5d42SEmmanuel Vadot          Excitation current in microamperes to be applied to pin specified in
312*833e5d42SEmmanuel Vadot          adi,excitation-pin-3 while this channel is active.
313*833e5d42SEmmanuel Vadot        enum: [0, 10, 50, 100, 250, 500, 1000, 1500]
314*833e5d42SEmmanuel Vadot        default: 0
315*833e5d42SEmmanuel Vadot
316*833e5d42SEmmanuel Vadot      adi,excitation-ac:
317*833e5d42SEmmanuel Vadot        type: boolean
318*833e5d42SEmmanuel Vadot        description:
319*833e5d42SEmmanuel Vadot          Whether the external sensor has to be AC or DC excited. When omitted,
320*833e5d42SEmmanuel Vadot          it is DC excited.
321*833e5d42SEmmanuel Vadot
322*833e5d42SEmmanuel Vadot    allOf:
323*833e5d42SEmmanuel Vadot      - oneOf:
324*833e5d42SEmmanuel Vadot          - required: [single-channel, common-mode-channel]
325*833e5d42SEmmanuel Vadot            properties:
326*833e5d42SEmmanuel Vadot              diff-channels: false
327*833e5d42SEmmanuel Vadot          - required: [diff-channels]
328*833e5d42SEmmanuel Vadot            properties:
329*833e5d42SEmmanuel Vadot              single-channel: false
330*833e5d42SEmmanuel Vadot              common-mode-channel: false
331*833e5d42SEmmanuel Vadot      # Usual ADC channels don't need external circuitry excitation.
332*833e5d42SEmmanuel Vadot      - if:
333*833e5d42SEmmanuel Vadot          not:
334*833e5d42SEmmanuel Vadot            required:
335*833e5d42SEmmanuel Vadot              - adi,sensor-type
336*833e5d42SEmmanuel Vadot        then:
337*833e5d42SEmmanuel Vadot          properties:
338*833e5d42SEmmanuel Vadot            adi,excitation-pin-0: false
339*833e5d42SEmmanuel Vadot            adi,excitation-pin-1: false
340*833e5d42SEmmanuel Vadot            adi,excitation-pin-2: false
341*833e5d42SEmmanuel Vadot            adi,excitation-pin-3: false
342*833e5d42SEmmanuel Vadot            adi,excitation-current-0-microamp: false
343*833e5d42SEmmanuel Vadot            adi,excitation-current-1-microamp: false
344*833e5d42SEmmanuel Vadot            adi,excitation-current-2-microamp: false
345*833e5d42SEmmanuel Vadot            adi,excitation-current-3-microamp: false
346*833e5d42SEmmanuel Vadot            adi,excitation-ac: false
347*833e5d42SEmmanuel Vadot      # Weigh scale bridge AC excited with one pair of predefined signals.
348*833e5d42SEmmanuel Vadot      - if:
349*833e5d42SEmmanuel Vadot          allOf:
350*833e5d42SEmmanuel Vadot            - properties:
351*833e5d42SEmmanuel Vadot                adi,sensor-type:
352*833e5d42SEmmanuel Vadot                  contains:
353*833e5d42SEmmanuel Vadot                    const: weighscale
354*833e5d42SEmmanuel Vadot            - required:
355*833e5d42SEmmanuel Vadot                - adi,excitation-ac
356*833e5d42SEmmanuel Vadot                - adi,excitation-pin-2
357*833e5d42SEmmanuel Vadot                - adi,excitation-pin-3
358*833e5d42SEmmanuel Vadot            - not:
359*833e5d42SEmmanuel Vadot                required:
360*833e5d42SEmmanuel Vadot                  - adi,excitation-current-2-microamp
361*833e5d42SEmmanuel Vadot                  - adi,excitation-current-3-microamp
362*833e5d42SEmmanuel Vadot        then:
363*833e5d42SEmmanuel Vadot          properties:
364*833e5d42SEmmanuel Vadot            adi,excitation-pin-2:
365*833e5d42SEmmanuel Vadot              const: 19
366*833e5d42SEmmanuel Vadot            adi,excitation-pin-3:
367*833e5d42SEmmanuel Vadot              const: 20
368*833e5d42SEmmanuel Vadot      # Weigh scale bridge AC excited with two pairs of predefined signals.
369*833e5d42SEmmanuel Vadot      - if:
370*833e5d42SEmmanuel Vadot          allOf:
371*833e5d42SEmmanuel Vadot            - properties:
372*833e5d42SEmmanuel Vadot                adi,sensor-type:
373*833e5d42SEmmanuel Vadot                  contains:
374*833e5d42SEmmanuel Vadot                    const: weighscale
375*833e5d42SEmmanuel Vadot            - required:
376*833e5d42SEmmanuel Vadot                - adi,excitation-ac
377*833e5d42SEmmanuel Vadot                - adi,excitation-pin-0
378*833e5d42SEmmanuel Vadot                - adi,excitation-pin-1
379*833e5d42SEmmanuel Vadot                - adi,excitation-pin-2
380*833e5d42SEmmanuel Vadot                - adi,excitation-pin-3
381*833e5d42SEmmanuel Vadot            - not:
382*833e5d42SEmmanuel Vadot                required:
383*833e5d42SEmmanuel Vadot                  - adi,excitation-current-0-microamp
384*833e5d42SEmmanuel Vadot                  - adi,excitation-current-1-microamp
385*833e5d42SEmmanuel Vadot                  - adi,excitation-current-2-microamp
386*833e5d42SEmmanuel Vadot                  - adi,excitation-current-3-microamp
387*833e5d42SEmmanuel Vadot        then:
388*833e5d42SEmmanuel Vadot          properties:
389*833e5d42SEmmanuel Vadot            adi,excitation-pin-0:
390*833e5d42SEmmanuel Vadot              const: 17
391*833e5d42SEmmanuel Vadot            adi,excitation-pin-1:
392*833e5d42SEmmanuel Vadot              const: 18
393*833e5d42SEmmanuel Vadot            adi,excitation-pin-2:
394*833e5d42SEmmanuel Vadot              const: 19
395*833e5d42SEmmanuel Vadot            adi,excitation-pin-3:
396*833e5d42SEmmanuel Vadot              const: 20
397*833e5d42SEmmanuel Vadot
398*833e5d42SEmmanuel Vadotexamples:
399*833e5d42SEmmanuel Vadot  - |
400*833e5d42SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
401*833e5d42SEmmanuel Vadot    spi {
402*833e5d42SEmmanuel Vadot        #address-cells = <1>;
403*833e5d42SEmmanuel Vadot        #size-cells = <0>;
404*833e5d42SEmmanuel Vadot
405*833e5d42SEmmanuel Vadot        adc@0 {
406*833e5d42SEmmanuel Vadot            compatible = "adi,ad4170-4";
407*833e5d42SEmmanuel Vadot            reg = <0>;
408*833e5d42SEmmanuel Vadot            spi-max-frequency = <20000000>;
409*833e5d42SEmmanuel Vadot            spi-cpol;
410*833e5d42SEmmanuel Vadot            spi-cpha;
411*833e5d42SEmmanuel Vadot            avdd-supply = <&avdd>;
412*833e5d42SEmmanuel Vadot            iovdd-supply = <&iovdd>;
413*833e5d42SEmmanuel Vadot            clocks = <&clk>;
414*833e5d42SEmmanuel Vadot            clock-names = "xtal";
415*833e5d42SEmmanuel Vadot            interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
416*833e5d42SEmmanuel Vadot            interrupt-names = "dig_aux1";
417*833e5d42SEmmanuel Vadot            adi,vbias-pins = <8>;
418*833e5d42SEmmanuel Vadot            #address-cells = <1>;
419*833e5d42SEmmanuel Vadot            #size-cells = <0>;
420*833e5d42SEmmanuel Vadot
421*833e5d42SEmmanuel Vadot            // Sample AIN0 with respect to DGND throughout AVDD/DGND input range
422*833e5d42SEmmanuel Vadot            // Pseudo-differential unipolar
423*833e5d42SEmmanuel Vadot            channel@0 {
424*833e5d42SEmmanuel Vadot                reg = <0>;
425*833e5d42SEmmanuel Vadot                single-channel = <0>;
426*833e5d42SEmmanuel Vadot                common-mode-channel = <24>;
427*833e5d42SEmmanuel Vadot                adi,reference-select = <3>;
428*833e5d42SEmmanuel Vadot            };
429*833e5d42SEmmanuel Vadot            // Weigh scale sensor
430*833e5d42SEmmanuel Vadot            channel@1 {
431*833e5d42SEmmanuel Vadot                reg = <1>;
432*833e5d42SEmmanuel Vadot                bipolar;
433*833e5d42SEmmanuel Vadot                diff-channels = <1 2>;
434*833e5d42SEmmanuel Vadot                adi,reference-select = <0>;
435*833e5d42SEmmanuel Vadot                adi,positive-reference-buffer = "precharge";
436*833e5d42SEmmanuel Vadot                adi,negative-reference-buffer = "precharge";
437*833e5d42SEmmanuel Vadot                adi,sensor-type = "weighscale";
438*833e5d42SEmmanuel Vadot                adi,excitation-pin-2 = <19>;
439*833e5d42SEmmanuel Vadot                adi,excitation-pin-3 = <20>;
440*833e5d42SEmmanuel Vadot                adi,excitation-ac;
441*833e5d42SEmmanuel Vadot            };
442*833e5d42SEmmanuel Vadot            // RTD sensor
443*833e5d42SEmmanuel Vadot            channel@2 {
444*833e5d42SEmmanuel Vadot                reg = <2>;
445*833e5d42SEmmanuel Vadot                bipolar;
446*833e5d42SEmmanuel Vadot                diff-channels = <3 4>;
447*833e5d42SEmmanuel Vadot                adi,reference-select = <0>;
448*833e5d42SEmmanuel Vadot                adi,sensor-type = "rtd";
449*833e5d42SEmmanuel Vadot                adi,excitation-pin-0 = <5>;
450*833e5d42SEmmanuel Vadot                adi,excitation-pin-1 = <6>;
451*833e5d42SEmmanuel Vadot                adi,excitation-current-0-microamp = <500>;
452*833e5d42SEmmanuel Vadot                adi,excitation-current-1-microamp = <500>;
453*833e5d42SEmmanuel Vadot                adi,excitation-ac;
454*833e5d42SEmmanuel Vadot            };
455*833e5d42SEmmanuel Vadot            // Thermocouple sensor
456*833e5d42SEmmanuel Vadot            channel@3 {
457*833e5d42SEmmanuel Vadot                reg = <3>;
458*833e5d42SEmmanuel Vadot                bipolar;
459*833e5d42SEmmanuel Vadot                diff-channels = <7 8>;
460*833e5d42SEmmanuel Vadot                adi,reference-select = <0>;
461*833e5d42SEmmanuel Vadot                adi,sensor-type = "thermocouple";
462*833e5d42SEmmanuel Vadot                adi,excitation-pin-0 = <18>;
463*833e5d42SEmmanuel Vadot                adi,excitation-current-0-microamp = <500>;
464*833e5d42SEmmanuel Vadot            };
465*833e5d42SEmmanuel Vadot        };
466*833e5d42SEmmanuel Vadot    };
467*833e5d42SEmmanuel Vadot  - |
468*833e5d42SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
469*833e5d42SEmmanuel Vadot    spi {
470*833e5d42SEmmanuel Vadot        #address-cells = <1>;
471*833e5d42SEmmanuel Vadot        #size-cells = <0>;
472*833e5d42SEmmanuel Vadot
473*833e5d42SEmmanuel Vadot        adc@0 {
474*833e5d42SEmmanuel Vadot            compatible = "adi,ad4170-4";
475*833e5d42SEmmanuel Vadot            reg = <0>;
476*833e5d42SEmmanuel Vadot            spi-max-frequency = <20000000>;
477*833e5d42SEmmanuel Vadot            spi-cpol;
478*833e5d42SEmmanuel Vadot            spi-cpha;
479*833e5d42SEmmanuel Vadot            avdd-supply = <&avdd>;
480*833e5d42SEmmanuel Vadot            iovdd-supply = <&iovdd>;
481*833e5d42SEmmanuel Vadot            #clock-cells = <0>;
482*833e5d42SEmmanuel Vadot            clock-output-names = "ad4170-clk16mhz";
483*833e5d42SEmmanuel Vadot            interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
484*833e5d42SEmmanuel Vadot            interrupt-names = "dig_aux1";
485*833e5d42SEmmanuel Vadot            #address-cells = <1>;
486*833e5d42SEmmanuel Vadot            #size-cells = <0>;
487*833e5d42SEmmanuel Vadot
488*833e5d42SEmmanuel Vadot            // Sample AIN0 with respect to AIN1 throughout AVDD/AVSS input range
489*833e5d42SEmmanuel Vadot            // Differential bipolar. If AVSS < 0V, differential true bipolar
490*833e5d42SEmmanuel Vadot            channel@0 {
491*833e5d42SEmmanuel Vadot                reg = <0>;
492*833e5d42SEmmanuel Vadot                bipolar;
493*833e5d42SEmmanuel Vadot                diff-channels = <0 1>;
494*833e5d42SEmmanuel Vadot                adi,reference-select = <3>;
495*833e5d42SEmmanuel Vadot            };
496*833e5d42SEmmanuel Vadot            // Sample AIN2 with respect to DGND throughout AVDD/DGND input range
497*833e5d42SEmmanuel Vadot            // Pseudo-differential unipolar
498*833e5d42SEmmanuel Vadot            channel@1 {
499*833e5d42SEmmanuel Vadot                reg = <1>;
500*833e5d42SEmmanuel Vadot                single-channel = <2>;
501*833e5d42SEmmanuel Vadot                common-mode-channel = <24>;
502*833e5d42SEmmanuel Vadot                adi,reference-select = <3>;
503*833e5d42SEmmanuel Vadot            };
504*833e5d42SEmmanuel Vadot            // Sample AIN3 with respect to 2.5V throughout AVDD/AVSS input range
505*833e5d42SEmmanuel Vadot            // Pseudo-differential bipolar
506*833e5d42SEmmanuel Vadot            channel@2 {
507*833e5d42SEmmanuel Vadot                reg = <2>;
508*833e5d42SEmmanuel Vadot                bipolar;
509*833e5d42SEmmanuel Vadot                single-channel = <3>;
510*833e5d42SEmmanuel Vadot                common-mode-channel = <29>;
511*833e5d42SEmmanuel Vadot                adi,reference-select = <3>;
512*833e5d42SEmmanuel Vadot            };
513*833e5d42SEmmanuel Vadot            // Sample AIN4 with respect to DGND throughout AVDD/AVSS input range
514*833e5d42SEmmanuel Vadot            // Pseudo-differential bipolar
515*833e5d42SEmmanuel Vadot            channel@3 {
516*833e5d42SEmmanuel Vadot                reg = <3>;
517*833e5d42SEmmanuel Vadot                bipolar;
518*833e5d42SEmmanuel Vadot                single-channel = <4>;
519*833e5d42SEmmanuel Vadot                common-mode-channel = <24>;
520*833e5d42SEmmanuel Vadot                adi,reference-select = <3>;
521*833e5d42SEmmanuel Vadot            };
522*833e5d42SEmmanuel Vadot            // Sample AIN5 with respect to 2.5V throughout AVDD/AVSS input range
523*833e5d42SEmmanuel Vadot            // Pseudo-differential unipolar (AD4170-4 datasheet page 46 example)
524*833e5d42SEmmanuel Vadot            channel@4 {
525*833e5d42SEmmanuel Vadot                reg = <4>;
526*833e5d42SEmmanuel Vadot                single-channel = <5>;
527*833e5d42SEmmanuel Vadot                common-mode-channel = <29>;
528*833e5d42SEmmanuel Vadot                adi,reference-select = <3>;
529*833e5d42SEmmanuel Vadot            };
530*833e5d42SEmmanuel Vadot            // Sample AIN6 with respect to 2.5V throughout REFIN+/REFIN- input range
531*833e5d42SEmmanuel Vadot            // Pseudo-differential bipolar
532*833e5d42SEmmanuel Vadot            channel@5 {
533*833e5d42SEmmanuel Vadot                reg = <5>;
534*833e5d42SEmmanuel Vadot                bipolar;
535*833e5d42SEmmanuel Vadot                single-channel = <6>;
536*833e5d42SEmmanuel Vadot                common-mode-channel = <29>;
537*833e5d42SEmmanuel Vadot                adi,reference-select = <0>;
538*833e5d42SEmmanuel Vadot            };
539*833e5d42SEmmanuel Vadot            // Weigh scale sensor
540*833e5d42SEmmanuel Vadot            channel@6 {
541*833e5d42SEmmanuel Vadot                reg = <6>;
542*833e5d42SEmmanuel Vadot                bipolar;
543*833e5d42SEmmanuel Vadot                diff-channels = <7 8>;
544*833e5d42SEmmanuel Vadot                adi,reference-select = <0>;
545*833e5d42SEmmanuel Vadot                adi,sensor-type = "weighscale";
546*833e5d42SEmmanuel Vadot                adi,excitation-pin-0 = <17>;
547*833e5d42SEmmanuel Vadot                adi,excitation-pin-1 = <18>;
548*833e5d42SEmmanuel Vadot                adi,excitation-pin-2 = <19>;
549*833e5d42SEmmanuel Vadot                adi,excitation-pin-3 = <20>;
550*833e5d42SEmmanuel Vadot                adi,excitation-ac;
551*833e5d42SEmmanuel Vadot            };
552*833e5d42SEmmanuel Vadot        };
553*833e5d42SEmmanuel Vadot    };
554*833e5d42SEmmanuel Vadot...
555