xref: /freebsd/sys/contrib/device-tree/Bindings/iio/dac/adi,ad5755.yaml (revision 2b8331622f0b212cf3bb4fc4914a501e5321d506)
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    spi {
129        #address-cells = <1>;
130        #size-cells = <0>;
131
132        dac@0 {
133            #address-cells = <1>;
134            #size-cells = <0>;
135            compatible = "adi,ad5755";
136            reg = <0>;
137            spi-max-frequency = <1000000>;
138            spi-cpha;
139            adi,dc-dc-phase = <0>;
140            adi,dc-dc-freq-hz = <410000>;
141            adi,dc-dc-max-microvolt = <23000000>;
142            channel@0 {
143                reg = <0>;
144                adi,mode = <4>;
145                adi,ext-current-sense-resistor;
146                adi,slew = <0 64000 1>;
147            };
148            channel@1 {
149                reg = <1>;
150                adi,mode = <4>;
151                adi,ext-current-sense-resistor;
152                adi,slew = <0 64000 1>;
153            };
154            channel@2 {
155                reg = <2>;
156                adi,mode = <4>;
157                adi,ext-current-sense-resistor;
158                adi,slew = <0 64000 1>;
159            };
160            channel@3 {
161                reg = <3>;
162                adi,mode = <4>;
163                adi,ext-current-sense-resistor;
164                adi,slew = <0 64000 1>;
165            };
166        };
167    };
168...
169