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,ad5758.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Analog Devices AD5758 DAC
8
9maintainers:
10  - Michael Hennerich <Michael.Hennerich@analog.com>
11
12properties:
13  compatible:
14    const: adi,ad5758
15
16  reg:
17    maxItems: 1
18
19  spi-max-frequency: true
20  spi-cpha: true
21
22  adi,dc-dc-mode:
23    $ref: /schemas/types.yaml#/definitions/uint32
24    enum: [1, 2, 3]
25    description: |
26      Mode of operation of the dc-to-dc converter
27      Dynamic Power Control (DPC)
28      In this mode, the AD5758 circuitry senses the output voltage and
29      dynamically regulates the supply voltage, VDPC+, to meet compliance
30      requirements plus an optimized headroom voltage for the output buffer.
31
32      Programmable Power Control (PPC)
33      In this mode, the VDPC+ voltage is user-programmable to a fixed level
34      that needs to accommodate the maximum output load required.
35
36      The output of the DAC core is either converted to a current or
37      voltage output at the VIOUT pin. Only one mode can be enabled at
38      any one time.
39
40      The following values are currently supported:
41      * 1: DPC current mode
42      * 2: DPC voltage mode
43      * 3: PPC current mode
44
45      Depending on the selected output mode (voltage or current) one of the
46      two properties must be present:
47
48  adi,range-microvolt:
49    description: |
50      Voltage output range specified as <minimum, maximum>
51    oneOf:
52      - items:
53          - const: 0
54          - enum: [5000000, 10000000]
55      - items:
56          - const: -5000000
57          - const: 5000000
58      - items:
59          - const: -10000000
60          - const: 10000000
61
62  adi,range-microamp:
63    description: |
64      Current output range specified as <minimum, maximum>
65    oneOf:
66      - items:
67          - const: 0
68          - enum: [20000, 24000]
69      - items:
70          - const: 4
71          - const: 24000
72      - items:
73          - const: -20000
74          - const: 20000
75      - items:
76          - const: -24000
77          - const: 24000
78      - items:
79          - const: -1000
80          - const: 22000
81
82  reset-gpios: true
83
84  adi,dc-dc-ilim-microamp:
85    enum: [150000, 200000, 250000, 300000, 350000, 400000]
86    description: |
87      The dc-to-dc converter current limit.
88
89  adi,slew-time-us:
90    description: |
91      The time it takes for the output to reach the full scale [uS]
92    minimum: 133
93    maximum: 1023984375
94
95required:
96  - compatible
97  - reg
98  - spi-cpha
99  - adi,dc-dc-mode
100
101allOf:
102  - if:
103      properties:
104        adi,dc-dc-mode:
105          contains:
106            enum: [1, 3]
107    then:
108      properties:
109        adi,range-microvolt: false
110      required:
111        - adi,range-microamp
112    else:
113      properties:
114        adi,range-microamp: false
115      required:
116        - adi,range-microvolt
117
118additionalProperties: false
119
120examples:
121  - |
122    spi {
123        #address-cells = <1>;
124        #size-cells = <0>;
125
126        dac@0 {
127            compatible = "adi,ad5758";
128            reg = <0>;
129            spi-max-frequency = <1000000>;
130            spi-cpha;
131
132            reset-gpios = <&gpio 22 0>;
133
134            adi,dc-dc-mode = <2>;
135            adi,range-microvolt = <0 10000000>;
136            adi,dc-dc-ilim-microamp = <200000>;
137            adi,slew-time-us = <125000>;
138        };
139    };
140...
141