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
7title: Analog Devices AD5755 Multi-Channel DAC
8
9maintainers:
10  - Sean Nyekjaer <sean.nyekjaer@prevas.dk>
11
12properties:
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  spi-max-frequency: true
29
30  adi,ext-dc-dc-compenstation-resistor:
31    $ref: /schemas/types.yaml#/definitions/flag
32    description:
33      Set if the hardware have an external resistor and thereby bypasses
34      the internal compensation resistor.
35
36  adi,dc-dc-phase:
37    $ref: /schemas/types.yaml#/definitions/uint32
38    enum: [0, 1, 2, 3]
39    description: |
40      Valid values for DC DC Phase control is:
41      0: All dc-to-dc converters clock on the same edge.
42      1: Channel A and Channel B clock on the same edge,
43         Channel C and Channel D clock on opposite edges.
44      2: Channel A and Channel C clock on the same edge,
45         Channel B and Channel D clock on opposite edges.
46      3: Channel A, Channel B, Channel C, and Channel D
47         clock 90 degrees out of phase from each other.
48
49  adi,dc-dc-freq-hz:
50    enum: [250000, 410000, 650000]
51
52  adi,dc-dc-max-microvolt:
53    description:
54      Maximum allowed Vboost voltage supplied by the dc-to-dc converter.
55    enum: [23000000, 24500000, 27000000, 29500000]
56
57  "#address-cells":
58    const: 1
59
60  "#size-cells":
61    const: 0
62
63  "#io-channel-cells":
64    const: 1
65
66required:
67  - compatible
68  - reg
69
70additionalProperties: false
71
72patternProperties:
73  "^channel@[0-7]$":
74    type: object
75    description: Child node to describe a channel
76    properties:
77      reg:
78        maxItems: 1
79
80      adi,mode:
81        $ref: /schemas/types.yaml#/definitions/uint32
82        minimum: 0
83        maximum: 6
84        description: |
85          Valid values for DAC modes is:
86          0: 0 V to 5 V voltage range.
87          1: 0 V to 10 V voltage range.
88          2: Plus minus 5 V voltage range.
89          3: Plus minus 10 V voltage range.
90          4: 4 mA to 20 mA current range.
91          5: 0 mA to 20 mA current range.
92          6: 0 mA to 24 mA current range.
93
94      adi,ext-current-sense-resistor:
95        $ref: /schemas/types.yaml#/definitions/flag
96        description:
97          Set if the hardware has an external current sense resistor
98
99      adi,enable-voltage-overrange:
100        $ref: /schemas/types.yaml#/definitions/flag
101        description: Enable voltage overrange
102
103      adi,slew:
104        $ref: /schemas/types.yaml#/definitions/uint32-array
105        description: |
106          Array of slewrate settings should contain 3 fields:
107          1: Should be either 0 or 1 in order to enable or disable slewrate.
108          2: Slew rate update frequency
109          3: Slew step size
110        items:
111          - enum: [0, 1]
112          - enum: [64000, 32000, 16000, 8000, 4000, 2000, 1000, 500, 250, 125, 64, 32, 16, 8, 4, 0]
113          - enum: [1, 2, 4, 16, 32, 64, 128, 256]
114
115    required:
116      - reg
117
118    additionalProperties: false
119
120oneOf:
121  - required:
122      - spi-cpha
123  - required:
124      - spi-cpol
125
126examples:
127  - |
128    #include <dt-bindings/iio/adi,ad5592r.h>
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...
170