xref: /freebsd/sys/contrib/device-tree/Bindings/iio/adc/adi,ad7191.yaml (revision 8ccc0d235c226d84112561d453c49904398d085c)
1*8ccc0d23SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2*8ccc0d23SEmmanuel Vadot# Copyright 2025 Analog Devices Inc.
3*8ccc0d23SEmmanuel Vadot%YAML 1.2
4*8ccc0d23SEmmanuel Vadot---
5*8ccc0d23SEmmanuel Vadot$id: http://devicetree.org/schemas/iio/adc/adi,ad7191.yaml#
6*8ccc0d23SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
7*8ccc0d23SEmmanuel Vadot
8*8ccc0d23SEmmanuel Vadottitle: Analog Devices AD7191 ADC
9*8ccc0d23SEmmanuel Vadot
10*8ccc0d23SEmmanuel Vadotmaintainers:
11*8ccc0d23SEmmanuel Vadot  - Alisa-Dariana Roman <alisa.roman@analog.com>
12*8ccc0d23SEmmanuel Vadot
13*8ccc0d23SEmmanuel Vadotdescription: |
14*8ccc0d23SEmmanuel Vadot  Bindings for the Analog Devices AD7191 ADC device. Datasheet can be
15*8ccc0d23SEmmanuel Vadot  found here:
16*8ccc0d23SEmmanuel Vadot  https://www.analog.com/media/en/technical-documentation/data-sheets/AD7191.pdf
17*8ccc0d23SEmmanuel Vadot  The device's PDOWN pin must be connected to the SPI controller's chip select
18*8ccc0d23SEmmanuel Vadot  pin.
19*8ccc0d23SEmmanuel Vadot
20*8ccc0d23SEmmanuel Vadotproperties:
21*8ccc0d23SEmmanuel Vadot  compatible:
22*8ccc0d23SEmmanuel Vadot    enum:
23*8ccc0d23SEmmanuel Vadot      - adi,ad7191
24*8ccc0d23SEmmanuel Vadot
25*8ccc0d23SEmmanuel Vadot  reg:
26*8ccc0d23SEmmanuel Vadot    maxItems: 1
27*8ccc0d23SEmmanuel Vadot
28*8ccc0d23SEmmanuel Vadot  spi-cpol: true
29*8ccc0d23SEmmanuel Vadot
30*8ccc0d23SEmmanuel Vadot  spi-cpha: true
31*8ccc0d23SEmmanuel Vadot
32*8ccc0d23SEmmanuel Vadot  clocks:
33*8ccc0d23SEmmanuel Vadot    maxItems: 1
34*8ccc0d23SEmmanuel Vadot    description:
35*8ccc0d23SEmmanuel Vadot      Must be present when CLKSEL pin is tied HIGH to select external clock
36*8ccc0d23SEmmanuel Vadot      source (either a crystal between MCLK1 and MCLK2 pins, or a
37*8ccc0d23SEmmanuel Vadot      CMOS-compatible clock driving MCLK2 pin). Must be absent when CLKSEL pin
38*8ccc0d23SEmmanuel Vadot      is tied LOW to use the internal 4.92MHz clock.
39*8ccc0d23SEmmanuel Vadot
40*8ccc0d23SEmmanuel Vadot  interrupts:
41*8ccc0d23SEmmanuel Vadot    maxItems: 1
42*8ccc0d23SEmmanuel Vadot
43*8ccc0d23SEmmanuel Vadot  avdd-supply:
44*8ccc0d23SEmmanuel Vadot    description: AVdd voltage supply
45*8ccc0d23SEmmanuel Vadot
46*8ccc0d23SEmmanuel Vadot  dvdd-supply:
47*8ccc0d23SEmmanuel Vadot    description: DVdd voltage supply
48*8ccc0d23SEmmanuel Vadot
49*8ccc0d23SEmmanuel Vadot  vref-supply:
50*8ccc0d23SEmmanuel Vadot    description: Vref voltage supply
51*8ccc0d23SEmmanuel Vadot
52*8ccc0d23SEmmanuel Vadot  odr-gpios:
53*8ccc0d23SEmmanuel Vadot    description:
54*8ccc0d23SEmmanuel Vadot      ODR1 and ODR2 pins for output data rate selection. Should be defined if
55*8ccc0d23SEmmanuel Vadot      adi,odr-value is absent.
56*8ccc0d23SEmmanuel Vadot    minItems: 2
57*8ccc0d23SEmmanuel Vadot    maxItems: 2
58*8ccc0d23SEmmanuel Vadot
59*8ccc0d23SEmmanuel Vadot  adi,odr-value:
60*8ccc0d23SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
61*8ccc0d23SEmmanuel Vadot    description: |
62*8ccc0d23SEmmanuel Vadot      Should be present if ODR pins are pin-strapped. Possible values:
63*8ccc0d23SEmmanuel Vadot      120 Hz (ODR1=0, ODR2=0)
64*8ccc0d23SEmmanuel Vadot      60 Hz (ODR1=0, ODR2=1)
65*8ccc0d23SEmmanuel Vadot      50 Hz (ODR1=1, ODR2=0)
66*8ccc0d23SEmmanuel Vadot      10 Hz (ODR1=1, ODR2=1)
67*8ccc0d23SEmmanuel Vadot      If defined, odr-gpios must be absent.
68*8ccc0d23SEmmanuel Vadot    enum: [120, 60, 50, 10]
69*8ccc0d23SEmmanuel Vadot
70*8ccc0d23SEmmanuel Vadot  pga-gpios:
71*8ccc0d23SEmmanuel Vadot    description:
72*8ccc0d23SEmmanuel Vadot      PGA1 and PGA2 pins for gain selection. Should be defined if adi,pga-value
73*8ccc0d23SEmmanuel Vadot      is absent.
74*8ccc0d23SEmmanuel Vadot    minItems: 2
75*8ccc0d23SEmmanuel Vadot    maxItems: 2
76*8ccc0d23SEmmanuel Vadot
77*8ccc0d23SEmmanuel Vadot  adi,pga-value:
78*8ccc0d23SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
79*8ccc0d23SEmmanuel Vadot    description: |
80*8ccc0d23SEmmanuel Vadot      Should be present if PGA pins are pin-strapped. Possible values:
81*8ccc0d23SEmmanuel Vadot      Gain 1 (PGA1=0, PGA2=0)
82*8ccc0d23SEmmanuel Vadot      Gain 8 (PGA1=0, PGA2=1)
83*8ccc0d23SEmmanuel Vadot      Gain 64 (PGA1=1, PGA2=0)
84*8ccc0d23SEmmanuel Vadot      Gain 128 (PGA1=1, PGA2=1)
85*8ccc0d23SEmmanuel Vadot      If defined, pga-gpios must be absent.
86*8ccc0d23SEmmanuel Vadot    enum: [1, 8, 64, 128]
87*8ccc0d23SEmmanuel Vadot
88*8ccc0d23SEmmanuel Vadot  temp-gpios:
89*8ccc0d23SEmmanuel Vadot    description: TEMP pin for temperature sensor enable.
90*8ccc0d23SEmmanuel Vadot    maxItems: 1
91*8ccc0d23SEmmanuel Vadot
92*8ccc0d23SEmmanuel Vadot  chan-gpios:
93*8ccc0d23SEmmanuel Vadot    description: CHAN pin for input channel selection.
94*8ccc0d23SEmmanuel Vadot    maxItems: 1
95*8ccc0d23SEmmanuel Vadot
96*8ccc0d23SEmmanuel Vadotrequired:
97*8ccc0d23SEmmanuel Vadot  - compatible
98*8ccc0d23SEmmanuel Vadot  - reg
99*8ccc0d23SEmmanuel Vadot  - interrupts
100*8ccc0d23SEmmanuel Vadot  - avdd-supply
101*8ccc0d23SEmmanuel Vadot  - dvdd-supply
102*8ccc0d23SEmmanuel Vadot  - vref-supply
103*8ccc0d23SEmmanuel Vadot  - spi-cpol
104*8ccc0d23SEmmanuel Vadot  - spi-cpha
105*8ccc0d23SEmmanuel Vadot  - temp-gpios
106*8ccc0d23SEmmanuel Vadot  - chan-gpios
107*8ccc0d23SEmmanuel Vadot
108*8ccc0d23SEmmanuel VadotallOf:
109*8ccc0d23SEmmanuel Vadot  - $ref: /schemas/spi/spi-peripheral-props.yaml#
110*8ccc0d23SEmmanuel Vadot  - oneOf:
111*8ccc0d23SEmmanuel Vadot      - required:
112*8ccc0d23SEmmanuel Vadot          - adi,odr-value
113*8ccc0d23SEmmanuel Vadot      - required:
114*8ccc0d23SEmmanuel Vadot          - odr-gpios
115*8ccc0d23SEmmanuel Vadot  - oneOf:
116*8ccc0d23SEmmanuel Vadot      - required:
117*8ccc0d23SEmmanuel Vadot          - adi,pga-value
118*8ccc0d23SEmmanuel Vadot      - required:
119*8ccc0d23SEmmanuel Vadot          - pga-gpios
120*8ccc0d23SEmmanuel Vadot
121*8ccc0d23SEmmanuel VadotunevaluatedProperties: false
122*8ccc0d23SEmmanuel Vadot
123*8ccc0d23SEmmanuel Vadotexamples:
124*8ccc0d23SEmmanuel Vadot  - |
125*8ccc0d23SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
126*8ccc0d23SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
127*8ccc0d23SEmmanuel Vadot
128*8ccc0d23SEmmanuel Vadot    spi {
129*8ccc0d23SEmmanuel Vadot        #address-cells = <1>;
130*8ccc0d23SEmmanuel Vadot        #size-cells = <0>;
131*8ccc0d23SEmmanuel Vadot
132*8ccc0d23SEmmanuel Vadot        adc@0 {
133*8ccc0d23SEmmanuel Vadot            compatible = "adi,ad7191";
134*8ccc0d23SEmmanuel Vadot            reg = <0>;
135*8ccc0d23SEmmanuel Vadot            spi-max-frequency = <1000000>;
136*8ccc0d23SEmmanuel Vadot            spi-cpol;
137*8ccc0d23SEmmanuel Vadot            spi-cpha;
138*8ccc0d23SEmmanuel Vadot            clocks = <&ad7191_mclk>;
139*8ccc0d23SEmmanuel Vadot            interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
140*8ccc0d23SEmmanuel Vadot            interrupt-parent = <&gpio>;
141*8ccc0d23SEmmanuel Vadot            avdd-supply = <&avdd>;
142*8ccc0d23SEmmanuel Vadot            dvdd-supply = <&dvdd>;
143*8ccc0d23SEmmanuel Vadot            vref-supply = <&vref>;
144*8ccc0d23SEmmanuel Vadot            adi,pga-value = <1>;
145*8ccc0d23SEmmanuel Vadot            odr-gpios = <&gpio 23 GPIO_ACTIVE_HIGH>, <&gpio 24 GPIO_ACTIVE_HIGH>;
146*8ccc0d23SEmmanuel Vadot            temp-gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
147*8ccc0d23SEmmanuel Vadot            chan-gpios = <&gpio 27 GPIO_ACTIVE_HIGH>;
148*8ccc0d23SEmmanuel Vadot        };
149*8ccc0d23SEmmanuel Vadot    };
150