GNU Linux-libre 6.8.9-gnu
[releases.git] / Documentation / devicetree / bindings / iio / dac / adi,ad5755.yaml
1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/iio/dac/adi,ad5755.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Analog Devices AD5755 Multi-Channel DAC
8
9 maintainers:
10   - Sean Nyekjaer <sean.nyekjaer@prevas.dk>
11
12 properties:
13   compatible:
14     enum:
15       - adi,ad5755
16       - adi,ad5755-1
17       - adi,ad5757
18       - adi,ad5735
19       - adi,ad5737
20
21   reg:
22     maxItems: 1
23
24   spi-cpha:
25     description: Either this or spi-cpol but not both.
26   spi-cpol: true
27
28   adi,ext-dc-dc-compenstation-resistor:
29     $ref: /schemas/types.yaml#/definitions/flag
30     description:
31       Set if the hardware have an external resistor and thereby bypasses
32       the internal compensation resistor.
33
34   adi,dc-dc-phase:
35     $ref: /schemas/types.yaml#/definitions/uint32
36     enum: [0, 1, 2, 3]
37     description: |
38       Valid values for DC DC Phase control is:
39       0: All dc-to-dc converters clock on the same edge.
40       1: Channel A and Channel B clock on the same edge,
41          Channel C and Channel D clock on opposite edges.
42       2: Channel A and Channel C clock on the same edge,
43          Channel B and Channel D clock on opposite edges.
44       3: Channel A, Channel B, Channel C, and Channel D
45          clock 90 degrees out of phase from each other.
46
47   adi,dc-dc-freq-hz:
48     enum: [250000, 410000, 650000]
49
50   adi,dc-dc-max-microvolt:
51     description:
52       Maximum allowed Vboost voltage supplied by the dc-to-dc converter.
53     enum: [23000000, 24500000, 27000000, 29500000]
54
55   "#address-cells":
56     const: 1
57
58   "#size-cells":
59     const: 0
60
61   "#io-channel-cells":
62     const: 1
63
64 required:
65   - compatible
66   - reg
67
68 patternProperties:
69   "^channel@[0-7]$":
70     type: object
71     description: Child node to describe a channel
72     properties:
73       reg:
74         maxItems: 1
75
76       adi,mode:
77         $ref: /schemas/types.yaml#/definitions/uint32
78         minimum: 0
79         maximum: 6
80         description: |
81           Valid values for DAC modes is:
82           0: 0 V to 5 V voltage range.
83           1: 0 V to 10 V voltage range.
84           2: Plus minus 5 V voltage range.
85           3: Plus minus 10 V voltage range.
86           4: 4 mA to 20 mA current range.
87           5: 0 mA to 20 mA current range.
88           6: 0 mA to 24 mA current range.
89
90       adi,ext-current-sense-resistor:
91         $ref: /schemas/types.yaml#/definitions/flag
92         description:
93           Set if the hardware has an external current sense resistor
94
95       adi,enable-voltage-overrange:
96         $ref: /schemas/types.yaml#/definitions/flag
97         description: Enable voltage overrange
98
99       adi,slew:
100         $ref: /schemas/types.yaml#/definitions/uint32-array
101         description: |
102           Array of slewrate settings should contain 3 fields:
103           1: Should be either 0 or 1 in order to enable or disable slewrate.
104           2: Slew rate update frequency
105           3: Slew step size
106         items:
107           - enum: [0, 1]
108           - enum: [64000, 32000, 16000, 8000, 4000, 2000, 1000, 500, 250, 125, 64, 32, 16, 8, 4, 0]
109           - enum: [1, 2, 4, 16, 32, 64, 128, 256]
110
111     required:
112       - reg
113
114     additionalProperties: false
115
116 oneOf:
117   - required:
118       - spi-cpha
119   - required:
120       - spi-cpol
121
122 allOf:
123   - $ref: /schemas/spi/spi-peripheral-props.yaml#
124
125 unevaluatedProperties: false
126
127 examples:
128   - |
129     spi {
130         #address-cells = <1>;
131         #size-cells = <0>;
132
133         dac@0 {
134             #address-cells = <1>;
135             #size-cells = <0>;
136             compatible = "adi,ad5755";
137             reg = <0>;
138             spi-max-frequency = <1000000>;
139             spi-cpha;
140             adi,dc-dc-phase = <0>;
141             adi,dc-dc-freq-hz = <410000>;
142             adi,dc-dc-max-microvolt = <23000000>;
143             channel@0 {
144                 reg = <0>;
145                 adi,mode = <4>;
146                 adi,ext-current-sense-resistor;
147                 adi,slew = <0 64000 1>;
148             };
149             channel@1 {
150                 reg = <1>;
151                 adi,mode = <4>;
152                 adi,ext-current-sense-resistor;
153                 adi,slew = <0 64000 1>;
154             };
155             channel@2 {
156                 reg = <2>;
157                 adi,mode = <4>;
158                 adi,ext-current-sense-resistor;
159                 adi,slew = <0 64000 1>;
160             };
161             channel@3 {
162                 reg = <3>;
163                 adi,mode = <4>;
164                 adi,ext-current-sense-resistor;
165                 adi,slew = <0 64000 1>;
166             };
167         };
168     };
169 ...