code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/chemical/ams,ccs811.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: AMS CCS811 VOC Sensor

maintainers:
  - Narcisa Vasile <narcisaanamaria12@gmail.com>

description: |
  Ultra-Low Power Digital Gas Sensor for Monitoring Indoor Air Quality.

properties:
  compatible:
    enum:
      - ams,ccs811
  reg:
    maxItems: 1

  reset-gpios:
    description: GPIO connected to the nRESET line. This is an active low
                 input to CCS811.
    maxItems: 1

  wakeup-gpios:
    description: GPIO connected to the nWAKE line. This is an active low
                 input to CCS811.
    maxItems: 1

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

      voc@5b {
        compatible = "ams,ccs811";
        reg = <0x5b>;
        reset-gpios = <&gpioa 11 GPIO_ACTIVE_LOW>;
        wakeup-gpios = <&gpioa 12 GPIO_ACTIVE_LOW>;
      };
    };

...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/chemical/atlas,sensor.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Atlas Scientific OEM + EZO sensors

maintainers:
  - Matt Ranostay <matt.ranostay@konsulko.com>

description: |
  Atlas Scientific OEM + EZO sensors connected via I2C

  Datasheets:
    http://www.atlas-scientific.com/_files/_datasheets/_oem/DO_oem_datasheet.pdf
    http://www.atlas-scientific.com/_files/_datasheets/_oem/EC_oem_datasheet.pdf
    http://www.atlas-scientific.com/_files/_datasheets/_oem/ORP_oem_datasheet.pdf
    http://www.atlas-scientific.com/_files/_datasheets/_oem/pH_oem_datasheet.pdf
    http://www.atlas-scientific.com/_files/_datasheets/_oem/RTD_oem_datasheet.pdf
    http://www.atlas-scientific.com/_files/_datasheets/_probe/EZO_CO2_Datasheet.pdf
    https://www.atlas-scientific.com/files/EZO_O2_datasheet.pdf
    https://www.atlas-scientific.com/files/EZO_HUM_Datasheet.pdf

properties:
  compatible:
    enum:
      - atlas,do-sm
      - atlas,ec-sm
      - atlas,orp-sm
      - atlas,ph-sm
      - atlas,rtd-sm
      - atlas,co2-ezo
      - atlas,o2-ezo
      - atlas,hum-ezo

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

      atlas@66 {
        compatible = "atlas,orp-sm";
        reg = <0x66>;
        interrupt-parent = <&gpio1>;
        interrupts = <16 2>;
      };
    };

repo_name: angery/linux


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/chemical/plantower,pms7003.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Plantower PMS7003 air pollution sensor

maintainers:
  - Tomasz Duszynski <tduszyns@gmail.com>

description: |
  Air pollution sensor capable of measuring mass concentration of dust
  particles.

properties:
  compatible:
    enum:
      - plantower,pms1003
      - plantower,pms3003
      - plantower,pms5003
      - plantower,pms6003
      - plantower,pms7003
      - plantower,pmsa003

  vcc-supply:
    description: regulator that provides power to the sensor

  plantower,set-gpios:
    description: GPIO connected to the SET line
    maxItems: 1

  reset-gpios:
    description: GPIO connected to the RESET line
    maxItems: 1

required:
  - compatible
  - vcc-supply

additionalProperties: false

examples:
  - |
    serial {
      air-pollution-sensor {
        compatible = "plantower,pms7003";
        vcc-supply = <&reg_vcc5v0>;
      };
    };

...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/chemical/senseair,sunrise.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Senseair Sunrise 006-0-0007 CO2 Sensor

maintainers:
  - Jacopo Mondi <jacopo@jmondi.org>

description: |
  Senseair Sunrise 006-0-0007 is a NDIR CO2 sensor. It supports I2C or UART buses
  for communications and control.

  Datasheets:
    https://rmtplusstoragesenseair.blob.core.windows.net/docs/Dev/publicerat/PSP11704.pdf
    https://rmtplusstoragesenseair.blob.core.windows.net/docs/Dev/publicerat/PSH11649.pdf
    https://rmtplusstoragesenseair.blob.core.windows.net/docs/Dev/publicerat/TDE5531.pdf
    https://rmtplusstoragesenseair.blob.core.windows.net/docs/Market/publicerat/TDE7318.pdf

properties:
  compatible:
    const: senseair,sunrise-006-0-0007

  reg:
    maxItems: 1

  ndry-gpios:
    maxItems: 1
    description:
      Phandle to the GPIO line connected to the nDRY pin. Typically active low.

  en-gpios:
    maxItems: 1
    description:
      Phandle to the GPIO line connected to the EN pin. Typically active high.

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

      co2-sensor@68 {
        compatible = "senseair,sunrise-006-0-0007";
        reg = <0x68>;
      };
    };


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/chemical/sensirion,scd30.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Sensirion SCD30 carbon dioxide sensor

maintainers:
  - Tomasz Duszynski <tomasz.duszynski@octakon.com>

description: |
  Air quality sensor capable of measuring co2 concentration, temperature
  and relative humidity.

properties:
  compatible:
    enum:
      - sensirion,scd30

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  vdd-supply: true

  sensirion,sel-gpios:
    description: GPIO connected to the SEL line
    maxItems: 1

  sensirion,pwm-gpios:
    description: GPIO connected to the PWM line
    maxItems: 1

required:
  - compatible

additionalProperties: false

examples:
  - |
    # include <dt-bindings/interrupt-controller/irq.h>
    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

      co2-sensor@61 {
        compatible = "sensirion,scd30";
        reg = <0x61>;
        vdd-supply = <&vdd>;
        interrupt-parent = <&gpio0>;
        interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
      };
    };
  - |
    # include <dt-bindings/interrupt-controller/irq.h>
    serial {
      co2-sensor {
        compatible = "sensirion,scd30";
        vdd-supply = <&vdd>;
        interrupt-parent = <&gpio0>;
        interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
      };
    };

...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/chemical/sensirion,scd4x.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Sensirion SCD4X carbon dioxide sensor

maintainers:
  - Roan van Dijk <roan@protonic.nl>

description: |
  Air quality sensor capable of measuring co2 concentration, temperature
  and relative humidity.

properties:
  compatible:
    enum:
      - sensirion,scd40
      - sensirion,scd41

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  vdd-supply: true

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

      co2-sensor@62 {
        compatible = "sensirion,scd41";
        reg = <0x62>;
      };
    };


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/chemical/sensirion,sps30.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Sensirion SPS30 particulate matter sensor

maintainers:
  - Tomasz Duszynski <tduszyns@gmail.com>

description: |
  Air pollution sensor capable of measuring mass concentration of dust
  particles.

properties:
  compatible:
    enum:
      - sensirion,sps30
  reg:
    maxItems: 1

required:
  - compatible

additionalProperties: false

examples:
  - |
    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

      air-pollution-sensor@69 {
        compatible = "sensirion,sps30";
        reg = <0x69>;
      };
    };
  - |
    serial {
      air-pollution-sensor {
        compatible = "sensirion,sps30";
      };
    };

...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/common.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Common properties for iio sensors

maintainers:
  - Jonathan Cameron <jic23@kernel.org>
  - Guido Günther <agx@sigxcpu.org>

description: |
  This document defines device tree properties common to several iio
  sensors. It doesn't constitue a device tree binding specification by itself but
  is meant to be referenced by device tree bindings.

  When referenced from sensor tree bindings the properties defined in this
  document are defined as follows. The sensor tree bindings are responsible for
  defining whether each property is required or optional.

properties:
  proximity-near-level:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      For proximity sensors whether an object can be considered near to the
      device depends on parameters like sensor position, covering glass and
      aperture. This value gives an indication to userspace for which
      sensor readings this is the case.

      Raw proximity values equal or above this level should be
      considered 'near' to the device (an object is near to the
      sensor).

additionalProperties: true

...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
# Copyright 2020 Analog Devices Inc.
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/adi,ad3552r.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD2552R DAC device driver

maintainers:
  - Nuno Sá <nuno.sa@analog.com>

description: |
  Bindings for the Analog Devices AD3552R DAC device and similar.
  Datasheet can be found here:
    https://www.analog.com/media/en/technical-documentation/data-sheets/ad3542r.pdf
    https://www.analog.com/media/en/technical-documentation/data-sheets/ad3552r.pdf

properties:
  compatible:
    enum:
      - adi,ad3542r
      - adi,ad3552r

  reg:
    maxItems: 1

  spi-max-frequency:
    maximum: 30000000

  reset-gpios:
    maxItems: 1

  ldac-gpios:
    description: |
      LDAC pin to be used as a hardware trigger to update the DAC channels.
    maxItems: 1

  vref-supply:
    description:
      The regulator to use as an external reference. If it does not exists the
      internal reference will be used. External reference must be 2.5V

  adi,vref-out-en:
    description: Vref I/O driven by internal vref to 2.5V. If not set, Vref pin
      will be floating.
    type: boolean

  adi,sdo-drive-strength:
    description: |
      Configure SDIO0 and SDIO1 strength levels:
        - 0: low SDO drive strength.
        - 1: medium low SDO drive strength.
        - 2: medium high SDO drive strength.
        - 3: high SDO drive strength
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [0, 1, 2, 3]

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

patternProperties:
  "^channel@([0-1])$":
    type: object
    description: Configurations of the DAC Channels

    additionalProperties: false

    properties:
      reg:
        description: Channel number
        enum: [0, 1]

      adi,output-range-microvolt: true

      custom-output-range-config:
        type: object
        additionalProperties: false
        description: Configuration of custom range when
          adi,output-range-microvolt is not present.
          The formulas for calculation the output voltages are
            Vout_fs = 2.5 + [(GainN + Offset/1024) * 2.5 * Rfbx * 1.03]
            Vout_zs = 2.5 - [(GainP + Offset/1024) * 2.5 * Rfbx * 1.03]

        properties:
          adi,gain-offset:
            description: Gain offset used in the above formula
            $ref: /schemas/types.yaml#/definitions/int32
            maximum: 511
            minimum: -511

          adi,gain-scaling-p-inv-log2:
            description: GainP = 1 / ( 2 ^ adi,gain-scaling-p-inv-log2)
            $ref: /schemas/types.yaml#/definitions/uint32
            enum: [0, 1, 2, 3]

          adi,gain-scaling-n-inv-log2:
            description: GainN = 1 / ( 2 ^ adi,gain-scaling-n-inv-log2)
            $ref: /schemas/types.yaml#/definitions/uint32
            enum: [0, 1, 2, 3]

          adi,rfb-ohms:
            description: Feedback Resistor

        required:
          - adi,gain-offset
          - adi,gain-scaling-p-inv-log2
          - adi,gain-scaling-n-inv-log2
          - adi,rfb-ohms

    required:
      - reg

    oneOf:
      # If adi,output-range-microvolt is missing,
      # custom-output-range-config must be used
      - required:
          - adi,output-range-microvolt

      - required:
          - custom-output-range-config

allOf:
  - if:
      properties:
        compatible:
          contains:
            const: adi,ad3542r
    then:
      patternProperties:
        "^channel@([0-1])$":
          type: object
          properties:
            adi,output-range-microvolt:
              description: |
                Voltage output range of the channel as <minimum, maximum>
                Required connections:
                  Rfb1x for: 0 to 2.5 V; 0 to 3V; 0 to 5 V;
                  Rfb2x for: 0 to 10 V; 2.5 to 7.5V; -5 to 5 V;
              oneOf:
                - items:
                    - const: 0
                    - enum: [2500000, 3000000, 5000000, 10000000]
                - items:
                    - const: -2500000
                    - const: 7500000
                - items:
                    - const: -5000000
                    - const: 5000000

          required:
            - adi,output-range-microvolt

  - if:
      properties:
        compatible:
          contains:
            const: adi,ad3552r
    then:
      patternProperties:
        "^channel@([0-1])$":
          type: object
          properties:
            adi,output-range-microvolt:
              description: |
                Voltage output range of the channel as <minimum, maximum>
                Required connections:
                  Rfb1x for: 0 to 2.5 V; 0 to 5 V;
                  Rfb2x for: 0 to 10 V; -5 to 5 V;
                  Rfb4x for: -10 to 10V
              oneOf:
                - items:
                    - const: 0
                    - enum: [2500000, 5000000, 10000000]
                - items:
                    - const: -5000000
                    - const: 5000000
                - items:
                    - const: -10000000
                    - const: 10000000

required:
  - compatible
  - reg
  - spi-max-frequency

additionalProperties: false

examples:
  - |
    spi {
      #address-cells = <1>;
      #size-cells = <0>;
      ad3552r@0 {
              compatible = "adi,ad3552r";
              reg = <0>;
              spi-max-frequency = <20000000>;
              #address-cells = <1>;
              #size-cells = <0>;
              channel@0 {
                      reg = <0>;
                      adi,output-range-microvolt = <0 10000000>;
              };
              channel@1 {
                      reg = <1>;
                      custom-output-range-config {
                              adi,gain-offset = <5>;
                              adi,gain-scaling-p-inv-log2 = <1>;
                              adi,gain-scaling-n-inv-log2 = <2>;
                              adi,rfb-ohms = <1>;
                      };
            };
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/adi,ad5064.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD5064 and similar DACs

maintainers:
  - Lars-Peter Clausen <lars@metafoo.de>
  - Jonathan Cameron <jic23@kernel.org>

description: |
   A range of similar DAC devices with between 1 and 12 channels. Some parts
   have internal references, others require a single shared external reference
   and the remainder have a separate reference pin for each DAC.

properties:
  compatible:
    oneOf:
      - description: I2C devics
        enum:
          - adi,ad5024
          - adi,ad5025
          - adi,ad5044
          - adi,ad5045
          - adi,ad5064
          - adi,ad5064-1
          - adi,ad5065
          - adi,ad5628-1
          - adi,ad5628-2
          - adi,ad5648-1
          - adi,ad5648-2
          - adi,ad5666-1
          - adi,ad5666-2
          - adi,ad5668-1
          - adi,ad5668-2
          - adi,ad5668-3
      - description: SPI devices
        enum:
          - adi,ad5625
          - adi,ad5625r-1v25
          - adi,ad5625r-2v5
          - adi,ad5627
          - adi,ad5627r-1v25
          - adi,ad5627r-2v5
          - adi,ad5629-1
          - adi,ad5629-2
          - adi,ad5629-3
          - adi,ad5645r-1v25
          - adi,ad5645r-2v5
          - adi,ad5665
          - adi,ad5665r-1v25
          - adi,ad5665r-2v5
          - adi,ad5667
          - adi,ad5667r-1v25
          - adi,ad5667r-2v5
          - adi,ad5669-1
          - adi,ad5669-2
          - adi,ad5669-3
          - lltc,ltc2606
          - lltc,ltc2607
          - lltc,ltc2609
          - lltc,ltc2616
          - lltc,ltc2617
          - lltc,ltc2619
          - lltc,ltc2626
          - lltc,ltc2627
          - lltc,ltc2629
          - lltc,ltc2631-l12
          - lltc,ltc2631-h12
          - lltc,ltc2631-l10
          - lltc,ltc2631-h10
          - lltc,ltc2631-l8
          - lltc,ltc2631-h8
          - lltc,ltc2633-l12
          - lltc,ltc2633-h12
          - lltc,ltc2633-l10
          - lltc,ltc2633-h10
          - lltc,ltc2633-l8
          - lltc,ltc2633-h8
          - lltc,ltc2635-l12
          - lltc,ltc2635-h12
          - lltc,ltc2635-l10
          - lltc,ltc2635-h10
          - lltc,ltc2635-l8
          - lltc,ltc2635-h8

  reg:
    maxItems: 1

  vrefA-supply: true
  vrefB-supply: true
  vrefC-supply: true
  vrefD-supply: true
  vref-supply: true

required:
  - compatible
  - reg

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#
  - # Shared external vref, no internal reference
    if:
      properties:
        compatible:
          contains:
            enum:
              - adi,ad5064-1
              - adi,ad5625
              - adi,ad5627
              - adi,ad5665
              - adi,ad5667
              - lltc,ltc2606
              - lltc,ltc2607
              - lltc,ltc2616
              - lltc,ltc2617
              - lltc,ltc2626
              - lltc,ltc2627
    then:
      properties:
        vref-supply: true
        vrefA-supply: false
        vrefB-supply: false
        vrefC-supply: false
        vrefD-supply: false
      required:
        - vref-supply
  - # Shared external vref, internal reference available
    if:
      properties:
        compatible:
          contains:
            enum:
              - adi,ad5625r-1v25
              - adi,ad5625r-2v5
              - adi,ad5627r-1v25
              - adi,ad5627r-2v5
              - adi,ad5628-1
              - adi,ad5628-2
              - adi,ad5629-1
              - adi,ad5629-2
              - adi,ad5629-3
              - adi,ad5645r-1v25
              - adi,ad5645r-2v5
              - adi,ad5647r-1v25
              - adi,ad5647r-2v5
              - adi,ad5648-1
              - adi,ad5648-2
              - adi,ad5665r-1v25
              - adi,ad5665r-2v5
              - adi,ad5666-1
              - adi,ad5666-2
              - adi,ad5667r-1v25
              - adi,ad5667r-2v5
              - adi,ad5668-1
              - adi,ad5668-2
              - adi,ad5668-3
              - adi,ad5669-1
              - adi,ad5669-2
              - adi,ad5669-3
              - lltc,ltc2631-l12
              - lltc,ltc2631-h12
              - lltc,ltc2631-l10
              - lltc,ltc2631-h10
              - lltc,ltc2631-l8
              - lltc,ltc2631-h8
              - lltc,ltc2633-l12
              - lltc,ltc2633-h12
              - lltc,ltc2633-l10
              - lltc,ltc2633-h10
              - lltc,ltc2633-l8
              - lltc,ltc2633-h8
              - lltc,ltc2635-l12
              - lltc,ltc2635-h12
              - lltc,ltc2635-l10
              - lltc,ltc2635-h10
              - lltc,ltc2635-l8
              - lltc,ltc2635-h8
    then:
      properties:
        vref-supply: true
        vrefA-supply: false
        vrefB-supply: false
        vrefC-supply: false
        vrefD-supply: false
  - # 4 input devices, separate vrefs, no internal reference
    if:
      properties:
        compatible:
          contains:
            enum:
              - adi,ad5024
              - adi,ad5044
              - adi,ad5064
              - lltc,ltc2609
              - lltc,ltc2619
              - lltc,ltc2629
    then:
      properties:
        vrefA-supply: true
        vrefB-supply: true
        vrefC-supply: true
        vrefD-supply: true
        vref-supply: false
      required:
        - vrefA-supply
        - vrefB-supply
        - vrefC-supply
        - vrefD-supply
  - # 2 input devices, separate vrefs, no internal reference
    if:
      properties:
        compatible:
          contains:
            enum:
              - adi,ad5025
              - adi,ad5045
              - adi,ad5065
    then:
      properties:
        vrefA-supply: true
        vrefB-supply: true
        vrefC-supply: false
        vrefD-supply: false
        vref-supply: false
      required:
        - vrefA-supply
        - vrefB-supply

unevaluatedProperties: false

examples:
  - |
    spi {
        #address-cells = <1>;
        #size-cells = <0>;
        dac@0 {
            reg = <0>;
            compatible = "adi,ad5625";
            vref-supply = <&dac_vref>;
        };
    };
  - |
    spi {
        #address-cells = <1>;
        #size-cells = <0>;
        dac@0 {
            reg = <0>;
            compatible = "adi,ad5625r-1v25";
        };
    };
  - |
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;
        dac@42 {
            reg = <0x42>;
            compatible = "adi,ad5024";
            vrefA-supply = <&dac_vref>;
            vrefB-supply = <&dac_vref>;
            vrefC-supply = <&dac_vref2>;
            vrefD-supply = <&dac_vref2>;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/adi,ad5360.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD5360 and similar DACs

maintainers:
  - Lars-Peter Clausen <lars@metafoo.de>
  - Jonathan Cameron <jic23@kernel.org>

properties:
  compatible:
    enum:
      - adi,ad5360
      - adi,ad5361
      - adi,ad5363
      - adi,ad5370
      - adi,ad5371
      - adi,ad5372
      - adi,ad5373

  reg:
    maxItems: 1

  vref0-supply: true
  vref1-supply: true
  vref2-supply: true

required:
  - compatible
  - reg
  - vref0-supply
  - vref1-supply

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#
  - if:
      properties:
        compatible:
          contains:
            enum:
              - adi,ad5360
              - adi,ad5361
              - adi,ad5363
              - adi,ad5370
              - adi,ad5372
              - adi,ad5373
    then:
      properties:
        vref2-supply: false
  - if:
      properties:
        compatible:
          contains:
            enum:
              - adi,ad5371
    then:
      required:
        - vref2-supply

unevaluatedProperties: false

examples:
  - |
    spi {
        #address-cells = <1>;
        #size-cells = <0>;
        dac@0 {
            reg = <0>;
            compatible = "adi,ad5371";
            vref0-supply = <&dac_vref0>;
            vref1-supply = <&dac_vref1>;
            vref2-supply = <&dac_vref2>;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/adi,ad5380.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD5380 and similar DACs

maintainers:
  - Lars-Peter Clausen <lars@metafoo.de>
  - Jonathan Cameron <jic23@kernel.org>

description: |
  DAC devices supporting both SPI and I2C interfaces.
properties:
  compatible:
    enum:
      - adi,ad5380-3
      - adi,ad5380-5
      - adi,ad5381-3
      - adi,ad5381-5
      - adi,ad5382-3
      - adi,ad5382-5
      - adi,ad5383-3
      - adi,ad5383-5
      - adi,ad5384-3
      - adi,ad5384-5
      - adi,ad5390-3
      - adi,ad5390-5
      - adi,ad5391-3
      - adi,ad5391-5
      - adi,ad5392-3
      - adi,ad5392-5

  reg:
    maxItems: 1

  vref-supply:
    description:
      If not supplied devices will use internal regulators.

required:
  - compatible
  - reg

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#

unevaluatedProperties: false

examples:
  - |
    spi {
        #address-cells = <1>;
        #size-cells = <0>;
        dac@0 {
           reg = <0>;
           compatible = "adi,ad5390-5";
           vref-supply = <&dacvref>;
        };
    };
  - |
    i2c {
       #address-cells = <1>;
       #size-cells = <0>;
       dac@42 {
          reg = <0x42>;
          compatible = "adi,ad5380-3";
       };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/adi,ad5421.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD5421 DAC

maintainers:
  - Lars-Peter Clausen <lars@metafoo.de>
  - Jonathan Cameron <jic23@kernel.org>

description: |
  AD5421 is designed for us in loop-powered, 4 mA to 20 mA smart transmitter
  applications. It provides a 16-bit DAC, current amplifier, voltage regulator
  to drive the loop and a voltage reference.

properties:
  compatible:
    const: adi,ad5421

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1
    description: Fault signal.

required:
  - compatible
  - reg

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        dac@0 {
            compatible = "adi,ad5421";
            reg = <0>;
            spi-max-frequency = <30000000>;
            interrupts = <55 IRQ_TYPE_LEVEL_HIGH>;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/adi,ad5449.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD5449 and similar DACs

maintainers:
  - Lars-Peter Clausen <lars@metafoo.de>
  - Jonathan Cameron <jic23@kernel.org>

description:
  Family of multiplying DACs from Analog Devices

properties:
  compatible:
    enum:
      - adi,ad5415
      - adi,ad5426
      - adi,ad5429
      - adi,ad5432
      - adi,ad5439
      - adi,ad5443
      - adi,ad5449

  reg:
    maxItems: 1

  VREF-supply: true
  VREFA-supply: true
  VREFB-supply: true

required:
  - compatible
  - reg

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#
  - if:
      properties:
        compatible:
          contains:
            enum:
              - adi,ad5415
              - adi,ad5426
              - adi,ad5432
    then:
      properties:
        VREF-supply: true
        VREFA-supply: false
        VREFB-supply: false
      required:
        - VREF-supply
  - if:
      properties:
        compatible:
          contains:
            enum:
              - adi,ad5429
              - adi,ad5439
              - adi,ad5449
    then:
      properties:
        VREF-supply: false
        VREFA-supply: true
        VREFB-supply: true
      required:
        - VREFA-supply
        - VREFB-supply

unevaluatedProperties: false

examples:
  - |
    spi {
        #address-cells = <1>;
        #size-cells = <0>;
        dac@0 {
            reg = <0>;
            compatible = "adi,ad5415";
            VREF-supply = <&dac_ref>;
        };
    };
  - |
    spi {
        #address-cells = <1>;
        #size-cells = <0>;
        dac@0 {
            reg = <0>;
            compatible = "adi,ad5429";
            VREFA-supply = <&dac_refA>;
            VREFB-supply = <&dac_refB>;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/adi,ad5504.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD5501 and AD5504 DACs

maintainers:
  - Lars-Peter Clausen <lars@metafoo.de>
  - Jonathan Cameron <jic23@kernel.org>

description:
  High voltage (up to 60V) DACs with temperature sensor alarm function

properties:
  compatible:
    enum:
      - adi,ad5501
      - adi,ad5504

  reg:
    maxItems: 1

  interrupts:
    description: Used for temperature alarm.
    maxItems: 1

  vcc-supply: true

additionalProperties: false

required:
  - compatible
  - reg

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    spi {
        #address-cells = <1>;
        #size-cells = <0>;
        dac@0 {
            reg = <0>;
            compatible = "adi,ad5504";
            vcc-supply = <&dac_vcc>;
            interrupts = <55 IRQ_TYPE_EDGE_FALLING>;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/adi,ad5592r.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD5592R/AD5593R DAC/ADC

maintainers:
  - Michael Hennerich <michael.hennerich@analog.com>

properties:
  compatible:
    enum:
      - adi,ad5592r
      - adi,ad5593r

  reg:
    maxItems: 1

  spi-max-frequency:
    maximum: 30000000

  spi-cpol: true

  "#address-cells":
    const: 1

  "#size-cells":
    const: 0

  "#io-channel-cells":
    const: 1

  vref-supply:
    description: If not set internal 2.5V reference used.

  reset-gpios:
    maxItems: 1

  gpio-controller:
    description: Marks the device node as a GPIO controller.

  "#gpio-cells":
    const: 2
    description:
      The first cell is the GPIO number and the second cell specifies
      GPIO flags, as defined in <dt-bindings/gpio/gpio.h>.

required:
  - compatible
  - reg
  - "#address-cells"
  - "#size-cells"

allOf:
  - if:
      properties:
        compatible:
          contains:
            const: adi,ad5592r
    then:
      required:
        - spi-cpol
    else:
      properties:
        spi-cpol: false

additionalProperties: false

patternProperties:
  "^(channel@)[0-7]$":
    type: object
    description: Child node to describe a channel
    properties:
      reg:
        minimum: 0
        maximum: 7

      adi,mode:
        $ref: /schemas/types.yaml#/definitions/uint32
        enum: [0, 1, 2, 3, 8]
        description: |
          Mode or function of this channel.
          Macros specifying the valid values can be found in
          <dt-bindings/iio/adi,ad5592r.h>.

          The following values are currently supported:
          * CH_MODE_UNUSED (the pin is unused)
          * CH_MODE_ADC (the pin is ADC input)
          * CH_MODE_DAC (the pin is DAC output)
          * CH_MODE_DAC_AND_ADC (the pin is DAC output but can be monitored
            by an ADC, since there is no disadvantage this should be
            considered as the preferred DAC mode)
          * CH_MODE_GPIO (the pin is registered with GPIOLIB)

      adi,off-state:
        $ref: /schemas/types.yaml#/definitions/uint32
        enum: [0, 1, 2, 3]
        description: |
          State of this channel when unused or the device gets removed.
          Macros specifying the  valid values can be found in
          <dt-bindings/iio/adi,ad5592r.h>.
          * CH_OFFSTATE_PULLDOWN (the pin is pulled down)
          * CH_OFFSTATE_OUT_LOW  (the pin is output low)
          * CH_OFFSTATE_OUT_HIGH (the pin is output high)
          * CH_OFFSTATE_OUT_TRISTATE (the pin is tristated output)

    required:
      - reg
      - adi,mode

    additionalProperties: false

examples:
  - |
    #include <dt-bindings/iio/adi,ad5592r.h>
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        addac@0 {
            compatible = "adi,ad5592r";
            #size-cells = <0>;
            #address-cells = <1>;
            #gpio-cells = <2>;
            reg = <0>;

            spi-max-frequency = <1000000>;
            spi-cpol;

            vref-supply = <&vref>;
            reset-gpios = <&gpio0 86 0>;
            gpio-controller;

            channel@0 {
                reg = <0>;
                adi,mode = <CH_MODE_DAC>;
            };
            channel@1 {
                reg = <1>;
                adi,mode = <CH_MODE_ADC>;
            };
            channel@2 {
                reg = <2>;
                adi,mode = <CH_MODE_DAC_AND_ADC>;
            };
            channel@3 {
                reg = <3>;
                adi,mode = <CH_MODE_DAC_AND_ADC>;
                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
            };
            channel@4 {
                reg = <4>;
                adi,mode = <CH_MODE_UNUSED>;
                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
            };
            channel@5 {
                reg = <5>;
                adi,mode = <CH_MODE_GPIO>;
                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
            };
            channel@6 {
                reg = <6>;
                adi,mode = <CH_MODE_GPIO>;
                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
            };
            channel@7 {
                reg = <7>;
                adi,mode = <CH_MODE_GPIO>;
                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
            };
        };
        ad5593r@10 {
            compatible = "adi,ad5593r";
            #size-cells = <0>;
            #address-cells = <1>;
            #gpio-cells = <2>;
            reg = <0x10>;
            gpio-controller;

            channel@0 {
                reg = <0>;
                adi,mode = <CH_MODE_DAC>;
                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
            };
            channel@1 {
                reg = <1>;
                adi,mode = <CH_MODE_ADC>;
                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
            };
            channel@2 {
                reg = <2>;
                adi,mode = <CH_MODE_DAC_AND_ADC>;
                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
            };
            channel@6 {
                reg = <6>;
                adi,mode = <CH_MODE_GPIO>;
                adi,off-state = <CH_OFFSTATE_PULLDOWN>;
            };
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/adi,ad5624r.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD5624r and similar DACs

maintainers:
  - Jonathan Cameron <jic23@kernel.org>

properties:
  compatible:
    enum:
      - adi,ad5624r3
      - adi,ad5644r3
      - adi,ad5664r3
      - adi,ad5624r5
      - adi,ad5644r5
      - adi,ad5664r5

  reg:
    maxItems: 1

  vref-supply:
    description: If not present, internal reference will be used.

required:
  - compatible
  - reg

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#

unevaluatedProperties: false

examples:
  - |
    spi {
        #address-cells = <1>;
        #size-cells = <0>;
        dac@0 {
            reg = <0>;
            compatible = "adi,ad5624r3";
            vref-supply = <&vref>;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/adi,ad5686.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD5360 and similar DACs

maintainers:
  - Michael Hennerich <michael.hennerich@analog.com>
  - Jonathan Cameron <jic23@kernel.org>

properties:
  compatible:
    oneOf:
      - description: SPI devices
        enum:
          - adi,ad5310r
          - adi,ad5672r
          - adi,ad5674r
          - adi,ad5676
          - adi,ad5676r
          - adi,ad5679r
          - adi,ad5681r
          - adi,ad5682r
          - adi,ad5683
          - adi,ad5683r
          - adi,ad5684
          - adi,ad5684r
          - adi,ad5685r
          - adi,ad5686
          - adi,ad5686r
      - description: I2C devices
        enum:
          - adi,ad5311r
          - adi,ad5338r
          - adi,ad5671r
          - adi,ad5675r
          - adi,ad5691r
          - adi,ad5692r
          - adi,ad5693
          - adi,ad5693r
          - adi,ad5694
          - adi,ad5694r
          - adi,ad5695r
          - adi,ad5696
          - adi,ad5696r

  reg:
    maxItems: 1

  vcc-supply:
    description: If not supplied the internal reference is used.

required:
  - compatible
  - reg

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#

unevaluatedProperties: false

examples:
  - |
    spi {
        #address-cells = <1>;
        #size-cells = <0>;
        dac@0 {
            reg = <0>;
            compatible = "adi,ad5310r";
            vcc-supply = <&dac_vref0>;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/adi,ad5696.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD5696 and similar multi-channel DACs

maintainers:
  - Michael Auchter <michael.auchter@ni.com>

description: |
  Binding for Analog Devices AD5696 and similar multi-channel DACs

properties:
  compatible:
    enum:
      - adi,ad5311r
      - adi,ad5338r
      - adi,ad5671r
      - adi,ad5675r
      - adi,ad5691r
      - adi,ad5692r
      - adi,ad5693
      - adi,ad5693r
      - adi,ad5694
      - adi,ad5694r
      - adi,ad5695r
      - adi,ad5696
      - adi,ad5696r

  reg:
    maxItems: 1

  vcc-supply:
    description: |
      The regulator supply for DAC reference voltage.

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

      ad5696: dac@0 {
        compatible = "adi,ad5696";
        reg = <0>;
        vcc-supply = <&dac_vref>;
      };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/adi,ad5755.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD5755 Multi-Channel DAC

maintainers:
  - Sean Nyekjaer <sean.nyekjaer@prevas.dk>

properties:
  compatible:
    enum:
      - adi,ad5755
      - adi,ad5755-1
      - adi,ad5757
      - adi,ad5735
      - adi,ad5737

  reg:
    maxItems: 1

  spi-cpha:
    description: Either this or spi-cpol but not both.
  spi-cpol: true

  adi,ext-dc-dc-compenstation-resistor:
    $ref: /schemas/types.yaml#/definitions/flag
    description:
      Set if the hardware have an external resistor and thereby bypasses
      the internal compensation resistor.

  adi,dc-dc-phase:
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [0, 1, 2, 3]
    description: |
      Valid values for DC DC Phase control is:
      0: All dc-to-dc converters clock on the same edge.
      1: Channel A and Channel B clock on the same edge,
         Channel C and Channel D clock on opposite edges.
      2: Channel A and Channel C clock on the same edge,
         Channel B and Channel D clock on opposite edges.
      3: Channel A, Channel B, Channel C, and Channel D
         clock 90 degrees out of phase from each other.

  adi,dc-dc-freq-hz:
    enum: [250000, 410000, 650000]

  adi,dc-dc-max-microvolt:
    description:
      Maximum allowed Vboost voltage supplied by the dc-to-dc converter.
    enum: [23000000, 24500000, 27000000, 29500000]

  "#address-cells":
    const: 1

  "#size-cells":
    const: 0

  "#io-channel-cells":
    const: 1

required:
  - compatible
  - reg

patternProperties:
  "^channel@[0-7]$":
    type: object
    description: Child node to describe a channel
    properties:
      reg:
        maxItems: 1

      adi,mode:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 6
        description: |
          Valid values for DAC modes is:
          0: 0 V to 5 V voltage range.
          1: 0 V to 10 V voltage range.
          2: Plus minus 5 V voltage range.
          3: Plus minus 10 V voltage range.
          4: 4 mA to 20 mA current range.
          5: 0 mA to 20 mA current range.
          6: 0 mA to 24 mA current range.

      adi,ext-current-sense-resistor:
        $ref: /schemas/types.yaml#/definitions/flag
        description:
          Set if the hardware has an external current sense resistor

      adi,enable-voltage-overrange:
        $ref: /schemas/types.yaml#/definitions/flag
        description: Enable voltage overrange

      adi,slew:
        $ref: /schemas/types.yaml#/definitions/uint32-array
        description: |
          Array of slewrate settings should contain 3 fields:
          1: Should be either 0 or 1 in order to enable or disable slewrate.
          2: Slew rate update frequency
          3: Slew step size
        items:
          - enum: [0, 1]
          - enum: [64000, 32000, 16000, 8000, 4000, 2000, 1000, 500, 250, 125, 64, 32, 16, 8, 4, 0]
          - enum: [1, 2, 4, 16, 32, 64, 128, 256]

    required:
      - reg

    additionalProperties: false

oneOf:
  - required:
      - spi-cpha
  - required:
      - spi-cpol

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#

unevaluatedProperties: false

examples:
  - |
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        dac@0 {
            #address-cells = <1>;
            #size-cells = <0>;
            compatible = "adi,ad5755";
            reg = <0>;
            spi-max-frequency = <1000000>;
            spi-cpha;
            adi,dc-dc-phase = <0>;
            adi,dc-dc-freq-hz = <410000>;
            adi,dc-dc-max-microvolt = <23000000>;
            channel@0 {
                reg = <0>;
                adi,mode = <4>;
                adi,ext-current-sense-resistor;
                adi,slew = <0 64000 1>;
            };
            channel@1 {
                reg = <1>;
                adi,mode = <4>;
                adi,ext-current-sense-resistor;
                adi,slew = <0 64000 1>;
            };
            channel@2 {
                reg = <2>;
                adi,mode = <4>;
                adi,ext-current-sense-resistor;
                adi,slew = <0 64000 1>;
            };
            channel@3 {
                reg = <3>;
                adi,mode = <4>;
                adi,ext-current-sense-resistor;
                adi,slew = <0 64000 1>;
            };
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/adi,ad5758.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD5758 DAC

maintainers:
  - Michael Hennerich <Michael.Hennerich@analog.com>

properties:
  compatible:
    const: adi,ad5758

  reg:
    maxItems: 1

  spi-cpha: true

  adi,dc-dc-mode:
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [1, 2, 3]
    description: |
      Mode of operation of the dc-to-dc converter
      Dynamic Power Control (DPC)
      In this mode, the AD5758 circuitry senses the output voltage and
      dynamically regulates the supply voltage, VDPC+, to meet compliance
      requirements plus an optimized headroom voltage for the output buffer.

      Programmable Power Control (PPC)
      In this mode, the VDPC+ voltage is user-programmable to a fixed level
      that needs to accommodate the maximum output load required.

      The output of the DAC core is either converted to a current or
      voltage output at the VIOUT pin. Only one mode can be enabled at
      any one time.

      The following values are currently supported:
      * 1: DPC current mode
      * 2: DPC voltage mode
      * 3: PPC current mode

      Depending on the selected output mode (voltage or current) one of the
      two properties must be present:

  adi,range-microvolt:
    description: |
      Voltage output range specified as <minimum, maximum>
    oneOf:
      - items:
          - const: 0
          - enum: [5000000, 10000000]
      - items:
          - const: -5000000
          - const: 5000000
      - items:
          - const: -10000000
          - const: 10000000

  adi,range-microamp:
    description: |
      Current output range specified as <minimum, maximum>
    oneOf:
      - items:
          - const: 0
          - enum: [20000, 24000]
      - items:
          - const: 4
          - const: 24000
      - items:
          - const: -20000
          - const: 20000
      - items:
          - const: -24000
          - const: 24000
      - items:
          - const: -1000
          - const: 22000

  reset-gpios: true

  adi,dc-dc-ilim-microamp:
    enum: [150000, 200000, 250000, 300000, 350000, 400000]
    description: |
      The dc-to-dc converter current limit.

  adi,slew-time-us:
    description: |
      The time it takes for the output to reach the full scale [uS]
    minimum: 133
    maximum: 1023984375

required:
  - compatible
  - reg
  - spi-cpha
  - adi,dc-dc-mode

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#
  - if:
      properties:
        adi,dc-dc-mode:
          enum: [1, 3]
    then:
      properties:
        adi,range-microvolt: false
      required:
        - adi,range-microamp
    else:
      properties:
        adi,range-microamp: false
      required:
        - adi,range-microvolt

unevaluatedProperties: false

examples:
  - |
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        dac@0 {
            compatible = "adi,ad5758";
            reg = <0>;
            spi-max-frequency = <1000000>;
            spi-cpha;

            reset-gpios = <&gpio 22 0>;

            adi,dc-dc-mode = <2>;
            adi,range-microvolt = <0 10000000>;
            adi,dc-dc-ilim-microamp = <200000>;
            adi,slew-time-us = <125000>;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/adi,ad5761.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD5761 and similar DACs

maintainers:
  - Ricardo Ribalda <ribalda@kernel.org>
  - Jonathan Cameron <jic23@kernel.org>

properties:

  compatible:
    enum:
      - adi,ad5721
      - adi,ad5721r
      - adi,ad5761
      - adi,ad5761r

  reg:
    maxItems: 1

  vref-supply:
    description: If not supplied, internal reference will be used.

required:
  - compatible
  - reg

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#
  - if:
      properties:
        compatible:
          contains:
            enum:
              - adi,ad5721
              - adi,ad5761
    then:
      required:
        - vref-supply

unevaluatedProperties: false

examples:
  - |
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        dac@0 {
            compatible = "adi,ad5721";
            reg = <0>;
            vref-supply = <&dac_vref>;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/adi,ad5764.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD5744 and AD5764 DAC families

maintainers:
  - Lars-Peter Clausen <lars@metafoo.de>
  - Jonathan Cameron <jic23@kernel.org>

properties:

  compatible:
    enum:
      - adi,ad5744
      - adi,ad5744r
      - adi,ad5764
      - adi,ad5764r

  reg:
    maxItems: 1

  vrefAB-supply: true
  vrefCD-supply: true

required:
  - compatible
  - reg

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#
  - if:
      properties:
        compatible:
          contains:
            enum:
              - adi,ad5744
              - adi,ad5764
    then:
      required:
        - vrefAB-supply
        - vrefCD-supply

unevaluatedProperties: false

examples:
  - |
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        dac@0 {
            compatible = "adi,ad5744";
            reg = <0>;
            vrefAB-supply = <&dac_vref>;
            vrefCD-supply = <&dac_vref>;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
# Copyright 2020 Analog Devices Inc.
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/adi,ad5766.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD5766 DAC device driver

maintainers:
  - Nuno Sá <nuno.sa@analog.com>

description: |
  Bindings for the Analog Devices AD5766 current DAC device. Datasheet can be
  found here:
    https://www.analog.com/media/en/technical-documentation/data-sheets/ad5766-5767.pdf

properties:
  compatible:
    enum:
      - adi,ad5766
      - adi,ad5767

  output-range-microvolts:
    $ref: /schemas/types.yaml#/definitions/int32-array
    maxItems: 2
    description: Select converter output range.

  reg:
    maxItems: 1

  spi-max-frequency:
    maximum: 1000000

  spi-cpol: true

  reset-gpios:
    description: GPIO spec for the RESET pin. As the line is active low, it
      should be marked GPIO_ACTIVE_LOW.
    maxItems: 1

required:
  - compatible
  - output-range-microvolts
  - reg
  - spi-max-frequency
  - spi-cpol

additionalProperties: false

examples:
  - |
    spi {
          #address-cells = <1>;
          #size-cells = <0>;

          ad5766@0 {
              compatible = "adi,ad5766";
              output-range-microvolts = <(-5000000) 5000000>;
              reg = <0>;
              spi-cpol;
              spi-max-frequency = <1000000>;
              reset-gpios = <&gpio 22 0>;
            };
      };


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
# Copyright 2020 Analog Devices Inc.
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/adi,ad5770r.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD5770R DAC device driver

maintainers:
  - Alexandru Tachici <alexandru.tachici@analog.com>

description: |
  Bindings for the Analog Devices AD5770R current DAC device. Datasheet can be
  found here:
    https://www.analog.com/media/en/technical-documentation/data-sheets/AD5770R.pdf

properties:
  compatible:
    enum:
      - adi,ad5770r

  reg:
    maxItems: 1

  avdd-supply:
    description:
      AVdd voltage supply. Represents two different supplies in the datasheet
      that are in fact the same.

  iovdd-supply:
    description:
      Voltage supply for the chip interface.

  vref-supply:
    description: Specify the voltage of the external reference used.
      Available reference options are 1.25 V or 2.5 V. If no
      external reference declared then the device will use the
      internal reference of 1.25 V.

  adi,external-resistor:
    description: Specify if an external 2.5k ohm resistor is used. If not
      specified the device will use an internal 2.5k ohm resistor.
      The precision resistor is used for reference current generation.
    type: boolean

  reset-gpios:
    description: GPIO spec for the RESET pin. If specified, it will be
      asserted during driver probe.
    maxItems: 1

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

  channel@0:
    description: Represents an external channel which are
      connected to the DAC. Channel 0 can act both as a current
      source and sink.
    type: object
    additionalProperties: false

    properties:
      reg:
        description: This represents the channel number.
        const: 0

      adi,range-microamp:
        description: Output range of the channel.
        oneOf:
          - items:
              - const: 0
              - const: 300000
          - items:
              - const: -60000
              - const: 0
          - items:
              - const: -60000
              - const: 300000

  channel@1:
    description: Represents an external channel which are
      connected to the DAC.
    type: object
    additionalProperties: false

    properties:
      reg:
        description: This represents the channel number.
        const: 1

      adi,range-microamp:
        description: Output range of the channel.
        items:
          - const: 0
          - enum: [140000, 250000]

  channel@2:
    description: Represents an external channel which are
      connected to the DAC.
    type: object
    additionalProperties: false

    properties:
      reg:
        description: This represents the channel number.
        const: 2

      adi,range-microamp:
        description: Output range of the channel.
        items:
          - const: 0
          - enum: [55000, 150000]

patternProperties:
  "^channel@([3-5])$":
    type: object
    additionalProperties: false
    description: Represents the external channels which are connected to the DAC.
    properties:
      reg:
        description: This represents the channel number.
        minimum: 3
        maximum: 5

      adi,range-microamp:
        description: Output range of the channel.
        items:
          - const: 0
          - enum: [45000, 100000]

required:
  - reg
  - channel@0
  - channel@1
  - channel@2
  - channel@3
  - channel@4
  - channel@5

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#

unevaluatedProperties: false

examples:
  - |
        spi {
                #address-cells = <1>;
                #size-cells = <0>;

                ad5770r@0 {
                        compatible = "adi,ad5770r";
                        reg = <0>;
                        spi-max-frequency = <1000000>;
                        vref-supply = <&vref>;
                        adi,external-resistor;
                        reset-gpios = <&gpio 22 0>;
                        #address-cells = <1>;
                        #size-cells = <0>;

                        channel@0 {
                                reg = <0>;
                                adi,range-microamp = <0 300000>;
                        };

                        channel@1 {
                                reg = <1>;
                                adi,range-microamp = <0 140000>;
                        };

                        channel@2 {
                                reg = <2>;
                                adi,range-microamp = <0 55000>;
                        };

                        channel@3 {
                                reg = <3>;
                                adi,range-microamp = <0 45000>;
                        };

                        channel@4 {
                                reg = <4>;
                                adi,range-microamp = <0 45000>;
                        };

                        channel@5 {
                                reg = <5>;
                                adi,range-microamp = <0 45000>;
                        };
                };
        };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/adi,ad5791.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD5791 and similar DACs

maintainers:
  - Michael Hennerich <michael.hennerich@analog.com>
  - Jonathan Cameron <jic23@kernel.org>

properties:

  compatible:
    enum:
      - adi,ad5760
      - adi,ad5780
      - adi,ad5781
      - adi,ad5790
      - adi,ad5791

  reg:
    maxItems: 1

  vdd-supply: true
  vss-supply: true

required:
  - compatible
  - reg
  - vdd-supply
  - vss-supply

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#

unevaluatedProperties: false

examples:
  - |
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        dac@0 {
            compatible = "adi,ad5791";
            reg = <0>;
            vss-supply = <&dac_vss>;
            vdd-supply = <&dac_vdd>;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/adi,ad7293.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: AD7293 12-Bit Power Amplifier Current Controller with ADC,
       DACs, Temperature and Current Sensors

maintainers:
  - Antoniu Miclaus <antoniu.miclaus@analog.com>

description: |
   Power Amplifier drain current controller containing functionality
   for general-purpose monitoring and control of current, voltage,
   and temperature, integrated into a single chip solution with an
   SPI-compatible interface.

   https://www.analog.com/en/products/ad7293.html

properties:
  compatible:
    enum:
      - adi,ad7293

  avdd-supply: true

  vdrive-supply: true

  reset-gpios:
    maxItems: 1

  reg:
    maxItems: 1

  spi-max-frequency:
    maximum: 1000000

required:
  - compatible
  - reg
  - avdd-supply
  - vdrive-supply

additionalProperties: false

examples:
  - |
    spi {
      #address-cells = <1>;
      #size-cells = <0>;
      ad7293@0 {
        compatible = "adi,ad7293";
        reg = <0>;
        spi-max-frequency = <1000000>;
        avdd-supply = <&avdd>;
        vdrive-supply = <&vdrive>;
        reset-gpios = <&gpio 10 0>;
      };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/adi,ad7303.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD7303 DAC

maintainers:
  - Lars-Peter Clausen <lars@metafoo.de>

properties:
  compatible:
    const: adi,ad7303

  reg:
    maxItems: 1

  Vdd-supply:
    description:
      Used to calculate output channel scalling if REF-supply not specified.
  REF-supply:
    description:
      If not provided, Vdd/2 is used as the reference voltage.

  spi-max-frequency:
    maximum: 30000000

required:
  - compatible
  - reg
  - Vdd-supply

additionalProperties: false

examples:
  - |
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        dac@4 {
            compatible = "adi,ad7303";
            reg = <4>;
            spi-max-frequency = <10000000>;
            Vdd-supply = <&vdd_supply>;
            REF-supply = <&vref_supply>;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/adi,ad8801.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AD8801 and AD8803 DACs

maintainers:
  - Jonathan Cameron <jic23@kernel.org>

properties:

  compatible:
    enum:
      - adi,ad8801
      - adi,ad8803

  reg:
    maxItems: 1

  vrefh-supply: true
  vrefl-supply: true

required:
  - compatible
  - reg
  - vrefh-supply

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#
  - if:
      properties:
        compatible:
          contains:
            const: adi,ad8803
    then:
      required:
        - vrefl-supply
    else:
      properties:
        vrefl-supply: false

unevaluatedProperties: false

examples:
  - |
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        dac@0 {
            compatible = "adi,ad8803";
            reg = <0>;
            vrefl-supply = <&dac_vrefl>;
            vrefh-supply = <&dac_vrefh>;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/adi,ltc2688.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices LTC2688 DAC

maintainers:
  - Nuno Sá <nuno.sa@analog.com>

description: |
  Analog Devices LTC2688 16 channel, 16 bit, +-15V DAC
  https://www.analog.com/media/en/technical-documentation/data-sheets/ltc2688.pdf

properties:
  compatible:
    enum:
      - adi,ltc2688

  reg:
    maxItems: 1

  vcc-supply:
    description: Analog Supply Voltage Input.

  iovcc-supply:
    description: Digital Input/Output Supply Voltage.

  vref-supply:
    description:
      Reference Input/Output. The voltage at the REF pin sets the full-scale
      range of all channels. If not provided the internal reference is used and
      also provided on the VREF pin".

  clr-gpios:
    description:
      If specified, it will be asserted during driver probe. As the line is
      active low, it should be marked GPIO_ACTIVE_LOW.
    maxItems: 1

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

patternProperties:
  "^channel@([0-9]|1[0-5])$":
    type: object
    additionalProperties: false

    properties:
      reg:
        description: The channel number representing the DAC output channel.
        maximum: 15

      adi,toggle-mode:
        description:
          Set the channel as a toggle enabled channel. Toggle operation enables
          fast switching of a DAC output between two different DAC codes without
          any SPI transaction.
        type: boolean

      adi,output-range-microvolt:
        description: Specify the channel output full scale range.
        oneOf:
          - items:
              - const: 0
              - enum: [5000000, 10000000]
          - items:
              - const: -5000000
              - const: 5000000
          - items:
              - const: -10000000
              - const: 10000000
          - items:
              - const: -15000000
              - const: 15000000

      adi,overrange:
        description: Enable 5% overrange over the selected full scale range.
        type: boolean

      clocks:
        maxItems: 1

      adi,toggle-dither-input:
        description:
          Selects the TGPx pin to be associated with this channel. This setting
          only makes sense for toggle or dither enabled channels. If
          @adi,toggle-mode is not set and this property is given, the channel is
          assumed to be a dither capable channel. Note that multiple channels
          can be mapped to the same pin. If this setting is given, the
          respective @clock must also be provided. Mappings between this and
          input pins
            0 - TGP1
            1 - TGP2
            2 - TGP3
        $ref: /schemas/types.yaml#/definitions/uint32
        enum: [0, 1, 2]

    dependencies:
      adi,toggle-dither-input: [ clocks ]

    required:
      - reg

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |

    spi {
          #address-cells = <1>;
          #size-cells = <0>;
          ltc2688: ltc2688@0 {
                  compatible = "adi,ltc2688";
                  reg = <0>;

                  vcc-supply = <&vcc>;
                  iovcc-supply = <&vcc>;
                  vref-supply = <&vref>;

                  #address-cells = <1>;
                  #size-cells = <0>;
                  channel@0 {
                          reg = <0>;
                          adi,toggle-mode;
                          adi,overrange;
                  };

                  channel@1 {
                          reg = <1>;
                          adi,output-range-microvolt = <0 10000000>;

                          clocks = <&clock_tgp3>;
                          adi,toggle-dither-input = <2>;
                  };
          };
    };

...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/dpot-dac.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: DAC emulation using a digital potentiometer

maintainers:
  - Peter Rosin <peda@axentia.se>

description: |
  It is assumed that the dpot is used as a voltage divider between the
  current dpot wiper setting and the maximum resistance of the dpot. The
  divided voltage is provided by a vref regulator.

                  .------.
   .-----------.  |      |
   | vref      |--'    .---.
   | regulator |--.    |   |
   '-----------'  |    | d |
                  |    | p |
                  |    | o |  wiper
                  |    | t |<---------+
                  |    |   |
                  |    '---'       dac output voltage
                  |      |
                  '------+------------+

properties:
  compatible:
    const: dpot-dac

  vref-supply:
    description: Regulator supplying the voltage divider.

  io-channels:
    maxItems: 1
    description: |
      Channel node of the dpot to be used for the voltage division.

  io-channel-names:
    const: dpot

  "#io-channel-cells":
    const: 1

required:
  - compatible
  - vref-supply
  - io-channels
  - io-channel-names

additionalProperties: false

examples:
  - |
    dac {
        compatible = "dpot-dac";
        vref-supply = <&reg_3v3>;
        io-channels = <&dpot 0>;
        io-channel-names = "dpot";
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/fsl,vf610-dac.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Freescale vf610 Digital to Analog Converter

maintainers:
  - Sanchayan Maity <maitysanchayan@gmail.com>

properties:
  compatible:
    const: fsl,vf610-dac

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    maxItems: 1

  clock-names:
    const: dac

required:
  - compatible
  - reg
  - interrupts
  - clocks
  - clock-names

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    #include <dt-bindings/clock/vf610-clock.h>
    bus@40000000 {
        compatible = "fsl,aips-bus", "simple-bus";
        reg = <0x40000000 0x00070000>;
        ranges;
        #address-cells = <1>;
        #size-cells = <1>;
        dac@400cc000 {
            compatible = "fsl,vf610-dac";
            reg = <0x400cc000 0x1000>;
            interrupts = <55 IRQ_TYPE_LEVEL_HIGH>;
            clock-names = "dac";
            clocks = <&clks VF610_CLK_DAC0>;
        };
    };
...


code:
# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
# Copyright 2019 Marcus Folkesson <marcus.folkesson@gmail.com>
%YAML 1.2
---
$id: "http://devicetree.org/schemas/iio/dac/lltc,ltc1660.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"

title: Linear Technology Micropower octal 8-Bit and 10-Bit DACs

maintainers:
  - Marcus Folkesson <marcus.folkesson@gmail.com>

description: |
  Bindings for the Linear Technology Micropower octal 8-Bit and 10-Bit DAC.
  Datasheet can be found here: https://www.analog.com/media/en/technical-documentation/data-sheets/166560fa.pdf

properties:
  compatible:
    enum:
      - lltc,ltc1660
      - lltc,ltc1665

  reg:
    maxItems: 1

  spi-max-frequency:
    maximum: 5000000

  vref-supply:
    description: Phandle to the external reference voltage supply.

required:
  - compatible
  - reg
  - vref-supply

additionalProperties: false

examples:
  - |
    spi {
      #address-cells = <1>;
      #size-cells = <0>;

      dac@0 {
        compatible = "lltc,ltc1660";
        reg = <0>;
        spi-max-frequency = <5000000>;
        vref-supply = <&vref_reg>;
      };
    };


code:
# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
%YAML 1.2
---
$id: "http://devicetree.org/schemas/iio/dac/lltc,ltc2632.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"

title: Linear Technology LTC263x 12-/10-/8-Bit Rail-to-Rail DAC

maintainers:
  - Michael Hennerich <michael.hennerich@analog.com>

description: |
  Bindings for the Linear Technology LTC2632/2634/2636 DAC
  Datasheet can be found here: https://www.analog.com/media/en/technical-documentation/data-sheets/LTC263[246].pdf

properties:
  compatible:
    enum:
      - lltc,ltc2632-l12
      - lltc,ltc2632-l10
      - lltc,ltc2632-l8
      - lltc,ltc2632-h12
      - lltc,ltc2632-h10
      - lltc,ltc2632-h8
      - lltc,ltc2634-l12
      - lltc,ltc2634-l10
      - lltc,ltc2634-l8
      - lltc,ltc2634-h12
      - lltc,ltc2634-h10
      - lltc,ltc2634-h8
      - lltc,ltc2636-l12
      - lltc,ltc2636-l10
      - lltc,ltc2636-l8
      - lltc,ltc2636-h12
      - lltc,ltc2636-h10
      - lltc,ltc2636-h8

  reg:
    maxItems: 1

  spi-max-frequency:
    maximum: 2000000

  vref-supply:
    description:
      Phandle to the external reference voltage supply. This should
      only be set if there is an external reference voltage connected to the VREF
      pin. If the property is not set the internal reference is used.

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    vref: regulator-vref {
        compatible = "regulator-fixed";
        regulator-name = "vref-ltc2632";
        regulator-min-microvolt = <1250000>;
        regulator-max-microvolt = <1250000>;
        regulator-always-on;
    };

    spi {
      #address-cells = <1>;
      #size-cells = <0>;

      dac@0 {
        compatible = "lltc,ltc2632-l12";
        reg = <0>;    /* CS0 */
        spi-max-frequency = <1000000>;
        vref-supply = <&vref>;
      };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/maxim,ds4424.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Maxim Integrated DS4422/DS4424 7-bit Sink/Source Current DAC

maintainers:
  - Ismail Kose <ihkose@gmail.com>

description: |
  Datasheet publicly available at:
  https://datasheets.maximintegrated.com/en/ds/DS4422-DS4424.pdf

properties:
  compatible:
    enum:
      - maxim,ds4422
      - maxim,ds4424

  reg:
    maxItems: 1

  vcc-supply: true

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        dac@10 {
            compatible = "maxim,ds4424";
            reg = <0x10>; /* When A0, A1 pins are ground */
            vcc-supply = <&vcc_3v3>;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/maxim,max5821.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Maxim max5821 dual 10-bit DAC

maintainers:
  - Philippe Reynes <tremyfr@yahoo.fr>

description: |
  Datasheet publicly available at:
  https://datasheets.maximintegrated.com/en/ds/MAX5821.pdf

properties:
  compatible:
    const: maxim,max5821

  reg:
    maxItems: 1

  vref-supply: true

required:
  - compatible
  - reg
  - vref-supply

additionalProperties: false

examples:
  - |
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        dac@38 {
            compatible = "maxim,max5821";
            reg = <0x38>;
            vref-supply = <&reg_max5821>;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/microchip,mcp4725.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Microchip mcp4725 and mcp4726 DAC

maintainers:
  - Tomas Novotny <tomas@novotny.cz>

properties:
  compatible:
    enum:
      - microchip,mcp4725
      - microchip,mcp4726

  reg:
    maxItems: 1

  vdd-supply:
    description: |
      Provides both power and acts as the reference supply on the mcp4725.
      For the mcp4726 it will be used as the reference voltage if vref-supply
      is not provided.

  vref-supply:
    description:
      Vref pin is used as a voltage reference when this supply is specified.

  microchip,vref-buffered:
    type: boolean
    description: |
      Enable buffering of the external Vref pin. This boolean is not valid
      without the vref-supply. Quoting the datasheet: This is offered in
      cases where the reference voltage does not have the current
      capability not to drop its voltage when connected to the internal
      resistor ladder circuit.

allOf:
  - if:
      properties:
        compatible:
          contains:
            const: microchip,mcp4725
    then:
      properties:
        vref-supply: false
      required:
        - vdd-supply

  - if:
      properties:
        compatible:
          contains:
            const: microchip,mcp4726
    then:
      anyOf:
        - required:
            - vdd-supply
        - required:
            - vref-supply

  - if:
      not:
        required:
          - vref-supply
    then:
      properties:
        microchip,vref-buffered: false

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        mcp4725@60 {
            compatible = "microchip,mcp4725";
            reg = <0x60>;
            vdd-supply = <&vdac_vdd>;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/microchip,mcp4922.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Microchip MCP4902, MCP4912 and MPC4922 dual output SPI DACs

maintainers:
  - Jonathan Cameron <jic23@kernel.org>
  - Michael Welling <mwelling@ieee.org>

properties:
  compatible:
    enum:
      - microchip,mcp4902
      - microchip,mcp4912
      - microchip,mcp4921
      - microchip,mcp4922

  reg:
    maxItems: 1

  vref-supply: true

required:
  - compatible
  - reg
  - vref-supply

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#

unevaluatedProperties: false

examples:
  - |
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        dac@0 {
            compatible = "microchip,mcp4912";
            reg = <0>;
            vref-supply = <&dac_vref>;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/nxp,lpc1850-dac.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: NXP LPC1850 DAC bindings

maintainers:
  - Jonathan Cameron <jic23@kernel.org>

description:
  Supports the DAC found on the LPC1850 SoC.

properties:
  compatible:
    const: nxp,lpc1850-dac

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    maxItems: 1

  vref-supply: true

  resets:
    maxItems: 1

required:
  - compatible
  - reg
  - interrupts
  - clocks
  - vref-supply
  - resets

additionalProperties: false

examples:
  - |
    #include <dt-bindings/clock/lpc18xx-ccu.h>
    soc {
        #address-cells = <1>;
        #size-cells = <1>;
        dac: dac@400e1000 {
            compatible = "nxp,lpc1850-dac";
            reg = <0x400e1000 0x1000>;
            interrupts = <0>;
            clocks = <&ccu1 CLK_APB3_DAC>;
            vref-supply = <&reg_vdda>;
            resets = <&rgu 42>;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: "http://devicetree.org/schemas/iio/dac/st,stm32-dac.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"

title: STMicroelectronics STM32 DAC bindings

description: |
  The STM32 DAC is a 12-bit voltage output digital-to-analog converter. The DAC
  may be configured in 8 or 12-bit mode. It has two output channels, each with
  its own converter.
  It has built-in noise and triangle waveform generator and supports external
  triggers for conversions. The DAC's output buffer allows a high drive output
  current.

maintainers:
  - Fabrice Gasnier <fabrice.gasnier@foss.st.com>

properties:
  compatible:
    enum:
      - st,stm32f4-dac-core
      - st,stm32h7-dac-core

  reg:
    maxItems: 1

  resets:
    maxItems: 1

  clocks:
    maxItems: 1

  clock-names:
    items:
      - const: pclk

  vref-supply:
    description: Phandle to the vref input analog reference voltage.

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

additionalProperties: false

required:
  - compatible
  - reg
  - clocks
  - clock-names
  - vref-supply
  - '#address-cells'
  - '#size-cells'

patternProperties:
  "^dac@[1-2]+$":
    type: object
    description:
      A DAC block node should contain at least one subnode, representing an
      DAC instance/channel available on the machine.

    properties:
      compatible:
        const: st,stm32-dac

      reg:
        description: Must be either 1 or 2, to define (single) channel in use
        enum: [1, 2]

      '#io-channel-cells':
        const: 1

    additionalProperties: false

    required:
      - compatible
      - reg
      - '#io-channel-cells'

examples:
  - |
    // Example on stm32mp157c
    #include <dt-bindings/clock/stm32mp1-clks.h>
    dac: dac@40017000 {
      compatible = "st,stm32h7-dac-core";
      reg = <0x40017000 0x400>;
      clocks = <&rcc DAC12>;
      clock-names = "pclk";
      vref-supply = <&vref>;
      #address-cells = <1>;
      #size-cells = <0>;

      dac@1 {
        compatible = "st,stm32-dac";
        #io-channel-cells = <1>;
        reg = <1>;
      };

      dac@2 {
        compatible = "st,stm32-dac";
        #io-channel-cells = <1>;
        reg = <2>;
      };
    };

...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/ti,dac082s085.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Texas Instruments DAC082s085 and similar DACs

description:
  A family of Texas Instruments 8/10/12-bit 2/4-channel DACs

maintainers:
  - Lukas Wunner <lukas@wunner.de>

properties:
  compatible:
    enum:
      - ti,dac082s085
      - ti,dac102s085
      - ti,dac122s085
      - ti,dac084s085
      - ti,dac104s085
      - ti,dac124s085

  reg:
    maxItems: 1

  spi-cpha: true
  spi-cpol:
    description:
      Must be either spi-cpha, or spi-cpol but not both.

  vref-supply:
    description: Needed to provide output scaling.

required:
  - compatible
  - reg
  - vref-supply

oneOf:
  - required:
      - spi-cpha
  - required:
      - spi-cpol

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#

unevaluatedProperties: false

examples:
  - |
    vref_2v5_reg: regulator-vref {
        compatible = "regulator-fixed";
        regulator-name = "2v5";
        regulator-min-microvolt = <2500000>;
        regulator-max-microvolt = <2500000>;
        regulator-always-on;
    };
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        dac@0 {
            compatible = "ti,dac082s085";
            reg = <0>;
            spi-max-frequency = <40000000>;
            spi-cpol;
            vref-supply = <&vref_2v5_reg>;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/ti,dac5571.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Texas Instruments DAC5571 Family

maintainers:
  - Sean Nyekjaer <sean@geanix.com>

properties:
  compatible:
    enum:
      - ti,dac5571
      - ti,dac6571
      - ti,dac7571
      - ti,dac5574
      - ti,dac6574
      - ti,dac7574
      - ti,dac5573
      - ti,dac6573
      - ti,dac7573
      - ti,dac121c081

  reg:
    maxItems: 1

  vref-supply:
    description:
      Reference voltage must be supplied to establish the scaling of the
      output voltage.

required:
  - compatible
  - reg
  - vref-supply

additionalProperties: false

examples:
  - |
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        dac@4c {
            compatible = "ti,dac5571";
            reg = <0x4C>;
            vref-supply = <&vdd_supply>;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/ti,dac7311.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Texas Instruments DAC5311 and similar SPI DACs

maintainers:
  - Charles-Antoine Couret <charles-antoine.couret@essensium.com>

properties:
  compatible:
    enum:
      - ti,dac7311
      - ti,dac6311
      - ti,dac5311

  reg:
    maxItems: 1

  vref-supply:
    description:
      Reference voltage must be supplied to establish the scaling of the
      output voltage.

required:
  - compatible
  - reg
  - vref-supply

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#

unevaluatedProperties: false

examples:
  - |
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        dac@0 {
            compatible = "ti,dac7311";
            reg = <0>; /* CS0 */
            spi-max-frequency = <1000000>;
            vref-supply = <&vdd_supply>;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/ti,dac7512.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Texas Instruments DAC7512 DAC

maintainers:
  - Jonathan Cameron <jic23@kernel.org>

properties:
  compatible:
    const: ti,dac7512

  reg:
    maxItems: 1

  spi-max-frequency:
    description:
      Maximum frequency is reduced for supply voltage of less than 3.6V
    maximum: 30000000

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        dac@0 {
            compatible = "ti,dac7512";
            reg = <0>; /* CS0 */
            spi-max-frequency = <1000000>;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/ti,dac7612.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Texas Instruments DAC7612 family of DACs

description:
  The DAC7612 is a dual, 12-bit digital-to-analog converter (DAC) with
  guaranteed 12-bit monotonicity performance over the industrial temperature
  range. Is is programmable through an SPI interface.

maintainers:
  - Ricardo Ribalda Delgado <ricardo@ribalda.com>

properties:
  compatible:
    enum:
      - ti,dac7612
      - ti,dac7612u
      - ti,dac7612ub

  reg:
    maxItems: 1

  ti,loaddacs-gpios:
    description:
      DACs are loaded when the pin connected to this GPIO is pulled low.
    maxItems: 1

required:
  - compatible
  - reg

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        dac@1 {
            compatible = "ti,dac7612";
            reg = <0x1>;
            ti,loaddacs-gpios = <&msmgpio 25 GPIO_ACTIVE_LOW>;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/filter/adi,admv8818.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: ADMV8818 Digitally Tunable, High-Pass and Low-Pass Filter

maintainers:
  - Antoniu Miclaus <antoniu.miclaus@analog.com>

description: |
    Fully monolithic microwave integrated circuit (MMIC) that
    features a digitally selectable frequency of operation.
    The device features four independently controlled high-pass
    filters (HPFs) and four independently controlled low-pass filters
    (LPFs) that span the 2 GHz to 18 GHz frequency range.

    https://www.analog.com/en/products/admv8818.html

properties:
  compatible:
    enum:
      - adi,admv8818

  reg:
    maxItems: 1

  spi-max-frequency:
    maximum: 10000000

  clocks:
    description:
      Definition of the external clock.
    minItems: 1

  clock-names:
    items:
      - const: rf_in

  clock-output-names:
    maxItems: 1

  '#clock-cells':
    const: 0

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    spi {
      #address-cells = <1>;
      #size-cells = <0>;
      admv8818@0 {
        compatible = "adi,admv8818";
        reg = <0>;
        spi-max-frequency = <10000000>;
        clocks = <&admv8818_rfin>;
        clock-names = "rf_in";
      };
    };
...


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/frequency/adf4371.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices ADF4371/ADF4372 Wideband Synthesizers

maintainers:
  - Popa Stefan <stefan.popa@analog.com>

description: |
  Analog Devices ADF4371/ADF4372 SPI Wideband Synthesizers
  https://www.analog.com/media/en/technical-documentation/data-sheets/adf4371.pdf
  https://www.analog.com/media/en/technical-documentation/data-sheets/adf4372.pdf

properties:
  compatible:
    enum:
      - adi,adf4371
      - adi,adf4372

  reg:
    maxItems: 1

  clocks:
    description:
      Definition of the external clock (see clock/clock-bindings.txt)
    maxItems: 1

  clock-names:
    description:
      Must be "clkin"
    maxItems: 1

  adi,mute-till-lock-en:
    type: boolean
    description:
      If this property is present, then the supply current to RF8P and RF8N
      output stage will shut down until the ADF4371/ADF4372 achieves lock as
      measured by the digital lock detect circuitry.

required:
  - compatible
  - reg
  - clocks
  - clock-names

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#

unevaluatedProperties: false

examples:
  - |
    spi0 {
        #address-cells = <1>;
        #size-cells = <0>;

        frequency@0 {
                compatible = "adi,adf4371";
                reg = <0>;
                spi-max-frequency = <1000000>;
                clocks = <&adf4371_clkin>;
                clock-names = "clkin";
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/frequency/adi,adf4350.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices ADF4350/ADF4351 wideband synthesizer

maintainers:
  - Michael Hennerich <michael.hennerich@analog.com>

properties:
  compatible:
    enum:
      - adi,adf4350
      - adi,adf4351

  reg:
    maxItems: 1

  spi-max-frequency:
    maximum: 20000000

  clocks:
    maxItems: 1
    description: Clock to provide CLKIN reference clock signal.

  clock-names:
    const: clkin

  gpios:
    maxItems: 1
    description: Lock detect GPIO.

  adi,channel-spacing:
    $ref: /schemas/types.yaml#/definitions/uint32
    description:
      Channel spacing in Hz (influences MODULUS).

  adi,power-up-frequency:
    $ref: /schemas/types.yaml#/definitions/uint32
    description:
      If set the PLL tunes to this frequency (in Hz) on driver probe.

  adi,reference-div-factor:
    $ref: /schemas/types.yaml#/definitions/uint32
    description:
      If set the driver skips dynamic calculation and uses this default
      value instead.

  adi,reference-doubler-enable:
    $ref: /schemas/types.yaml#/definitions/flag
    description: Enables reference doubler.

  adi,reference-div2-enable:
    $ref: /schemas/types.yaml#/definitions/flag
    description: Enables reference divider.

  adi,phase-detector-polarity-positive-enable:
    $ref: /schemas/types.yaml#/definitions/flag
    description: Enables positive phase detector polarity. Default negative.

  adi,lock-detect-precision-6ns-enable:
    $ref: /schemas/types.yaml#/definitions/flag
    description: Enables 6ns lock detect precision. Default = 10ns.

  adi,lock-detect-function-integer-n-enable:
    $ref: /schemas/types.yaml#/definitions/flag
    description:
      Enables lock detect for integer-N mode. Default = factional-N mode.

  adi,charge-pump-current:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Charge pump current in mA. Default = 2500mA.

  adi,muxout-select:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 0
    maximum: 6
    description: |
      On chip multiplexer output selection.
      Valid values for the multiplexer output are:
      0: Three-State Output (default)
      1: DVDD
      2: DGND
      3: R-Counter output
      4: N-Divider output
      5: Analog lock detect
      6: Digital lock detect

  adi,low-spur-mode-enable:
    $ref: /schemas/types.yaml#/definitions/flag
    description: Enables low spur mode. Default = Low noise mode.

  adi,cycle-slip-reduction-enable:
    $ref: /schemas/types.yaml#/definitions/flag
    description: Enables cycle slip reduction.

  adi,charge-cancellation-enable:
    $ref: /schemas/types.yaml#/definitions/flag
    description:
      Enabled charge pump charge cancellation for integer-N modes.

  adi,anti-backlash-3ns-enable:
    $ref: /schemas/types.yaml#/definitions/flag
    description:
      Enables 3ns antibacklash pulse width for integer-N modes.

  adi,band-select-clock-mode-high-enable:
    $ref: /schemas/types.yaml#/definitions/flag
    description: Enables faster band selection logic.

  adi,12bit-clk-divider:
    $ref: /schemas/types.yaml#/definitions/uint32
    description:
      Clock divider value used when adi,12bit-clkdiv-mode != 0

  adi,clk-divider-mode:
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [0, 1, 2]
    description: |
      Valid values for the clkdiv mode are:
      0: Clock divider off (default)
      1: Fast lock enable
      2: Phase resync enable

  adi,aux-output-enable:
    $ref: /schemas/types.yaml#/definitions/flag
    description: Enables auxiliary RF output.

  adi,aux-output-fundamental-enable:
    $ref: /schemas/types.yaml#/definitions/flag
    description: |
      Selects fundamental VCO output on the auxiliary RF output.
      Default = Output of RF dividers.

  adi,mute-till-lock-enable:
    $ref: /schemas/types.yaml#/definitions/flag
    description: Enables Mute-Till-Lock-Detect function.

  adi,output-power:
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [0, 1, 2, 3]
    description: |
      Output power selection.
      Valid values for the power mode are:
      0: -4dBm (default)
      1: -1dBm
      2: +2dBm
      3: +5dBm

  adi,aux-output-power:
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [0, 1, 2, 3]
    description: |
      Auxiliary output power selection.
      Valid values for the power mode are:
      0: -4dBm (default)
      1: -1dBm
      2: +2dBm
      3: +5dBm

required:
  - compatible
  - reg
  - clocks

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#

unevaluatedProperties: false

examples:
  - |
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        pll@4 {
            compatible = "adi,adf4351";
            reg = <4>;
            spi-max-frequency = <10000000>;
            clocks = <&clk0_ad9523 9>;
            clock-names = "clkin";
            adi,channel-spacing = <10000>;
            adi,power-up-frequency = <2400000000>;
            adi,phase-detector-polarity-positive-enable;
            adi,charge-pump-current = <2500>;
            adi,output-power = <3>;
            adi,mute-till-lock-enable;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/frequency/adi,adf4377.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: ADF4377 Microwave Wideband Synthesizer with Integrated VCO

maintainers:
  - Antoniu Miclaus <antoniu.miclaus@analog.com>
  - Dragos Bogdan <dragos.bogdan@analog.com>

description: |
   The ADF4377 is a high performance, ultralow jitter, dual output integer-N
   phased locked loop (PLL) with integrated voltage controlled oscillator (VCO)
   ideally suited for data converter and mixed signal front end (MxFE) clock
   applications.

   https://www.analog.com/en/products/adf4377.html

properties:
  compatible:
    enum:
      - adi,adf4377
      - adi,adf4378

  reg:
    maxItems: 1

  spi-max-frequency:
    maximum: 10000000

  clocks:
    maxItems: 1

  clock-names:
    description:
      External clock that provides reference input frequency.
    items:
      - const: ref_in

  chip-enable-gpios:
    description:
      GPIO that controls the Chip Enable Pin.
    maxItems: 1

  clk1-enable-gpios:
    description:
      GPIO that controls the Enable Clock 1 Output Buffer Pin.
    maxItems: 1

  clk2-enable-gpios:
    description:
      GPIO that controls the Enable Clock 2 Output Buffer Pin.
    maxItems: 1

  adi,muxout-select:
    description:
      On chip multiplexer output selection.
      high_z - MUXOUT Pin set to high-Z.
      lock_detect - MUXOUT Pin set to lock detector output.
      muxout_low - MUXOUT Pin set to low.
      f_div_rclk_2 - MUXOUT Pin set to fDIV_RCLK/2.
      f_div_nclk_2 - MUXOUT Pin set to fDIV_NCLK/2.
      muxout_high - MUXOUT Pin set to high.
    enum: [high_z, lock_detect, muxout_low, f_div_rclk_2, f_div_nclk_2, muxout_high]

required:
  - compatible
  - reg
  - clocks
  - clock-names

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#

unevaluatedProperties: false

examples:
  - |
    spi {
        #address-cells = <1>;
        #size-cells = <0>;
        frequency@0 {
            compatible = "adi,adf4377";
            reg = <0>;
            spi-max-frequency = <10000000>;
            clocks = <&adf4377_ref_in>;
            clock-names = "ref_in";
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/frequency/adi,admv1013.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: ADMV1013 Microwave Upconverter

maintainers:
  - Antoniu Miclaus <antoniu.miclaus@analog.com>

description: |
   Wideband, microwave upconverter optimized for point to point microwave
   radio designs operating in the 24 GHz to 44 GHz frequency range.

   https://www.analog.com/en/products/admv1013.html

properties:
  compatible:
    enum:
      - adi,admv1013

  reg:
    maxItems: 1

  spi-max-frequency:
    maximum: 1000000

  clocks:
    description:
      Definition of the external clock.
    minItems: 1

  clock-names:
    items:
      - const: lo_in

  vcm-supply:
    description:
      Analog voltage regulator.

  adi,detector-enable:
    description:
      Enable the Envelope Detector available at output pins VENV_P and
      VENV_N. Disable to reduce power consumption.
    type: boolean

  adi,input-mode:
    description:
      Select the input mode.
      iq - in-phase quadrature (I/Q) input
      if - complex intermediate frequency (IF) input
    enum: [iq, if]

  adi,quad-se-mode:
    description:
      Switch the LO path from differential to single-ended operation.
      se-neg - Single-Ended Mode, Negative Side Disabled.
      se-pos - Single-Ended Mode, Positive Side Disabled.
      diff - Differential Mode.
    enum: [se-neg, se-pos, diff]

  '#clock-cells':
    const: 0

required:
  - compatible
  - reg
  - clocks
  - clock-names
  - vcm-supply

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#

unevaluatedProperties: false

examples:
  - |
    spi {
      #address-cells = <1>;
      #size-cells = <0>;
      admv1013@0{
        compatible = "adi,admv1013";
        reg = <0>;
        spi-max-frequency = <1000000>;
        clocks = <&admv1013_lo>;
        clock-names = "lo_in";
        vcm-supply = <&vcm>;
        adi,quad-se-mode = "diff";
        adi,detector-enable;
      };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/frequency/adi,admv1014.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: ADMV1014 Microwave Downconverter

maintainers:
  - Antoniu Miclaus <antoniu.miclaus@analog.com>

description: |
   Wideband, microwave downconverter optimized for point to point microwave
   radio designs operating in the 24 GHz to 44 GHz frequency range.

   https://www.analog.com/en/products/admv1014.html

properties:
  compatible:
    enum:
      - adi,admv1014

  reg:
    maxItems: 1

  spi-max-frequency:
    maximum: 1000000

  clocks:
    maxItems: 1

  clock-names:
    items:
      - const: lo_in
    description:
      External clock that provides the Local Oscilator input.

  vcm-supply:
    description:
      Common-mode voltage regulator.

  vcc-if-bb-supply:
    description:
      BB and IF supply voltage regulator.

  vcc-vga-supply:
    description:
      RF Amplifier supply voltage regulator.

  vcc-vva-supply:
    description:
      VVA Control Circuit supply voltage regulator.

  vcc-lna-3p3-supply:
    description:
      Low Noise Amplifier 3.3V supply voltage regulator.

  vcc-lna-1p5-supply:
    description:
      Low Noise Amplifier 1.5V supply voltage regulator.

  vcc-bg-supply:
    description:
      Band Gap Circuit supply voltage regulator.

  vcc-quad-supply:
    description:
      Quadruple supply voltage regulator.

  vcc-mixer-supply:
    description:
      Mixer supply voltage regulator.

  adi,input-mode:
    description:
      Select the input mode.
      iq - in-phase quadrature (I/Q) input
      if - complex intermediate frequency (IF) input
    enum: [iq, if]

  adi,detector-enable:
    description:
      Digital Rx Detector Enable. The Square Law Detector output is
      available at output pin VDET.
    type: boolean

  adi,p1db-compensation-enable:
    description:
      Turn on bits to optimize P1dB.
    type: boolean

  adi,quad-se-mode:
    description:
      Switch the LO path from differential to single-ended operation.
      se-neg - Single-Ended Mode, Negative Side Disabled.
      se-pos - Single-Ended Mode, Positive Side Disabled.
      diff - Differential Mode.
    enum: [se-neg, se-pos, diff]

required:
  - compatible
  - reg
  - clocks
  - clock-names
  - vcm-supply

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#

unevaluatedProperties: false

examples:
  - |
    spi {
      #address-cells = <1>;
      #size-cells = <0>;
      converter@0 {
        compatible = "adi,admv1014";
        reg = <0>;
        spi-max-frequency = <1000000>;
        clocks = <&admv1014_lo>;
        clock-names = "lo_in";
        vcm-supply = <&vcm>;
        vcc-if-bb-supply = <&vcc_if_bb>;
        vcc-vga-supply = <&vcc_vga>;
        vcc-vva-supply = <&vcc_vva>;
        vcc-lna-3p3-supply = <&vcc_lna_3p3>;
        vcc-lna-1p5-supply = <&vcc_lna_1p5>;
        vcc-bg-supply = <&vcc_bg>;
        vcc-quad-supply = <&vcc_quad>;
        vcc-mixer-supply = <&vcc_mixer>;
        adi,quad-se-mode = "diff";
        adi,detector-enable;
        adi,p1db-compensation-enable;
      };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/frequency/adi,admv4420.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: ADMV4420 K Band Downconverter

maintainers:
  - Nuno Sá <nuno.sa@analog.com>

description:
  The ADMV4420 is a highly integrated, double balanced, active
  mixer with an integrated fractional-N synthesizer, ideally suited
  for next generation K band satellite communications

properties:
  compatible:
    enum:
      - adi,admv4420

  reg:
    maxItems: 1

  spi-max-frequency:
    maximum: 1000000

  adi,lo-freq-khz:
    description: LO Frequency
    $ref: /schemas/types.yaml#/definitions/uint32

  adi,ref-ext-single-ended-en:
    description: External reference selected.
    type: boolean

required:
  - compatible
  - reg

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#

unevaluatedProperties: false

examples:
  - |
    spi {
      #address-cells = <1>;
      #size-cells = <0>;
      mixer@0 {
        compatible = "adi,admv4420";
        reg = <0>;
        spi-max-frequency = <1000000>;
        adi,lo-freq-khz = <16750000>;
        adi,ref-ext-single-ended-en;
      };
    };
...