xref: /linux/Documentation/devicetree/bindings/iio/dac/adi,ad3552r.yaml (revision eb5e26a491d17f520921b7e236b3bf0520553542)
1b0a96c5fSMihail Chindris# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2b0a96c5fSMihail Chindris# Copyright 2020 Analog Devices Inc.
3b0a96c5fSMihail Chindris%YAML 1.2
4b0a96c5fSMihail Chindris---
5b0a96c5fSMihail Chindris$id: http://devicetree.org/schemas/iio/dac/adi,ad3552r.yaml#
6b0a96c5fSMihail Chindris$schema: http://devicetree.org/meta-schemas/core.yaml#
7b0a96c5fSMihail Chindris
8b0a96c5fSMihail Chindristitle: Analog Devices AD2552R DAC device driver
9b0a96c5fSMihail Chindris
10b0a96c5fSMihail Chindrismaintainers:
11*eb5e26a4SNuno Sá  - Nuno Sá <nuno.sa@analog.com>
12b0a96c5fSMihail Chindris
13b0a96c5fSMihail Chindrisdescription: |
14b0a96c5fSMihail Chindris  Bindings for the Analog Devices AD3552R DAC device and similar.
15b0a96c5fSMihail Chindris  Datasheet can be found here:
16b0a96c5fSMihail Chindris    https://www.analog.com/media/en/technical-documentation/data-sheets/ad3542r.pdf
17b0a96c5fSMihail Chindris    https://www.analog.com/media/en/technical-documentation/data-sheets/ad3552r.pdf
18b0a96c5fSMihail Chindris
19b0a96c5fSMihail Chindrisproperties:
20b0a96c5fSMihail Chindris  compatible:
21b0a96c5fSMihail Chindris    enum:
22b0a96c5fSMihail Chindris      - adi,ad3542r
23b0a96c5fSMihail Chindris      - adi,ad3552r
24b0a96c5fSMihail Chindris
25b0a96c5fSMihail Chindris  reg:
26b0a96c5fSMihail Chindris    maxItems: 1
27b0a96c5fSMihail Chindris
28b0a96c5fSMihail Chindris  spi-max-frequency:
29b0a96c5fSMihail Chindris    maximum: 30000000
30b0a96c5fSMihail Chindris
31b0a96c5fSMihail Chindris  reset-gpios:
32b0a96c5fSMihail Chindris    maxItems: 1
33b0a96c5fSMihail Chindris
34b0a96c5fSMihail Chindris  ldac-gpios:
35b0a96c5fSMihail Chindris    description: |
36b0a96c5fSMihail Chindris      LDAC pin to be used as a hardware trigger to update the DAC channels.
37b0a96c5fSMihail Chindris    maxItems: 1
38b0a96c5fSMihail Chindris
39b0a96c5fSMihail Chindris  vref-supply:
40b0a96c5fSMihail Chindris    description:
41b0a96c5fSMihail Chindris      The regulator to use as an external reference. If it does not exists the
42b0a96c5fSMihail Chindris      internal reference will be used. External reference must be 2.5V
43b0a96c5fSMihail Chindris
44b0a96c5fSMihail Chindris  adi,vref-out-en:
45b0a96c5fSMihail Chindris    description: Vref I/O driven by internal vref to 2.5V. If not set, Vref pin
46b0a96c5fSMihail Chindris      will be floating.
47b0a96c5fSMihail Chindris    type: boolean
48b0a96c5fSMihail Chindris
49b0a96c5fSMihail Chindris  adi,sdo-drive-strength:
50b0a96c5fSMihail Chindris    description: |
51b0a96c5fSMihail Chindris      Configure SDIO0 and SDIO1 strength levels:
52b0a96c5fSMihail Chindris        - 0: low SDO drive strength.
53b0a96c5fSMihail Chindris        - 1: medium low SDO drive strength.
54b0a96c5fSMihail Chindris        - 2: medium high SDO drive strength.
55b0a96c5fSMihail Chindris        - 3: high SDO drive strength
56b0a96c5fSMihail Chindris    $ref: /schemas/types.yaml#/definitions/uint32
57b0a96c5fSMihail Chindris    enum: [0, 1, 2, 3]
58b0a96c5fSMihail Chindris
59b0a96c5fSMihail Chindris  '#address-cells':
60b0a96c5fSMihail Chindris    const: 1
61b0a96c5fSMihail Chindris
62b0a96c5fSMihail Chindris  '#size-cells':
63b0a96c5fSMihail Chindris    const: 0
64b0a96c5fSMihail Chindris
65b0a96c5fSMihail ChindrispatternProperties:
66b0a96c5fSMihail Chindris  "^channel@([0-1])$":
67b0a96c5fSMihail Chindris    type: object
68b0a96c5fSMihail Chindris    description: Configurations of the DAC Channels
69b0a96c5fSMihail Chindris
70b0a96c5fSMihail Chindris    additionalProperties: false
71b0a96c5fSMihail Chindris
72b0a96c5fSMihail Chindris    properties:
73b0a96c5fSMihail Chindris      reg:
74b0a96c5fSMihail Chindris        description: Channel number
75b0a96c5fSMihail Chindris        enum: [0, 1]
76b0a96c5fSMihail Chindris
77b0a96c5fSMihail Chindris      adi,output-range-microvolt: true
78b0a96c5fSMihail Chindris
79b0a96c5fSMihail Chindris      custom-output-range-config:
80b0a96c5fSMihail Chindris        type: object
81b0a96c5fSMihail Chindris        description: Configuration of custom range when
82b0a96c5fSMihail Chindris          adi,output-range-microvolt is not present.
83b0a96c5fSMihail Chindris          The formulas for calculation the output voltages are
84b0a96c5fSMihail Chindris            Vout_fs = 2.5 + [(GainN + Offset/1024) * 2.5 * Rfbx * 1.03]
85b0a96c5fSMihail Chindris            Vout_zs = 2.5 - [(GainP + Offset/1024) * 2.5 * Rfbx * 1.03]
86b0a96c5fSMihail Chindris
87b0a96c5fSMihail Chindris        properties:
88b0a96c5fSMihail Chindris          adi,gain-offset:
89b0a96c5fSMihail Chindris            description: Gain offset used in the above formula
90b0a96c5fSMihail Chindris            $ref: /schemas/types.yaml#/definitions/int32
91b0a96c5fSMihail Chindris            maximum: 511
92b0a96c5fSMihail Chindris            minimum: -511
93b0a96c5fSMihail Chindris
94b0a96c5fSMihail Chindris          adi,gain-scaling-p-inv-log2:
95b0a96c5fSMihail Chindris            description: GainP = 1 / ( 2 ^ adi,gain-scaling-p-inv-log2)
96b0a96c5fSMihail Chindris            $ref: /schemas/types.yaml#/definitions/uint32
97b0a96c5fSMihail Chindris            enum: [0, 1, 2, 3]
98b0a96c5fSMihail Chindris
99b0a96c5fSMihail Chindris          adi,gain-scaling-n-inv-log2:
100b0a96c5fSMihail Chindris            description: GainN = 1 / ( 2 ^ adi,gain-scaling-n-inv-log2)
101b0a96c5fSMihail Chindris            $ref: /schemas/types.yaml#/definitions/uint32
102b0a96c5fSMihail Chindris            enum: [0, 1, 2, 3]
103b0a96c5fSMihail Chindris
104b0a96c5fSMihail Chindris          adi,rfb-ohms:
105b0a96c5fSMihail Chindris            description: Feedback Resistor
106b0a96c5fSMihail Chindris
107b0a96c5fSMihail Chindris        required:
108b0a96c5fSMihail Chindris          - adi,gain-offset
109b0a96c5fSMihail Chindris          - adi,gain-scaling-p-inv-log2
110b0a96c5fSMihail Chindris          - adi,gain-scaling-n-inv-log2
111b0a96c5fSMihail Chindris          - adi,rfb-ohms
112b0a96c5fSMihail Chindris
113b0a96c5fSMihail Chindris    required:
114b0a96c5fSMihail Chindris      - reg
115b0a96c5fSMihail Chindris
116b0a96c5fSMihail Chindris    oneOf:
117b0a96c5fSMihail Chindris      # If adi,output-range-microvolt is missing,
118b0a96c5fSMihail Chindris      # custom-output-range-config must be used
119b0a96c5fSMihail Chindris      - required:
120b0a96c5fSMihail Chindris          - adi,output-range-microvolt
121b0a96c5fSMihail Chindris
122b0a96c5fSMihail Chindris      - required:
123b0a96c5fSMihail Chindris          - custom-output-range-config
124b0a96c5fSMihail Chindris
125b0a96c5fSMihail ChindrisallOf:
126b0a96c5fSMihail Chindris  - if:
127b0a96c5fSMihail Chindris      properties:
128b0a96c5fSMihail Chindris        compatible:
129b0a96c5fSMihail Chindris          contains:
130b0a96c5fSMihail Chindris            const: adi,ad3542r
131b0a96c5fSMihail Chindris    then:
132b0a96c5fSMihail Chindris      patternProperties:
133b0a96c5fSMihail Chindris        "^channel@([0-1])$":
134b0a96c5fSMihail Chindris          type: object
135b0a96c5fSMihail Chindris          properties:
136b0a96c5fSMihail Chindris            adi,output-range-microvolt:
137b0a96c5fSMihail Chindris              description: |
138b0a96c5fSMihail Chindris                Voltage output range of the channel as <minimum, maximum>
139b0a96c5fSMihail Chindris                Required connections:
140b0a96c5fSMihail Chindris                  Rfb1x for: 0 to 2.5 V; 0 to 3V; 0 to 5 V;
141b0a96c5fSMihail Chindris                  Rfb2x for: 0 to 10 V; 2.5 to 7.5V; -5 to 5 V;
142b0a96c5fSMihail Chindris              oneOf:
143b0a96c5fSMihail Chindris                - items:
144b0a96c5fSMihail Chindris                    - const: 0
145b0a96c5fSMihail Chindris                    - enum: [2500000, 3000000, 5000000, 10000000]
146b0a96c5fSMihail Chindris                - items:
147b0a96c5fSMihail Chindris                    - const: -2500000
148b0a96c5fSMihail Chindris                    - const: 7500000
149b0a96c5fSMihail Chindris                - items:
150b0a96c5fSMihail Chindris                    - const: -5000000
151b0a96c5fSMihail Chindris                    - const: 5000000
152b0a96c5fSMihail Chindris
153b0a96c5fSMihail Chindris          required:
154b0a96c5fSMihail Chindris            - adi,output-range-microvolt
155b0a96c5fSMihail Chindris
156b0a96c5fSMihail Chindris  - if:
157b0a96c5fSMihail Chindris      properties:
158b0a96c5fSMihail Chindris        compatible:
159b0a96c5fSMihail Chindris          contains:
160b0a96c5fSMihail Chindris            const: adi,ad3552r
161b0a96c5fSMihail Chindris    then:
162b0a96c5fSMihail Chindris      patternProperties:
163b0a96c5fSMihail Chindris        "^channel@([0-1])$":
164b0a96c5fSMihail Chindris          type: object
165b0a96c5fSMihail Chindris          properties:
166b0a96c5fSMihail Chindris            adi,output-range-microvolt:
167b0a96c5fSMihail Chindris              description: |
168b0a96c5fSMihail Chindris                Voltage output range of the channel as <minimum, maximum>
169b0a96c5fSMihail Chindris                Required connections:
170b0a96c5fSMihail Chindris                  Rfb1x for: 0 to 2.5 V; 0 to 5 V;
171b0a96c5fSMihail Chindris                  Rfb2x for: 0 to 10 V; -5 to 5 V;
172b0a96c5fSMihail Chindris                  Rfb4x for: -10 to 10V
173b0a96c5fSMihail Chindris              oneOf:
174b0a96c5fSMihail Chindris                - items:
175b0a96c5fSMihail Chindris                    - const: 0
176b0a96c5fSMihail Chindris                    - enum: [2500000, 5000000, 10000000]
177b0a96c5fSMihail Chindris                - items:
178b0a96c5fSMihail Chindris                    - const: -5000000
179b0a96c5fSMihail Chindris                    - const: 5000000
180b0a96c5fSMihail Chindris                - items:
181b0a96c5fSMihail Chindris                    - const: -10000000
182b0a96c5fSMihail Chindris                    - const: 10000000
183b0a96c5fSMihail Chindris
184b0a96c5fSMihail Chindrisrequired:
185b0a96c5fSMihail Chindris  - compatible
186b0a96c5fSMihail Chindris  - reg
187b0a96c5fSMihail Chindris  - spi-max-frequency
188b0a96c5fSMihail Chindris
189b0a96c5fSMihail ChindrisadditionalProperties: false
190b0a96c5fSMihail Chindris
191b0a96c5fSMihail Chindrisexamples:
192b0a96c5fSMihail Chindris  - |
193b0a96c5fSMihail Chindris    spi {
194b0a96c5fSMihail Chindris      #address-cells = <1>;
195b0a96c5fSMihail Chindris      #size-cells = <0>;
196b0a96c5fSMihail Chindris      ad3552r@0 {
197b0a96c5fSMihail Chindris              compatible = "adi,ad3552r";
198b0a96c5fSMihail Chindris              reg = <0>;
199b0a96c5fSMihail Chindris              spi-max-frequency = <20000000>;
200b0a96c5fSMihail Chindris              #address-cells = <1>;
201b0a96c5fSMihail Chindris              #size-cells = <0>;
202b0a96c5fSMihail Chindris              channel@0 {
203b0a96c5fSMihail Chindris                      reg = <0>;
204b0a96c5fSMihail Chindris                      adi,output-range-microvolt = <0 10000000>;
205b0a96c5fSMihail Chindris              };
206b0a96c5fSMihail Chindris              channel@1 {
207b0a96c5fSMihail Chindris                      reg = <1>;
208b0a96c5fSMihail Chindris                      custom-output-range-config {
209b0a96c5fSMihail Chindris                              adi,gain-offset = <5>;
210b0a96c5fSMihail Chindris                              adi,gain-scaling-p-inv-log2 = <1>;
211b0a96c5fSMihail Chindris                              adi,gain-scaling-n-inv-log2 = <2>;
212b0a96c5fSMihail Chindris                              adi,rfb-ohms = <1>;
213b0a96c5fSMihail Chindris                      };
214b0a96c5fSMihail Chindris            };
215b0a96c5fSMihail Chindris        };
216b0a96c5fSMihail Chindris    };
217b0a96c5fSMihail Chindris...
218