Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
0002 # Copyright 2020 Analog Devices Inc.
0003 %YAML 1.2
0004 ---
0005 $id: http://devicetree.org/schemas/iio/dac/adi,ad3552r.yaml#
0006 $schema: http://devicetree.org/meta-schemas/core.yaml#
0007 
0008 title: Analog Devices AD2552R DAC device driver
0009 
0010 maintainers:
0011   - Nuno Sá <nuno.sa@analog.com>
0012 
0013 description: |
0014   Bindings for the Analog Devices AD3552R DAC device and similar.
0015   Datasheet can be found here:
0016     https://www.analog.com/media/en/technical-documentation/data-sheets/ad3542r.pdf
0017     https://www.analog.com/media/en/technical-documentation/data-sheets/ad3552r.pdf
0018 
0019 properties:
0020   compatible:
0021     enum:
0022       - adi,ad3542r
0023       - adi,ad3552r
0024 
0025   reg:
0026     maxItems: 1
0027 
0028   spi-max-frequency:
0029     maximum: 30000000
0030 
0031   reset-gpios:
0032     maxItems: 1
0033 
0034   ldac-gpios:
0035     description: |
0036       LDAC pin to be used as a hardware trigger to update the DAC channels.
0037     maxItems: 1
0038 
0039   vref-supply:
0040     description:
0041       The regulator to use as an external reference. If it does not exists the
0042       internal reference will be used. External reference must be 2.5V
0043 
0044   adi,vref-out-en:
0045     description: Vref I/O driven by internal vref to 2.5V. If not set, Vref pin
0046       will be floating.
0047     type: boolean
0048 
0049   adi,sdo-drive-strength:
0050     description: |
0051       Configure SDIO0 and SDIO1 strength levels:
0052         - 0: low SDO drive strength.
0053         - 1: medium low SDO drive strength.
0054         - 2: medium high SDO drive strength.
0055         - 3: high SDO drive strength
0056     $ref: /schemas/types.yaml#/definitions/uint32
0057     enum: [0, 1, 2, 3]
0058 
0059   '#address-cells':
0060     const: 1
0061 
0062   '#size-cells':
0063     const: 0
0064 
0065 patternProperties:
0066   "^channel@([0-1])$":
0067     type: object
0068     description: Configurations of the DAC Channels
0069 
0070     additionalProperties: false
0071 
0072     properties:
0073       reg:
0074         description: Channel number
0075         enum: [0, 1]
0076 
0077       adi,output-range-microvolt: true
0078 
0079       custom-output-range-config:
0080         type: object
0081         description: Configuration of custom range when
0082           adi,output-range-microvolt is not present.
0083           The formulas for calculation the output voltages are
0084             Vout_fs = 2.5 + [(GainN + Offset/1024) * 2.5 * Rfbx * 1.03]
0085             Vout_zs = 2.5 - [(GainP + Offset/1024) * 2.5 * Rfbx * 1.03]
0086 
0087         properties:
0088           adi,gain-offset:
0089             description: Gain offset used in the above formula
0090             $ref: /schemas/types.yaml#/definitions/int32
0091             maximum: 511
0092             minimum: -511
0093 
0094           adi,gain-scaling-p-inv-log2:
0095             description: GainP = 1 / ( 2 ^ adi,gain-scaling-p-inv-log2)
0096             $ref: /schemas/types.yaml#/definitions/uint32
0097             enum: [0, 1, 2, 3]
0098 
0099           adi,gain-scaling-n-inv-log2:
0100             description: GainN = 1 / ( 2 ^ adi,gain-scaling-n-inv-log2)
0101             $ref: /schemas/types.yaml#/definitions/uint32
0102             enum: [0, 1, 2, 3]
0103 
0104           adi,rfb-ohms:
0105             description: Feedback Resistor
0106 
0107         required:
0108           - adi,gain-offset
0109           - adi,gain-scaling-p-inv-log2
0110           - adi,gain-scaling-n-inv-log2
0111           - adi,rfb-ohms
0112 
0113     required:
0114       - reg
0115 
0116     oneOf:
0117       # If adi,output-range-microvolt is missing,
0118       # custom-output-range-config must be used
0119       - required:
0120           - adi,output-range-microvolt
0121 
0122       - required:
0123           - custom-output-range-config
0124 
0125 allOf:
0126   - if:
0127       properties:
0128         compatible:
0129           contains:
0130             const: adi,ad3542r
0131     then:
0132       patternProperties:
0133         "^channel@([0-1])$":
0134           type: object
0135           properties:
0136             adi,output-range-microvolt:
0137               description: |
0138                 Voltage output range of the channel as <minimum, maximum>
0139                 Required connections:
0140                   Rfb1x for: 0 to 2.5 V; 0 to 3V; 0 to 5 V;
0141                   Rfb2x for: 0 to 10 V; 2.5 to 7.5V; -5 to 5 V;
0142               oneOf:
0143                 - items:
0144                     - const: 0
0145                     - enum: [2500000, 3000000, 5000000, 10000000]
0146                 - items:
0147                     - const: -2500000
0148                     - const: 7500000
0149                 - items:
0150                     - const: -5000000
0151                     - const: 5000000
0152 
0153           required:
0154             - adi,output-range-microvolt
0155 
0156   - if:
0157       properties:
0158         compatible:
0159           contains:
0160             const: adi,ad3552r
0161     then:
0162       patternProperties:
0163         "^channel@([0-1])$":
0164           type: object
0165           properties:
0166             adi,output-range-microvolt:
0167               description: |
0168                 Voltage output range of the channel as <minimum, maximum>
0169                 Required connections:
0170                   Rfb1x for: 0 to 2.5 V; 0 to 5 V;
0171                   Rfb2x for: 0 to 10 V; -5 to 5 V;
0172                   Rfb4x for: -10 to 10V
0173               oneOf:
0174                 - items:
0175                     - const: 0
0176                     - enum: [2500000, 5000000, 10000000]
0177                 - items:
0178                     - const: -5000000
0179                     - const: 5000000
0180                 - items:
0181                     - const: -10000000
0182                     - const: 10000000
0183 
0184 required:
0185   - compatible
0186   - reg
0187   - spi-max-frequency
0188 
0189 additionalProperties: false
0190 
0191 examples:
0192   - |
0193     spi {
0194       #address-cells = <1>;
0195       #size-cells = <0>;
0196       ad3552r@0 {
0197               compatible = "adi,ad3552r";
0198               reg = <0>;
0199               spi-max-frequency = <20000000>;
0200               #address-cells = <1>;
0201               #size-cells = <0>;
0202               channel@0 {
0203                       reg = <0>;
0204                       adi,output-range-microvolt = <0 10000000>;
0205               };
0206               channel@1 {
0207                       reg = <1>;
0208                       custom-output-range-config {
0209                               adi,gain-offset = <5>;
0210                               adi,gain-scaling-p-inv-log2 = <1>;
0211                               adi,gain-scaling-n-inv-log2 = <2>;
0212                               adi,rfb-ohms = <1>;
0213                       };
0214             };
0215         };
0216     };
0217 ...