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/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  channel@0:
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      reg:
60        description: This represents the channel number.
61        const: 0
62
63      adi,range-microamp:
64          description: Output range of the channel.
65          oneOf:
66            - items:
67                - const: 0
68                - const: 300000
69            - items:
70                - const: -60000
71                - const: 0
72            - items:
73                - const: -60000
74                - const: 300000
75
76  channel@1:
77    description: Represents an external channel which are
78      connected to the DAC.
79    type: object
80
81    properties:
82      reg:
83        description: This represents the channel number.
84        const: 1
85
86      adi,range-microamp:
87          description: Output range of the channel.
88          items:
89            - const: 0
90            - enum: [ 140000, 250000 ]
91
92  channel@2:
93    description: Represents an external channel which are
94      connected to the DAC.
95    type: object
96
97    properties:
98      reg:
99        description: This represents the channel number.
100        const: 2
101
102      adi,range-microamp:
103          description: Output range of the channel.
104          items:
105            - const: 0
106            - enum: [ 55000, 150000 ]
107
108patternProperties:
109  "^channel@([3-5])$":
110    type: object
111    description: Represents the external channels which are connected to the DAC.
112    properties:
113      reg:
114        description: This represents the channel number.
115        minimum: 3
116        maximum: 5
117
118      adi,range-microamp:
119          description: Output range of the channel.
120          items:
121            - const: 0
122            - enum: [ 45000, 100000 ]
123
124required:
125- reg
126- channel@0
127- channel@1
128- channel@2
129- channel@3
130- channel@4
131- channel@5
132
133examples:
134  - |
135        spi {
136                #address-cells = <1>;
137                #size-cells = <0>;
138
139                ad5770r@0 {
140                        compatible = "adi,ad5770r";
141                        reg = <0>;
142                        spi-max-frequency = <1000000>;
143                        vref-supply = <&vref>;
144                        adi,external-resistor;
145                        reset-gpios = <&gpio 22 0>;
146                        #address-cells = <1>;
147                        #size-cells = <0>;
148
149                        channel@0 {
150                                reg = <0>;
151                                adi,range-microamp = <0 300000>;
152                        };
153
154                        channel@1 {
155                                reg = <1>;
156                                adi,range-microamp = <0 140000>;
157                        };
158
159                        channel@2 {
160                                reg = <2>;
161                                adi,range-microamp = <0 55000>;
162                        };
163
164                        channel@3 {
165                                reg = <3>;
166                                adi,range-microamp = <0 45000>;
167                        };
168
169                        channel@4 {
170                                reg = <4>;
171                                adi,range-microamp = <0 45000>;
172                        };
173
174                        channel@5 {
175                                reg = <5>;
176                                adi,range-microamp = <0 45000>;
177                        };
178                };
179        };
180...
181