xref: /freebsd/sys/contrib/device-tree/Bindings/iio/dac/adi,ad5592r.yaml (revision 5def4c47d4bd90b209b9b4a4ba9faec15846d8fd)
1*5def4c47SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2*5def4c47SEmmanuel Vadot%YAML 1.2
3*5def4c47SEmmanuel Vadot---
4*5def4c47SEmmanuel Vadot$id: http://devicetree.org/schemas/iio/dac/adi,ad5592r.yaml#
5*5def4c47SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*5def4c47SEmmanuel Vadot
7*5def4c47SEmmanuel Vadottitle: Analog Devices AD5592R/AD5593R DAC/ADC
8*5def4c47SEmmanuel Vadot
9*5def4c47SEmmanuel Vadotmaintainers:
10*5def4c47SEmmanuel Vadot  - Michael Hennerich <michael.hennerich@analog.com>
11*5def4c47SEmmanuel Vadot
12*5def4c47SEmmanuel Vadotproperties:
13*5def4c47SEmmanuel Vadot  compatible:
14*5def4c47SEmmanuel Vadot    enum:
15*5def4c47SEmmanuel Vadot      - adi,ad5592r
16*5def4c47SEmmanuel Vadot      - adi,ad5593r
17*5def4c47SEmmanuel Vadot
18*5def4c47SEmmanuel Vadot  reg:
19*5def4c47SEmmanuel Vadot    maxItems: 1
20*5def4c47SEmmanuel Vadot
21*5def4c47SEmmanuel Vadot  spi-max-frequency:
22*5def4c47SEmmanuel Vadot    maximum: 30000000
23*5def4c47SEmmanuel Vadot
24*5def4c47SEmmanuel Vadot  spi-cpol: true
25*5def4c47SEmmanuel Vadot
26*5def4c47SEmmanuel Vadot  "#address-cells":
27*5def4c47SEmmanuel Vadot    const: 1
28*5def4c47SEmmanuel Vadot
29*5def4c47SEmmanuel Vadot  "#size-cells":
30*5def4c47SEmmanuel Vadot    const: 0
31*5def4c47SEmmanuel Vadot
32*5def4c47SEmmanuel Vadot  "#io-channel-cells":
33*5def4c47SEmmanuel Vadot    const: 1
34*5def4c47SEmmanuel Vadot
35*5def4c47SEmmanuel Vadot  vref-supply:
36*5def4c47SEmmanuel Vadot    description: If not set internal 2.5V reference used.
37*5def4c47SEmmanuel Vadot
38*5def4c47SEmmanuel Vadot  reset-gpios:
39*5def4c47SEmmanuel Vadot    maxItems: 1
40*5def4c47SEmmanuel Vadot
41*5def4c47SEmmanuel Vadot  gpio-controller:
42*5def4c47SEmmanuel Vadot    description: Marks the device node as a GPIO controller.
43*5def4c47SEmmanuel Vadot
44*5def4c47SEmmanuel Vadot  "#gpio-cells":
45*5def4c47SEmmanuel Vadot    const: 2
46*5def4c47SEmmanuel Vadot    description:
47*5def4c47SEmmanuel Vadot      The first cell is the GPIO number and the second cell specifies
48*5def4c47SEmmanuel Vadot      GPIO flags, as defined in <dt-bindings/gpio/gpio.h>.
49*5def4c47SEmmanuel Vadot
50*5def4c47SEmmanuel Vadotrequired:
51*5def4c47SEmmanuel Vadot  - compatible
52*5def4c47SEmmanuel Vadot  - reg
53*5def4c47SEmmanuel Vadot  - "#address-cells"
54*5def4c47SEmmanuel Vadot  - "#size-cells"
55*5def4c47SEmmanuel Vadot
56*5def4c47SEmmanuel VadotallOf:
57*5def4c47SEmmanuel Vadot  - if:
58*5def4c47SEmmanuel Vadot      properties:
59*5def4c47SEmmanuel Vadot        compatible:
60*5def4c47SEmmanuel Vadot          contains:
61*5def4c47SEmmanuel Vadot            const: adi,ad5592r
62*5def4c47SEmmanuel Vadot    then:
63*5def4c47SEmmanuel Vadot      required:
64*5def4c47SEmmanuel Vadot        - spi-cpol
65*5def4c47SEmmanuel Vadot    else:
66*5def4c47SEmmanuel Vadot      properties:
67*5def4c47SEmmanuel Vadot        spi-cpol: false
68*5def4c47SEmmanuel Vadot
69*5def4c47SEmmanuel VadotadditionalProperties: false
70*5def4c47SEmmanuel Vadot
71*5def4c47SEmmanuel VadotpatternProperties:
72*5def4c47SEmmanuel Vadot  "^(channel@)[0-7]$":
73*5def4c47SEmmanuel Vadot    type: object
74*5def4c47SEmmanuel Vadot    description: Child node to describe a channel
75*5def4c47SEmmanuel Vadot    properties:
76*5def4c47SEmmanuel Vadot      reg:
77*5def4c47SEmmanuel Vadot        minimum: 0
78*5def4c47SEmmanuel Vadot        maximum: 7
79*5def4c47SEmmanuel Vadot
80*5def4c47SEmmanuel Vadot      adi,mode:
81*5def4c47SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
82*5def4c47SEmmanuel Vadot        enum: [0, 1, 2, 3, 8]
83*5def4c47SEmmanuel Vadot        description: |
84*5def4c47SEmmanuel Vadot          Mode or function of this channel.
85*5def4c47SEmmanuel Vadot          Macros specifying the valid values can be found in
86*5def4c47SEmmanuel Vadot          <dt-bindings/iio/adi,ad5592r.h>.
87*5def4c47SEmmanuel Vadot
88*5def4c47SEmmanuel Vadot          The following values are currently supported:
89*5def4c47SEmmanuel Vadot          * CH_MODE_UNUSED (the pin is unused)
90*5def4c47SEmmanuel Vadot          * CH_MODE_ADC (the pin is ADC input)
91*5def4c47SEmmanuel Vadot          * CH_MODE_DAC (the pin is DAC output)
92*5def4c47SEmmanuel Vadot          * CH_MODE_DAC_AND_ADC (the pin is DAC output but can be monitored
93*5def4c47SEmmanuel Vadot            by an ADC, since there is no disadvantage this should be
94*5def4c47SEmmanuel Vadot            considered as the preferred DAC mode)
95*5def4c47SEmmanuel Vadot          * CH_MODE_GPIO (the pin is registered with GPIOLIB)
96*5def4c47SEmmanuel Vadot
97*5def4c47SEmmanuel Vadot      adi,off-state:
98*5def4c47SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
99*5def4c47SEmmanuel Vadot        enum: [0, 1, 2, 3]
100*5def4c47SEmmanuel Vadot        description: |
101*5def4c47SEmmanuel Vadot          State of this channel when unused or the device gets removed.
102*5def4c47SEmmanuel Vadot          Macros specifying the  valid values can be found in
103*5def4c47SEmmanuel Vadot          <dt-bindings/iio/adi,ad5592r.h>.
104*5def4c47SEmmanuel Vadot          * CH_OFFSTATE_PULLDOWN (the pin is pulled down)
105*5def4c47SEmmanuel Vadot          * CH_OFFSTATE_OUT_LOW  (the pin is output low)
106*5def4c47SEmmanuel Vadot          * CH_OFFSTATE_OUT_HIGH (the pin is output high)
107*5def4c47SEmmanuel Vadot          * CH_OFFSTATE_OUT_TRISTATE (the pin is tristated output)
108*5def4c47SEmmanuel Vadot
109*5def4c47SEmmanuel Vadot    required:
110*5def4c47SEmmanuel Vadot      - reg
111*5def4c47SEmmanuel Vadot      - adi,mode
112*5def4c47SEmmanuel Vadot
113*5def4c47SEmmanuel Vadot    additionalProperties: false
114*5def4c47SEmmanuel Vadot
115*5def4c47SEmmanuel Vadotexamples:
116*5def4c47SEmmanuel Vadot  - |
117*5def4c47SEmmanuel Vadot    #include <dt-bindings/iio/adi,ad5592r.h>
118*5def4c47SEmmanuel Vadot    spi {
119*5def4c47SEmmanuel Vadot        #address-cells = <1>;
120*5def4c47SEmmanuel Vadot        #size-cells = <0>;
121*5def4c47SEmmanuel Vadot
122*5def4c47SEmmanuel Vadot        addac@0 {
123*5def4c47SEmmanuel Vadot            compatible = "adi,ad5592r";
124*5def4c47SEmmanuel Vadot            #size-cells = <0>;
125*5def4c47SEmmanuel Vadot            #address-cells = <1>;
126*5def4c47SEmmanuel Vadot            #gpio-cells = <2>;
127*5def4c47SEmmanuel Vadot            reg = <0>;
128*5def4c47SEmmanuel Vadot
129*5def4c47SEmmanuel Vadot            spi-max-frequency = <1000000>;
130*5def4c47SEmmanuel Vadot            spi-cpol;
131*5def4c47SEmmanuel Vadot
132*5def4c47SEmmanuel Vadot            vref-supply = <&vref>;
133*5def4c47SEmmanuel Vadot            reset-gpios = <&gpio0 86 0>;
134*5def4c47SEmmanuel Vadot            gpio-controller;
135*5def4c47SEmmanuel Vadot
136*5def4c47SEmmanuel Vadot            channel@0 {
137*5def4c47SEmmanuel Vadot                reg = <0>;
138*5def4c47SEmmanuel Vadot                adi,mode = <CH_MODE_DAC>;
139*5def4c47SEmmanuel Vadot            };
140*5def4c47SEmmanuel Vadot            channel@1 {
141*5def4c47SEmmanuel Vadot                reg = <1>;
142*5def4c47SEmmanuel Vadot                adi,mode = <CH_MODE_ADC>;
143*5def4c47SEmmanuel Vadot            };
144*5def4c47SEmmanuel Vadot            channel@2 {
145*5def4c47SEmmanuel Vadot                reg = <2>;
146*5def4c47SEmmanuel Vadot                adi,mode = <CH_MODE_DAC_AND_ADC>;
147*5def4c47SEmmanuel Vadot            };
148*5def4c47SEmmanuel Vadot            channel@3 {
149*5def4c47SEmmanuel Vadot                reg = <3>;
150*5def4c47SEmmanuel Vadot                adi,mode = <CH_MODE_DAC_AND_ADC>;
151*5def4c47SEmmanuel Vadot                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
152*5def4c47SEmmanuel Vadot            };
153*5def4c47SEmmanuel Vadot            channel@4 {
154*5def4c47SEmmanuel Vadot                reg = <4>;
155*5def4c47SEmmanuel Vadot                adi,mode = <CH_MODE_UNUSED>;
156*5def4c47SEmmanuel Vadot                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
157*5def4c47SEmmanuel Vadot            };
158*5def4c47SEmmanuel Vadot            channel@5 {
159*5def4c47SEmmanuel Vadot                reg = <5>;
160*5def4c47SEmmanuel Vadot                adi,mode = <CH_MODE_GPIO>;
161*5def4c47SEmmanuel Vadot                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
162*5def4c47SEmmanuel Vadot            };
163*5def4c47SEmmanuel Vadot            channel@6 {
164*5def4c47SEmmanuel Vadot                reg = <6>;
165*5def4c47SEmmanuel Vadot                adi,mode = <CH_MODE_GPIO>;
166*5def4c47SEmmanuel Vadot                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
167*5def4c47SEmmanuel Vadot            };
168*5def4c47SEmmanuel Vadot            channel@7 {
169*5def4c47SEmmanuel Vadot                reg = <7>;
170*5def4c47SEmmanuel Vadot                adi,mode = <CH_MODE_GPIO>;
171*5def4c47SEmmanuel Vadot                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
172*5def4c47SEmmanuel Vadot            };
173*5def4c47SEmmanuel Vadot        };
174*5def4c47SEmmanuel Vadot        ad5593r@10 {
175*5def4c47SEmmanuel Vadot            compatible = "adi,ad5593r";
176*5def4c47SEmmanuel Vadot            #size-cells = <0>;
177*5def4c47SEmmanuel Vadot            #address-cells = <1>;
178*5def4c47SEmmanuel Vadot            #gpio-cells = <2>;
179*5def4c47SEmmanuel Vadot            reg = <0x10>;
180*5def4c47SEmmanuel Vadot            gpio-controller;
181*5def4c47SEmmanuel Vadot
182*5def4c47SEmmanuel Vadot            channel@0 {
183*5def4c47SEmmanuel Vadot                reg = <0>;
184*5def4c47SEmmanuel Vadot                adi,mode = <CH_MODE_DAC>;
185*5def4c47SEmmanuel Vadot                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
186*5def4c47SEmmanuel Vadot            };
187*5def4c47SEmmanuel Vadot            channel@1 {
188*5def4c47SEmmanuel Vadot                reg = <1>;
189*5def4c47SEmmanuel Vadot                adi,mode = <CH_MODE_ADC>;
190*5def4c47SEmmanuel Vadot                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
191*5def4c47SEmmanuel Vadot            };
192*5def4c47SEmmanuel Vadot            channel@2 {
193*5def4c47SEmmanuel Vadot                reg = <2>;
194*5def4c47SEmmanuel Vadot                adi,mode = <CH_MODE_DAC_AND_ADC>;
195*5def4c47SEmmanuel Vadot                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
196*5def4c47SEmmanuel Vadot            };
197*5def4c47SEmmanuel Vadot            channel@6 {
198*5def4c47SEmmanuel Vadot                reg = <6>;
199*5def4c47SEmmanuel Vadot                adi,mode = <CH_MODE_GPIO>;
200*5def4c47SEmmanuel Vadot                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
201*5def4c47SEmmanuel Vadot            };
202*5def4c47SEmmanuel Vadot        };
203*5def4c47SEmmanuel Vadot    };
204*5def4c47SEmmanuel Vadot...
205