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: 16*80ea2007SAngelo Dureghello https://www.analog.com/media/en/technical-documentation/data-sheets/ad3541r.pdf 17b0a96c5fSMihail Chindris https://www.analog.com/media/en/technical-documentation/data-sheets/ad3542r.pdf 18*80ea2007SAngelo Dureghello https://www.analog.com/media/en/technical-documentation/data-sheets/ad3551r.pdf 19b0a96c5fSMihail Chindris https://www.analog.com/media/en/technical-documentation/data-sheets/ad3552r.pdf 20b0a96c5fSMihail Chindris 21b0a96c5fSMihail Chindrisproperties: 22b0a96c5fSMihail Chindris compatible: 23b0a96c5fSMihail Chindris enum: 24*80ea2007SAngelo Dureghello - adi,ad3541r 25b0a96c5fSMihail Chindris - adi,ad3542r 26*80ea2007SAngelo Dureghello - adi,ad3551r 27b0a96c5fSMihail Chindris - adi,ad3552r 28b0a96c5fSMihail Chindris 29b0a96c5fSMihail Chindris reg: 30b0a96c5fSMihail Chindris maxItems: 1 31b0a96c5fSMihail Chindris 32b0a96c5fSMihail Chindris spi-max-frequency: 33b0a96c5fSMihail Chindris maximum: 30000000 34b0a96c5fSMihail Chindris 35b0a96c5fSMihail Chindris reset-gpios: 36b0a96c5fSMihail Chindris maxItems: 1 37b0a96c5fSMihail Chindris 38b0a96c5fSMihail Chindris ldac-gpios: 39b0a96c5fSMihail Chindris description: | 40b0a96c5fSMihail Chindris LDAC pin to be used as a hardware trigger to update the DAC channels. 41b0a96c5fSMihail Chindris maxItems: 1 42b0a96c5fSMihail Chindris 43b0a96c5fSMihail Chindris vref-supply: 44b0a96c5fSMihail Chindris description: 45b0a96c5fSMihail Chindris The regulator to use as an external reference. If it does not exists the 46b0a96c5fSMihail Chindris internal reference will be used. External reference must be 2.5V 47b0a96c5fSMihail Chindris 48b0a96c5fSMihail Chindris adi,vref-out-en: 49b0a96c5fSMihail Chindris description: Vref I/O driven by internal vref to 2.5V. If not set, Vref pin 50b0a96c5fSMihail Chindris will be floating. 51b0a96c5fSMihail Chindris type: boolean 52b0a96c5fSMihail Chindris 53b0a96c5fSMihail Chindris adi,sdo-drive-strength: 54b0a96c5fSMihail Chindris description: | 55b0a96c5fSMihail Chindris Configure SDIO0 and SDIO1 strength levels: 56b0a96c5fSMihail Chindris - 0: low SDO drive strength. 57b0a96c5fSMihail Chindris - 1: medium low SDO drive strength. 58b0a96c5fSMihail Chindris - 2: medium high SDO drive strength. 59b0a96c5fSMihail Chindris - 3: high SDO drive strength 60b0a96c5fSMihail Chindris $ref: /schemas/types.yaml#/definitions/uint32 61b0a96c5fSMihail Chindris enum: [0, 1, 2, 3] 62b0a96c5fSMihail Chindris 63b0a96c5fSMihail Chindris '#address-cells': 64b0a96c5fSMihail Chindris const: 1 65b0a96c5fSMihail Chindris 66b0a96c5fSMihail Chindris '#size-cells': 67b0a96c5fSMihail Chindris const: 0 68b0a96c5fSMihail Chindris 69b0a96c5fSMihail ChindrispatternProperties: 70b0a96c5fSMihail Chindris "^channel@([0-1])$": 71b0a96c5fSMihail Chindris type: object 72b0a96c5fSMihail Chindris description: Configurations of the DAC Channels 73b0a96c5fSMihail Chindris 74b0a96c5fSMihail Chindris additionalProperties: false 75b0a96c5fSMihail Chindris 76b0a96c5fSMihail Chindris properties: 77b0a96c5fSMihail Chindris reg: 78b0a96c5fSMihail Chindris description: Channel number 79b0a96c5fSMihail Chindris enum: [0, 1] 80b0a96c5fSMihail Chindris 81b0a96c5fSMihail Chindris adi,output-range-microvolt: true 82b0a96c5fSMihail Chindris 83b0a96c5fSMihail Chindris custom-output-range-config: 84b0a96c5fSMihail Chindris type: object 85c682c963SRob Herring additionalProperties: false 86b0a96c5fSMihail Chindris description: Configuration of custom range when 87b0a96c5fSMihail Chindris adi,output-range-microvolt is not present. 88b0a96c5fSMihail Chindris The formulas for calculation the output voltages are 89b0a96c5fSMihail Chindris Vout_fs = 2.5 + [(GainN + Offset/1024) * 2.5 * Rfbx * 1.03] 90b0a96c5fSMihail Chindris Vout_zs = 2.5 - [(GainP + Offset/1024) * 2.5 * Rfbx * 1.03] 91b0a96c5fSMihail Chindris 92b0a96c5fSMihail Chindris properties: 93b0a96c5fSMihail Chindris adi,gain-offset: 94b0a96c5fSMihail Chindris description: Gain offset used in the above formula 95b0a96c5fSMihail Chindris $ref: /schemas/types.yaml#/definitions/int32 96b0a96c5fSMihail Chindris maximum: 511 97b0a96c5fSMihail Chindris minimum: -511 98b0a96c5fSMihail Chindris 990fbce5d1SAngelo Dureghello adi,gain-scaling-p: 1000fbce5d1SAngelo Dureghello description: GainP = 1 / ( 2 ^ adi,gain-scaling-p) 101b0a96c5fSMihail Chindris $ref: /schemas/types.yaml#/definitions/uint32 102b0a96c5fSMihail Chindris enum: [0, 1, 2, 3] 103b0a96c5fSMihail Chindris 1040fbce5d1SAngelo Dureghello adi,gain-scaling-n: 1050fbce5d1SAngelo Dureghello description: GainN = 1 / ( 2 ^ adi,gain-scaling-n) 106b0a96c5fSMihail Chindris $ref: /schemas/types.yaml#/definitions/uint32 107b0a96c5fSMihail Chindris enum: [0, 1, 2, 3] 108b0a96c5fSMihail Chindris 109b0a96c5fSMihail Chindris adi,rfb-ohms: 110b0a96c5fSMihail Chindris description: Feedback Resistor 111b0a96c5fSMihail Chindris 112b0a96c5fSMihail Chindris required: 113b0a96c5fSMihail Chindris - adi,gain-offset 1140fbce5d1SAngelo Dureghello - adi,gain-scaling-p 1150fbce5d1SAngelo Dureghello - adi,gain-scaling-n 116b0a96c5fSMihail Chindris - adi,rfb-ohms 117b0a96c5fSMihail Chindris 118b0a96c5fSMihail Chindris required: 119b0a96c5fSMihail Chindris - reg 120b0a96c5fSMihail Chindris 121b0a96c5fSMihail Chindris oneOf: 122b0a96c5fSMihail Chindris # If adi,output-range-microvolt is missing, 123b0a96c5fSMihail Chindris # custom-output-range-config must be used 124b0a96c5fSMihail Chindris - required: 125b0a96c5fSMihail Chindris - adi,output-range-microvolt 126b0a96c5fSMihail Chindris 127b0a96c5fSMihail Chindris - required: 128b0a96c5fSMihail Chindris - custom-output-range-config 129b0a96c5fSMihail Chindris 130b0a96c5fSMihail ChindrisallOf: 131b0a96c5fSMihail Chindris - if: 132b0a96c5fSMihail Chindris properties: 133b0a96c5fSMihail Chindris compatible: 134b0a96c5fSMihail Chindris contains: 135*80ea2007SAngelo Dureghello enum: 136*80ea2007SAngelo Dureghello - adi,ad3541r 137*80ea2007SAngelo Dureghello - adi,ad3542r 138b0a96c5fSMihail Chindris then: 139b0a96c5fSMihail Chindris patternProperties: 140b0a96c5fSMihail Chindris "^channel@([0-1])$": 141b0a96c5fSMihail Chindris type: object 142b0a96c5fSMihail Chindris properties: 143b0a96c5fSMihail Chindris adi,output-range-microvolt: 144b0a96c5fSMihail Chindris description: | 145b0a96c5fSMihail Chindris Voltage output range of the channel as <minimum, maximum> 146b0a96c5fSMihail Chindris Required connections: 147b0a96c5fSMihail Chindris Rfb1x for: 0 to 2.5 V; 0 to 3V; 0 to 5 V; 148b0a96c5fSMihail Chindris Rfb2x for: 0 to 10 V; 2.5 to 7.5V; -5 to 5 V; 149b0a96c5fSMihail Chindris oneOf: 150b0a96c5fSMihail Chindris - items: 151b0a96c5fSMihail Chindris - const: 0 152b0a96c5fSMihail Chindris - enum: [2500000, 3000000, 5000000, 10000000] 153b0a96c5fSMihail Chindris - items: 154b0a96c5fSMihail Chindris - const: -2500000 155b0a96c5fSMihail Chindris - const: 7500000 156b0a96c5fSMihail Chindris - items: 157b0a96c5fSMihail Chindris - const: -5000000 158b0a96c5fSMihail Chindris - const: 5000000 159b0a96c5fSMihail Chindris 160b0a96c5fSMihail Chindris required: 161b0a96c5fSMihail Chindris - adi,output-range-microvolt 162b0a96c5fSMihail Chindris 163b0a96c5fSMihail Chindris - if: 164b0a96c5fSMihail Chindris properties: 165b0a96c5fSMihail Chindris compatible: 166b0a96c5fSMihail Chindris contains: 167*80ea2007SAngelo Dureghello enum: 168*80ea2007SAngelo Dureghello - adi,ad3551r 169*80ea2007SAngelo Dureghello - adi,ad3552r 170b0a96c5fSMihail Chindris then: 171b0a96c5fSMihail Chindris patternProperties: 172b0a96c5fSMihail Chindris "^channel@([0-1])$": 173b0a96c5fSMihail Chindris type: object 174b0a96c5fSMihail Chindris properties: 175b0a96c5fSMihail Chindris adi,output-range-microvolt: 176b0a96c5fSMihail Chindris description: | 177b0a96c5fSMihail Chindris Voltage output range of the channel as <minimum, maximum> 178b0a96c5fSMihail Chindris Required connections: 179b0a96c5fSMihail Chindris Rfb1x for: 0 to 2.5 V; 0 to 5 V; 180b0a96c5fSMihail Chindris Rfb2x for: 0 to 10 V; -5 to 5 V; 181b0a96c5fSMihail Chindris Rfb4x for: -10 to 10V 182b0a96c5fSMihail Chindris oneOf: 183b0a96c5fSMihail Chindris - items: 184b0a96c5fSMihail Chindris - const: 0 185b0a96c5fSMihail Chindris - enum: [2500000, 5000000, 10000000] 186b0a96c5fSMihail Chindris - items: 187b0a96c5fSMihail Chindris - const: -5000000 188b0a96c5fSMihail Chindris - const: 5000000 189b0a96c5fSMihail Chindris - items: 190b0a96c5fSMihail Chindris - const: -10000000 191b0a96c5fSMihail Chindris - const: 10000000 192b0a96c5fSMihail Chindris 193*80ea2007SAngelo Dureghello - if: 194*80ea2007SAngelo Dureghello properties: 195*80ea2007SAngelo Dureghello compatible: 196*80ea2007SAngelo Dureghello contains: 197*80ea2007SAngelo Dureghello enum: 198*80ea2007SAngelo Dureghello - adi,ad3541r 199*80ea2007SAngelo Dureghello - adi,ad3551r 200*80ea2007SAngelo Dureghello then: 201*80ea2007SAngelo Dureghello properties: 202*80ea2007SAngelo Dureghello channel@1: false 203*80ea2007SAngelo Dureghello channel@0: 204*80ea2007SAngelo Dureghello properties: 205*80ea2007SAngelo Dureghello reg: 206*80ea2007SAngelo Dureghello const: 0 207*80ea2007SAngelo Dureghello 208b0a96c5fSMihail Chindrisrequired: 209b0a96c5fSMihail Chindris - compatible 210b0a96c5fSMihail Chindris - reg 211b0a96c5fSMihail Chindris - spi-max-frequency 212b0a96c5fSMihail Chindris 213b0a96c5fSMihail ChindrisadditionalProperties: false 214b0a96c5fSMihail Chindris 215b0a96c5fSMihail Chindrisexamples: 216b0a96c5fSMihail Chindris - | 217b0a96c5fSMihail Chindris spi { 218b0a96c5fSMihail Chindris #address-cells = <1>; 219b0a96c5fSMihail Chindris #size-cells = <0>; 220b0a96c5fSMihail Chindris ad3552r@0 { 221b0a96c5fSMihail Chindris compatible = "adi,ad3552r"; 222b0a96c5fSMihail Chindris reg = <0>; 223b0a96c5fSMihail Chindris spi-max-frequency = <20000000>; 224b0a96c5fSMihail Chindris #address-cells = <1>; 225b0a96c5fSMihail Chindris #size-cells = <0>; 226b0a96c5fSMihail Chindris channel@0 { 227b0a96c5fSMihail Chindris reg = <0>; 228b0a96c5fSMihail Chindris adi,output-range-microvolt = <0 10000000>; 229b0a96c5fSMihail Chindris }; 230b0a96c5fSMihail Chindris channel@1 { 231b0a96c5fSMihail Chindris reg = <1>; 232b0a96c5fSMihail Chindris custom-output-range-config { 233b0a96c5fSMihail Chindris adi,gain-offset = <5>; 2340fbce5d1SAngelo Dureghello adi,gain-scaling-p = <1>; 2350fbce5d1SAngelo Dureghello adi,gain-scaling-n = <2>; 236b0a96c5fSMihail Chindris adi,rfb-ohms = <1>; 237b0a96c5fSMihail Chindris }; 238b0a96c5fSMihail Chindris }; 239b0a96c5fSMihail Chindris }; 240b0a96c5fSMihail Chindris }; 241b0a96c5fSMihail Chindris... 242