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: 11eb5e26a4SNuno 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 81c682c963SRob Herring additionalProperties: false 82b0a96c5fSMihail Chindris description: Configuration of custom range when 83b0a96c5fSMihail Chindris adi,output-range-microvolt is not present. 84b0a96c5fSMihail Chindris The formulas for calculation the output voltages are 85b0a96c5fSMihail Chindris Vout_fs = 2.5 + [(GainN + Offset/1024) * 2.5 * Rfbx * 1.03] 86b0a96c5fSMihail Chindris Vout_zs = 2.5 - [(GainP + Offset/1024) * 2.5 * Rfbx * 1.03] 87b0a96c5fSMihail Chindris 88b0a96c5fSMihail Chindris properties: 89b0a96c5fSMihail Chindris adi,gain-offset: 90b0a96c5fSMihail Chindris description: Gain offset used in the above formula 91b0a96c5fSMihail Chindris $ref: /schemas/types.yaml#/definitions/int32 92b0a96c5fSMihail Chindris maximum: 511 93b0a96c5fSMihail Chindris minimum: -511 94b0a96c5fSMihail Chindris 95b0a96c5fSMihail Chindris adi,gain-scaling-p-inv-log2: 96b0a96c5fSMihail Chindris description: GainP = 1 / ( 2 ^ adi,gain-scaling-p-inv-log2) 97b0a96c5fSMihail Chindris $ref: /schemas/types.yaml#/definitions/uint32 98b0a96c5fSMihail Chindris enum: [0, 1, 2, 3] 99b0a96c5fSMihail Chindris 100b0a96c5fSMihail Chindris adi,gain-scaling-n-inv-log2: 101b0a96c5fSMihail Chindris description: GainN = 1 / ( 2 ^ adi,gain-scaling-n-inv-log2) 102b0a96c5fSMihail Chindris $ref: /schemas/types.yaml#/definitions/uint32 103b0a96c5fSMihail Chindris enum: [0, 1, 2, 3] 104b0a96c5fSMihail Chindris 105b0a96c5fSMihail Chindris adi,rfb-ohms: 106b0a96c5fSMihail Chindris description: Feedback Resistor 107b0a96c5fSMihail Chindris 108b0a96c5fSMihail Chindris required: 109b0a96c5fSMihail Chindris - adi,gain-offset 110b0a96c5fSMihail Chindris - adi,gain-scaling-p-inv-log2 111b0a96c5fSMihail Chindris - adi,gain-scaling-n-inv-log2 112b0a96c5fSMihail Chindris - adi,rfb-ohms 113b0a96c5fSMihail Chindris 114b0a96c5fSMihail Chindris required: 115b0a96c5fSMihail Chindris - reg 116b0a96c5fSMihail Chindris 117b0a96c5fSMihail Chindris oneOf: 118b0a96c5fSMihail Chindris # If adi,output-range-microvolt is missing, 119b0a96c5fSMihail Chindris # custom-output-range-config must be used 120b0a96c5fSMihail Chindris - required: 121b0a96c5fSMihail Chindris - adi,output-range-microvolt 122b0a96c5fSMihail Chindris 123b0a96c5fSMihail Chindris - required: 124b0a96c5fSMihail Chindris - custom-output-range-config 125b0a96c5fSMihail Chindris 126b0a96c5fSMihail ChindrisallOf: 127b0a96c5fSMihail Chindris - if: 128b0a96c5fSMihail Chindris properties: 129b0a96c5fSMihail Chindris compatible: 130b0a96c5fSMihail Chindris contains: 131b0a96c5fSMihail Chindris const: adi,ad3542r 132b0a96c5fSMihail Chindris then: 133b0a96c5fSMihail Chindris patternProperties: 134b0a96c5fSMihail Chindris "^channel@([0-1])$": 135b0a96c5fSMihail Chindris type: object 136b0a96c5fSMihail Chindris properties: 137b0a96c5fSMihail Chindris adi,output-range-microvolt: 138b0a96c5fSMihail Chindris description: | 139b0a96c5fSMihail Chindris Voltage output range of the channel as <minimum, maximum> 140b0a96c5fSMihail Chindris Required connections: 141b0a96c5fSMihail Chindris Rfb1x for: 0 to 2.5 V; 0 to 3V; 0 to 5 V; 142*72d0a20fSAngelo Dureghello Rfb2x for: 0 to 10 V; -2.5 to 7.5V; -5 to 5 V; 143b0a96c5fSMihail Chindris oneOf: 144b0a96c5fSMihail Chindris - items: 145b0a96c5fSMihail Chindris - const: 0 146b0a96c5fSMihail Chindris - enum: [2500000, 3000000, 5000000, 10000000] 147b0a96c5fSMihail Chindris - items: 148b0a96c5fSMihail Chindris - const: -2500000 149b0a96c5fSMihail Chindris - const: 7500000 150b0a96c5fSMihail Chindris - items: 151b0a96c5fSMihail Chindris - const: -5000000 152b0a96c5fSMihail Chindris - const: 5000000 153b0a96c5fSMihail Chindris 154b0a96c5fSMihail Chindris required: 155b0a96c5fSMihail Chindris - adi,output-range-microvolt 156b0a96c5fSMihail Chindris 157b0a96c5fSMihail Chindris - if: 158b0a96c5fSMihail Chindris properties: 159b0a96c5fSMihail Chindris compatible: 160b0a96c5fSMihail Chindris contains: 161b0a96c5fSMihail Chindris const: adi,ad3552r 162b0a96c5fSMihail Chindris then: 163b0a96c5fSMihail Chindris patternProperties: 164b0a96c5fSMihail Chindris "^channel@([0-1])$": 165b0a96c5fSMihail Chindris type: object 166b0a96c5fSMihail Chindris properties: 167b0a96c5fSMihail Chindris adi,output-range-microvolt: 168b0a96c5fSMihail Chindris description: | 169b0a96c5fSMihail Chindris Voltage output range of the channel as <minimum, maximum> 170b0a96c5fSMihail Chindris Required connections: 171b0a96c5fSMihail Chindris Rfb1x for: 0 to 2.5 V; 0 to 5 V; 172b0a96c5fSMihail Chindris Rfb2x for: 0 to 10 V; -5 to 5 V; 173b0a96c5fSMihail Chindris Rfb4x for: -10 to 10V 174b0a96c5fSMihail Chindris oneOf: 175b0a96c5fSMihail Chindris - items: 176b0a96c5fSMihail Chindris - const: 0 177b0a96c5fSMihail Chindris - enum: [2500000, 5000000, 10000000] 178b0a96c5fSMihail Chindris - items: 179b0a96c5fSMihail Chindris - const: -5000000 180b0a96c5fSMihail Chindris - const: 5000000 181b0a96c5fSMihail Chindris - items: 182b0a96c5fSMihail Chindris - const: -10000000 183b0a96c5fSMihail Chindris - const: 10000000 184b0a96c5fSMihail Chindris 185b0a96c5fSMihail Chindrisrequired: 186b0a96c5fSMihail Chindris - compatible 187b0a96c5fSMihail Chindris - reg 188b0a96c5fSMihail Chindris - spi-max-frequency 189b0a96c5fSMihail Chindris 190b0a96c5fSMihail ChindrisadditionalProperties: false 191b0a96c5fSMihail Chindris 192b0a96c5fSMihail Chindrisexamples: 193b0a96c5fSMihail Chindris - | 194b0a96c5fSMihail Chindris spi { 195b0a96c5fSMihail Chindris #address-cells = <1>; 196b0a96c5fSMihail Chindris #size-cells = <0>; 197b0a96c5fSMihail Chindris ad3552r@0 { 198b0a96c5fSMihail Chindris compatible = "adi,ad3552r"; 199b0a96c5fSMihail Chindris reg = <0>; 200b0a96c5fSMihail Chindris spi-max-frequency = <20000000>; 201b0a96c5fSMihail Chindris #address-cells = <1>; 202b0a96c5fSMihail Chindris #size-cells = <0>; 203b0a96c5fSMihail Chindris channel@0 { 204b0a96c5fSMihail Chindris reg = <0>; 205b0a96c5fSMihail Chindris adi,output-range-microvolt = <0 10000000>; 206b0a96c5fSMihail Chindris }; 207b0a96c5fSMihail Chindris channel@1 { 208b0a96c5fSMihail Chindris reg = <1>; 209b0a96c5fSMihail Chindris custom-output-range-config { 210b0a96c5fSMihail Chindris adi,gain-offset = <5>; 211b0a96c5fSMihail Chindris adi,gain-scaling-p-inv-log2 = <1>; 212b0a96c5fSMihail Chindris adi,gain-scaling-n-inv-log2 = <2>; 213b0a96c5fSMihail Chindris adi,rfb-ohms = <1>; 214b0a96c5fSMihail Chindris }; 215b0a96c5fSMihail Chindris }; 216b0a96c5fSMihail Chindris }; 217b0a96c5fSMihail Chindris }; 218b0a96c5fSMihail Chindris... 219