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