1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2# Copyright 2020 Analog Devices Inc.
3%YAML 1.2
4---
5$id: http://devicetree.org/schemas/bindings/iio/dac/adi,ad5770r.yaml#
6$schema: http://devicetree.org/meta-schemas/core.yaml#
7
8title: Analog Devices AD5770R DAC device driver
9
10maintainers:
11  - Mircea Caprioru <mircea.caprioru@analog.com>
12
13description: |
14  Bindings for the Analog Devices AD5770R current DAC device. Datasheet can be
15  found here:
16    https://www.analog.com/media/en/technical-documentation/data-sheets/AD5770R.pdf
17
18properties:
19  compatible:
20    enum:
21      - adi,ad5770r
22
23  reg:
24    maxItems: 1
25
26  avdd-supply:
27    description:
28      AVdd voltage supply. Represents two different supplies in the datasheet
29      that are in fact the same.
30
31  iovdd-supply:
32    description:
33      Voltage supply for the chip interface.
34
35  vref-supply:
36    description: Specify the voltage of the external reference used.
37      Available reference options are 1.25 V or 2.5 V. If no
38      external reference declared then the device will use the
39      internal reference of 1.25 V.
40
41  adi,external-resistor:
42    description: Specify if an external 2.5k ohm resistor is used. If not
43      specified the device will use an internal 2.5k ohm resistor.
44      The precision resistor is used for reference current generation.
45    type: boolean
46
47  reset-gpios:
48    description: GPIO spec for the RESET pin. If specified, it will be
49      asserted during driver probe.
50    maxItems: 1
51
52  channel0:
53    description: Represents an external channel which are
54      connected to the DAC. Channel 0 can act both as a current
55      source and sink.
56    type: object
57
58    properties:
59      num:
60        description: This represents the channel number.
61        items:
62          const: 0
63
64      adi,range-microamp:
65          description: Output range of the channel.
66          oneOf:
67            - $ref: /schemas/types.yaml#/definitions/int32-array
68            - items:
69                - enum: [0 300000]
70                - enum: [-60000 0]
71                - enum: [-60000 300000]
72
73  channel1:
74    description: Represents an external channel which are
75      connected to the DAC.
76    type: object
77
78    properties:
79      num:
80        description: This represents the channel number.
81        items:
82          const: 1
83
84      adi,range-microamp:
85          description: Output range of the channel.
86          oneOf:
87            - $ref: /schemas/types.yaml#/definitions/uint32-array
88            - items:
89                - enum: [0 140000]
90                - enum: [0 250000]
91
92  channel2:
93    description: Represents an external channel which are
94      connected to the DAC.
95    type: object
96
97    properties:
98      num:
99        description: This represents the channel number.
100        items:
101          const: 2
102
103      adi,range-microamp:
104          description: Output range of the channel.
105          oneOf:
106            - $ref: /schemas/types.yaml#/definitions/uint32-array
107            - items:
108                - enum: [0 140000]
109                - enum: [0 250000]
110
111patternProperties:
112  "^channel@([3-5])$":
113    type: object
114    description: Represents the external channels which are connected to the DAC.
115    properties:
116      num:
117        description: This represents the channel number.
118        items:
119          minimum: 3
120          maximum: 5
121
122      adi,range-microamp:
123          description: Output range of the channel.
124          oneOf:
125            - $ref: /schemas/types.yaml#/definitions/uint32-array
126            - items:
127                - enum: [0 45000]
128                - enum: [0 100000]
129
130required:
131- reg
132- diff-channels
133- channel0
134- channel1
135- channel2
136- channel3
137- channel4
138- channel5
139
140examples:
141  - |
142        spi {
143                #address-cells = <1>;
144                #size-cells = <0>;
145
146                ad5770r@0 {
147                        compatible = "adi,ad5770r";
148                        reg = <0>;
149                        spi-max-frequency = <1000000>;
150                        vref-supply = <&vref>;
151                        adi,external-resistor;
152                        reset-gpios = <&gpio 22 0>;
153
154                        channel@0 {
155                                num = <0>;
156                                adi,range-microamp = <(-60000) 300000>;
157                        };
158
159                        channel@1 {
160                                num = <1>;
161                                adi,range-microamp = <0 140000>;
162                        };
163
164                        channel@2 {
165                                num = <2>;
166                                adi,range-microamp = <0 55000>;
167                        };
168
169                        channel@3 {
170                                num = <3>;
171                                adi,range-microamp = <0 45000>;
172                        };
173
174                        channel@4 {
175                                num = <4>;
176                                adi,range-microamp = <0 45000>;
177                        };
178
179                        channel@5 {
180                                num = <5>;
181                                adi,range-microamp = <0 45000>;
182                        };
183                };
184        };
185...
186