xref: /linux/Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml (revision 3e9e952bb3139ad1e08f3e1960239c2988ab90c9)
1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/iio/dac/microchip,mcp47feb02.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Microchip MCP47F(E/V)B(0/1/2)(1/2/4/8) DAC with I2C Interface Families
8
9maintainers:
10  - Ariana Lazar <ariana.lazar@microchip.com>
11
12description: |
13  Datasheet for MCP47FEB01, MCP47FEB11, MCP47FEB21, MCP47FEB02, MCP47FEB12,
14  MCP47FEB22 can be found here:
15    https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/DataSheets/20005375A.pdf
16  Datasheet for MCP47FVB01, MCP47FVB11, MCP47FVB21, MCP47FVB02, MCP47FVB12,
17  MCP47FVB22 can be found here:
18    https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/DataSheets/20005405A.pdf
19  Datasheet for MCP47FEB04, MCP47FEB14, MCP47FEB24, MCP47FEB08, MCP47FEB18,
20  MCP47FEB28, MCP47FVB04, MCP47FVB14, MCP47FVB24, MCP47FVB08, MCP47FVB18,
21  MCP47FVB28 can be found here:
22    https://ww1.microchip.com/downloads/aemDocuments/documents/MSLD/ProductDocuments/DataSheets/MCP47FXBX48-Data-Sheet-DS200006368A.pdf
23
24  +------------+--------------+-------------+-------------+------------+
25  | Device     |  Resolution  |   Channels  | Vref number | Memory     |
26  |------------|--------------|-------------|-------------|------------|
27  | MCP47FEB01 |     8-bit    |      1      |      1      |   EEPROM   |
28  | MCP47FEB11 |    10-bit    |      1      |      1      |   EEPROM   |
29  | MCP47FEB21 |    12-bit    |      1      |      1      |   EEPROM   |
30  |------------|--------------|-------------|-------------|------------|
31  | MCP47FEB02 |     8-bit    |      2      |      1      |   EEPROM   |
32  | MCP47FEB12 |    10-bit    |      2      |      1      |   EEPROM   |
33  | MCP47FEB22 |    12-bit    |      2      |      1      |   EEPROM   |
34  |------------|--------------|-------------|-------------|------------|
35  | MCP47FVB01 |     8-bit    |      1      |      1      |      RAM   |
36  | MCP47FVB11 |    10-bit    |      1      |      1      |      RAM   |
37  | MCP47FVB21 |    12-bit    |      1      |      1      |      RAM   |
38  |------------|--------------|-------------|-------------|------------|
39  | MCP47FVB02 |     8-bit    |      2      |      1      |      RAM   |
40  | MCP47FVB12 |    10-bit    |      2      |      1      |      RAM   |
41  | MCP47FVB22 |    12-bit    |      2      |      1      |      RAM   |
42  |------------|--------------|-------------|-------------|------------|
43  | MCP47FVB04 |     8-bit    |      4      |      2      |      RAM   |
44  | MCP47FVB14 |    10-bit    |      4      |      2      |      RAM   |
45  | MCP47FVB24 |    12-bit    |      4      |      2      |      RAM   |
46  |------------|--------------|-------------|-------------|------------|
47  | MCP47FVB08 |     8-bit    |      8      |      2      |      RAM   |
48  | MCP47FVB18 |    10-bit    |      8      |      2      |      RAM   |
49  | MCP47FVB28 |    12-bit    |      8      |      2      |      RAM   |
50  |------------|--------------|-------------|-------------|------------|
51  | MCP47FEB04 |     8-bit    |      4      |      2      |   EEPROM   |
52  | MCP47FEB14 |    10-bit    |      4      |      2      |   EEPROM   |
53  | MCP47FEB24 |    12-bit    |      4      |      2      |   EEPROM   |
54  |------------|--------------|-------------|-------------|------------|
55  | MCP47FEB08 |     8-bit    |      8      |      2      |   EEPROM   |
56  | MCP47FEB18 |    10-bit    |      8      |      2      |   EEPROM   |
57  | MCP47FEB28 |    12-bit    |      8      |      2      |   EEPROM   |
58  +------------+--------------+-------------+-------------+------------+
59
60properties:
61  compatible:
62    enum:
63      - microchip,mcp47feb01
64      - microchip,mcp47feb11
65      - microchip,mcp47feb21
66      - microchip,mcp47feb02
67      - microchip,mcp47feb12
68      - microchip,mcp47feb22
69      - microchip,mcp47fvb01
70      - microchip,mcp47fvb11
71      - microchip,mcp47fvb21
72      - microchip,mcp47fvb02
73      - microchip,mcp47fvb12
74      - microchip,mcp47fvb22
75      - microchip,mcp47fvb04
76      - microchip,mcp47fvb14
77      - microchip,mcp47fvb24
78      - microchip,mcp47fvb08
79      - microchip,mcp47fvb18
80      - microchip,mcp47fvb28
81      - microchip,mcp47feb04
82      - microchip,mcp47feb14
83      - microchip,mcp47feb24
84      - microchip,mcp47feb08
85      - microchip,mcp47feb18
86      - microchip,mcp47feb28
87
88  reg:
89    maxItems: 1
90
91  "#address-cells":
92    const: 1
93
94  "#size-cells":
95    const: 0
96
97  vdd-supply:
98    description:
99      Provides power to the chip and it could be used as reference voltage. The
100      voltage is used to calculate scale. For parts without EEPROM at powerup
101      this will be the selected as voltage reference.
102
103  vref-supply:
104    description: |
105      Vref pin (it could be found as Vref0 into the datasheet) may be used as a
106      voltage reference when this supply is specified. The internal reference
107      will be taken into account for voltage reference besides VDD if this supply
108      does not exist.
109
110      This supply will be voltage reference for the following outputs:
111        - for single-channel device: Vout0;
112        - for dual-channel device: Vout0, Vout1;
113        - for quad-channel device: Vout0, Vout2;
114        - for octal-channel device: Vout0, Vout2, Vout6, Vout8;
115
116  vref1-supply:
117    description: |
118      Vref1 pin may be used as a voltage reference when this supply is specified.
119      The internal reference will be taken into account for voltage reference
120      beside VDD if this supply does not exist.
121
122      This supply will be voltage reference for the following outputs:
123        - for quad-channel device: Vout1, Vout3;
124        - for octal-channel device: Vout1, Vout3, Vout5, Vout7;
125
126  lat-gpios:
127    description:
128      LAT pin to be used as a hardware trigger to synchronously update the DAC
129      channels. The pin is active Low. It could be also found as LAT0 in
130      datasheet.
131    maxItems: 1
132
133  lat1-gpios:
134    description:
135      LAT1 pin to be used as a hardware trigger to synchronously update the odd
136      DAC channels on devices with 4 and 8 channels. The pin is active Low.
137    maxItems: 1
138
139  microchip,vref-buffered:
140    type: boolean
141    description:
142      Enable buffering of the external Vref/Vref0 pin in cases where the
143      external reference voltage does not have sufficient current capability in
144      order not to drop its voltage when connected to the internal resistor
145      ladder circuit.
146
147  microchip,vref1-buffered:
148    type: boolean
149    description:
150      Enable buffering of the external Vref1 pin in cases where the external
151      reference voltage does not have sufficient current capability in order not
152      to drop its voltage when connected to the internal resistor ladder
153      circuit.
154
155patternProperties:
156  "^channel@[0-7]$":
157    $ref: dac.yaml
158    type: object
159    description: Voltage output channel.
160
161    properties:
162      reg:
163        description: The channel number.
164        minItems: 1
165        maxItems: 8
166
167      label:
168        description: Unique name to identify which channel this is.
169
170    required:
171      - reg
172
173    unevaluatedProperties: false
174
175required:
176  - compatible
177  - reg
178  - vdd-supply
179
180allOf:
181  - if:
182      properties:
183        compatible:
184          contains:
185            enum:
186              - microchip,mcp47feb01
187              - microchip,mcp47feb11
188              - microchip,mcp47feb21
189              - microchip,mcp47fvb01
190              - microchip,mcp47fvb11
191              - microchip,mcp47fvb21
192    then:
193      properties:
194        lat1-gpios: false
195        vref1-supply: false
196        microchip,vref1-buffered: false
197        channel@0:
198          properties:
199            reg:
200              const: 0
201      patternProperties:
202        "^channel@[1-7]$": false
203  - if:
204      properties:
205        compatible:
206          contains:
207            enum:
208              - microchip,mcp47feb02
209              - microchip,mcp47feb12
210              - microchip,mcp47feb22
211              - microchip,mcp47fvb02
212              - microchip,mcp47fvb12
213              - microchip,mcp47fvb22
214    then:
215      properties:
216        lat1-gpios: false
217        vref1-supply: false
218        microchip,vref1-buffered: false
219      patternProperties:
220        "^channel@[0-1]$":
221          properties:
222            reg:
223              enum: [0, 1]
224        "^channel@[2-7]$": false
225  - if:
226      properties:
227        compatible:
228          contains:
229            enum:
230              - microchip,mcp47fvb04
231              - microchip,mcp47fvb14
232              - microchip,mcp47fvb24
233              - microchip,mcp47feb04
234              - microchip,mcp47feb14
235              - microchip,mcp47feb24
236    then:
237      patternProperties:
238        "^channel@[0-3]$":
239          properties:
240            reg:
241              enum: [0, 1, 2, 3]
242        "^channel@[4-7]$": false
243  - if:
244      properties:
245        compatible:
246          contains:
247            enum:
248              - microchip,mcp47fvb08
249              - microchip,mcp47fvb18
250              - microchip,mcp47fvb28
251              - microchip,mcp47feb08
252              - microchip,mcp47feb18
253              - microchip,mcp47feb28
254    then:
255      patternProperties:
256        "^channel@[0-7]$":
257          properties:
258            reg:
259              enum: [0, 1, 2, 3, 4, 5, 6, 7]
260  - if:
261      not:
262        required:
263          - vref-supply
264    then:
265      properties:
266        microchip,vref-buffered: false
267  - if:
268      not:
269        required:
270          - vref1-supply
271    then:
272      properties:
273        microchip,vref1-buffered: false
274
275additionalProperties: false
276
277examples:
278  - |
279    i2c {
280
281        #address-cells = <1>;
282        #size-cells = <0>;
283        dac@0 {
284          compatible = "microchip,mcp47feb02";
285          reg = <0>;
286          vdd-supply = <&vdac_vdd>;
287          vref-supply = <&vref_reg>;
288
289          #address-cells = <1>;
290          #size-cells = <0>;
291          channel@0 {
292            reg = <0>;
293            label = "Adjustable_voltage_ch0";
294          };
295
296          channel@1 {
297            reg = <0x1>;
298            label = "Adjustable_voltage_ch1";
299          };
300      };
301    };
302...
303