xref: /freebsd/sys/contrib/device-tree/Bindings/iio/dac/ad5592r.txt (revision fe6060f10f634930ff71b7c50291ddc610da2475)
1Analog Devices AD5592R/AD5593R DAC/ADC device driver
2
3Required properties for the AD5592R:
4	- compatible: Must be "adi,ad5592r"
5	- reg: SPI chip select number for the device
6	- spi-max-frequency: Max SPI frequency to use (< 30000000)
7	- spi-cpol: The AD5592R requires inverse clock polarity (CPOL) mode
8
9Required properties for the AD5593R:
10	- compatible: Must be "adi,ad5593r"
11	- reg: I2C address of the device
12
13Required properties for all supported chips:
14	- #address-cells: Should be 1.
15	- #size-cells: Should be 0.
16	- channel nodes:
17	  Each child node represents one channel and has the following
18	  Required properties:
19		* reg: Pin on which this channel is connected to.
20		* adi,mode: Mode or function of this channel.
21			    Macros specifying the valid values
22			    can be found in <dt-bindings/iio/adi,ad5592r.h>.
23
24			    The following values are currently supported:
25				* CH_MODE_UNUSED (the pin is unused)
26				* CH_MODE_ADC (the pin is ADC input)
27				* CH_MODE_DAC (the pin is DAC output)
28				* CH_MODE_DAC_AND_ADC (the pin is DAC output
29					but can be monitored by an ADC, since
30					there is no disadvantage this
31					this should be considered as the
32					preferred DAC mode)
33				* CH_MODE_GPIO (the pin is registered
34					with GPIOLIB)
35	 Optional properties:
36		* adi,off-state: State of this channel when unused or the
37				 device gets removed. Macros specifying the
38				 valid values can be found in
39				 <dt-bindings/iio/adi,ad5592r.h>.
40
41				* CH_OFFSTATE_PULLDOWN (the pin is pulled down)
42				* CH_OFFSTATE_OUT_LOW  (the pin is output low)
43				* CH_OFFSTATE_OUT_HIGH (the pin is output high)
44				* CH_OFFSTATE_OUT_TRISTATE (the pin is
45					tristated output)
46
47
48Optional properties:
49	- vref-supply: Phandle to the external reference voltage supply. This should
50	  only be set if there is an external reference voltage connected to the VREF
51	  pin. If the property is not set the internal 2.5V reference is used.
52	- reset-gpios : GPIO spec for the RESET pin. If specified, it will be
53	  asserted during driver probe.
54	- gpio-controller: Marks the device node as a GPIO controller.
55	- #gpio-cells: Should be 2. The first cell is the GPIO number and the second
56	  cell specifies GPIO flags, as defined in <dt-bindings/gpio/gpio.h>.
57
58AD5592R Example:
59
60	#include <dt-bindings/iio/adi,ad5592r.h>
61
62	vref: regulator-vref {
63		compatible = "regulator-fixed";
64		regulator-name = "vref-ad559x";
65		regulator-min-microvolt = <3300000>;
66		regulator-max-microvolt = <3300000>;
67		regulator-always-on;
68	};
69
70	ad5592r@0 {
71		#size-cells = <0>;
72		#address-cells = <1>;
73		#gpio-cells = <2>;
74		compatible = "adi,ad5592r";
75		reg = <0>;
76
77		spi-max-frequency = <1000000>;
78		spi-cpol;
79
80		vref-supply = <&vref>; /* optional */
81		reset-gpios = <&gpio0 86 0>;  /* optional */
82		gpio-controller;
83
84		channel@0 {
85			reg = <0>;
86			adi,mode = <CH_MODE_DAC>;
87		};
88		channel@1 {
89			reg = <1>;
90			adi,mode = <CH_MODE_ADC>;
91		};
92		channel@2 {
93			reg = <2>;
94			adi,mode = <CH_MODE_DAC_AND_ADC>;
95		};
96		channel@3 {
97			reg = <3>;
98			adi,mode = <CH_MODE_DAC_AND_ADC>;
99			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
100		};
101		channel@4 {
102			reg = <4>;
103			adi,mode = <CH_MODE_UNUSED>;
104			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
105		};
106		channel@5 {
107			reg = <5>;
108			adi,mode = <CH_MODE_GPIO>;
109			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
110		};
111		channel@6 {
112			reg = <6>;
113			adi,mode = <CH_MODE_GPIO>;
114			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
115		};
116		channel@7 {
117			reg = <7>;
118			adi,mode = <CH_MODE_GPIO>;
119			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
120		};
121	};
122
123AD5593R Example:
124
125	#include <dt-bindings/iio/adi,ad5592r.h>
126
127	ad5593r@10 {
128		#size-cells = <0>;
129		#address-cells = <1>;
130		#gpio-cells = <2>;
131		compatible = "adi,ad5593r";
132		reg = <0x10>;
133		gpio-controller;
134
135		channel@0 {
136			reg = <0>;
137			adi,mode = <CH_MODE_DAC>;
138			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
139		};
140		channel@1 {
141			reg = <1>;
142			adi,mode = <CH_MODE_ADC>;
143			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
144		};
145		channel@2 {
146			reg = <2>;
147			adi,mode = <CH_MODE_DAC_AND_ADC>;
148			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
149		};
150		channel@6 {
151			reg = <6>;
152			adi,mode = <CH_MODE_GPIO>;
153			adi,off-state = <CH_OFFSTATE_PULLDOWN>;
154		};
155	};
156