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

title: STMicroelectronics STM32 ADC bindings

description: |
  STM32 ADC is a successive approximation analog-to-digital converter.
  It has several multiplexed input channels. Conversions can be performed
  in single, continuous, scan or discontinuous mode. Result of the ADC is
  stored in a left-aligned or right-aligned 32-bit data register.
  Conversions can be launched in software or using hardware triggers.

  The analog watchdog feature allows the application to detect if the input
  voltage goes beyond the user-defined, higher or lower thresholds.

  Each STM32 ADC block can have up to 3 ADC instances.

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

properties:
  compatible:
    enum:
      - st,stm32f4-adc-core
      - st,stm32h7-adc-core
      - st,stm32mp1-adc-core
      - st,stm32mp13-adc-core

  reg:
    maxItems: 1

  interrupts:
    description: |
      One or more interrupts for ADC block, depending on part used:
        - stm32f4 and stm32h7 share a common ADC interrupt line.
        - stm32mp1 has two separate interrupt lines, one for each ADC within
          ADC block.
        - stm32mp13 has an interrupt line per ADC block.
    minItems: 1
    maxItems: 2

  clocks:
    minItems: 1
    maxItems: 2
    description: |
      Core can use up to two clocks, depending on part used:
        - "adc" clock: for the analog circuitry, common to all ADCs.
          It's required on stm32f4.
          It's optional on stm32h7 and stm32mp1.
        - "bus" clock: for registers access, common to all ADCs.
          It's not present on stm32f4.
          It's required on stm32h7 and stm32mp1.

  clock-names: true

  st,max-clk-rate-hz:
    description:
      Allow to specify desired max clock rate used by analog circuitry.

  vdda-supply:
    description: Phandle to the vdda input analog voltage.

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

  booster-supply:
    description:
      Phandle to the embedded booster regulator that can be used to supply ADC
      analog input switches on stm32h7 and stm32mp1.

  vdd-supply:
    description:
      Phandle to the vdd input voltage. It can be used to supply ADC analog
      input switches on stm32mp1.

  st,syscfg:
    description:
      Phandle to system configuration controller. It can be used to control the
      analog circuitry on stm32mp1.
    $ref: "/schemas/types.yaml#/definitions/phandle-array"

  interrupt-controller: true

  '#interrupt-cells':
    const: 1

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

allOf:
  - if:
      properties:
        compatible:
          contains:
            const: st,stm32f4-adc-core

    then:
      properties:
        clocks:
          maxItems: 1

        clock-names:
          const: adc

        interrupts:
          items:
            - description: interrupt line common for all ADCs

        st,max-clk-rate-hz:
          minimum: 600000
          maximum: 36000000
          default: 36000000

        booster-supply: false

        vdd-supply: false

        st,syscfg: false

  - if:
      properties:
        compatible:
          contains:
            const: st,stm32h7-adc-core

    then:
      properties:
        clocks:
          minItems: 1
          maxItems: 2

        clock-names:
          items:
            - const: bus
            - const: adc
          minItems: 1

        interrupts:
          items:
            - description: interrupt line common for all ADCs

        st,max-clk-rate-hz:
          minimum: 120000
          maximum: 36000000
          default: 36000000

        vdd-supply: false

        st,syscfg: false

  - if:
      properties:
        compatible:
          contains:
            const: st,stm32mp1-adc-core

    then:
      properties:
        clocks:
          minItems: 1
          maxItems: 2

        clock-names:
          items:
            - const: bus
            - const: adc
          minItems: 1

        interrupts:
          items:
            - description: interrupt line for ADC1
            - description: interrupt line for ADC2

        st,max-clk-rate-hz:
          minimum: 120000
          maximum: 36000000
          default: 36000000

  - if:
      properties:
        compatible:
          contains:
            const: st,stm32mp13-adc-core

    then:
      properties:
        clocks:
          minItems: 1
          maxItems: 2

        clock-names:
          items:
            - const: bus
            - const: adc
          minItems: 1

        interrupts:
          items:
            - description: ADC interrupt line

        st,max-clk-rate-hz:
          minimum: 150000
          maximum: 75000000
          default: 75000000

additionalProperties: false

required:
  - compatible
  - reg
  - interrupts
  - clocks
  - clock-names
  - vdda-supply
  - vref-supply
  - interrupt-controller
  - '#interrupt-cells'
  - '#address-cells'
  - '#size-cells'

patternProperties:
  "^adc@[0-9]+$":
    type: object
    description:
      An ADC block node should contain at least one subnode, representing an
      ADC instance available on the machine.

    properties:
      compatible:
        enum:
          - st,stm32f4-adc
          - st,stm32h7-adc
          - st,stm32mp1-adc
          - st,stm32mp13-adc

      reg:
        description: |
          Offset of ADC instance in ADC block. Valid values are:
            - 0x0:   ADC1
            - 0x100: ADC2
            - 0x200: ADC3 (stm32f4 only)
        maxItems: 1

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

      '#address-cells':
        const: 1

      '#size-cells':
        const: 0

      interrupts:
        description: |
          IRQ Line for the ADC instance. Valid values are:
            - 0 for adc@0 (single adc for stm32mp13)
            - 1 for adc@100
            - 2 for adc@200 (stm32f4 only)
        maxItems: 1

      clocks:
        description:
          Input clock private to this ADC instance. It's required only on
          stm32f4, that has per instance clock input for registers access.
        maxItems: 1

      dmas:
        description: RX DMA Channel
        maxItems: 1

      dma-names:
        const: rx

      assigned-resolution-bits:
        description: |
          Resolution (bits) to use for conversions:
            - can be 6, 8, 10 or 12 on stm32f4 and stm32mp13
            - can be 8, 10, 12, 14 or 16 on stm32h7 and stm32mp1

      st,adc-channels:
        description: |
          List of single-ended channels muxed for this ADC. It can have up to:
            - 16 channels, numbered from 0 to 15 (for in0..in15) on stm32f4
            - 19 channels, numbered from 0 to 18 (for in0..in18) on stm32mp13.
            - 20 channels, numbered from 0 to 19 (for in0..in19) on stm32h7 and
              stm32mp1.
        $ref: /schemas/types.yaml#/definitions/uint32-array
        deprecated: true

      st,adc-diff-channels:
        description: |
          List of differential channels muxed for this ADC. Some channels can
          be configured as differential instead of single-ended on stm32h7 and
          on stm32mp1. Positive and negative inputs pairs are listed:
          <vinp vinn>, <vinp vinn>,... vinp and vinn are numbered from 0 to 19.

          Note: At least one of "st,adc-channels" or "st,adc-diff-channels" is
          required if no adc generic channel is defined. These legacy channel
          properties are exclusive with adc generic channel bindings.
          Both properties can be used together. Some channels can be
          used as single-ended and some other ones as differential (mixed). But
          channels can't be configured both as single-ended and differential.
        $ref: /schemas/types.yaml#/definitions/uint32-matrix
        items:
          items:
            - description: |
                "vinp" indicates positive input number
              minimum: 0
              maximum: 19
            - description: |
                "vinn" indicates negative input number
              minimum: 0
              maximum: 19
        deprecated: true

      st,min-sample-time-nsecs:
        description:
          Minimum sampling time in nanoseconds. Depending on hardware (board)
          e.g. high/low analog input source impedance, fine tune of ADC
          sampling time may be recommended. This can be either one value or an
          array that matches "st,adc-channels" and/or "st,adc-diff-channels"
          list, to set sample time resp. for all channels, or independently for
          each channel.
        $ref: /schemas/types.yaml#/definitions/uint32-array
        deprecated: true

      nvmem-cells:
        items:
          - description: Phandle to the calibration vrefint data provided by otp

      nvmem-cell-names:
        items:
          - const: vrefint

    patternProperties:
      "^channel@([0-9]|1[0-9])$":
        type: object
        $ref: "adc.yaml"
        description: Represents the external channels which are connected to the ADC.

        properties:
          reg:
            items:
              minimum: 0
              maximum: 19

          label:
            description: |
              Unique name to identify which channel this is.
              Reserved label names "vddcore", "vddcpu", "vddq_ddr", "vrefint" and "vbat"
              are used to identify internal channels with matching names.

          diff-channels:
            $ref: /schemas/types.yaml#/definitions/uint32-array
            items:
              minimum: 0
              maximum: 19

          st,min-sample-time-ns:
            description: |
              Minimum sampling time in nanoseconds. Depending on hardware (board)
              e.g. high/low analog input source impedance, fine tune of ADC
              sampling time may be recommended.

        required:
          - reg

        additionalProperties: false

    allOf:
      - if:
          properties:
            compatible:
              contains:
                const: st,stm32f4-adc

        then:
          properties:
            reg:
              enum:
                - 0x0
                - 0x100
                - 0x200

            interrupts:
              minimum: 0
              maximum: 2

            assigned-resolution-bits:
              enum: [6, 8, 10, 12]
              default: 12

            st,adc-channels:
              minItems: 1
              maxItems: 16
              items:
                minimum: 0
                maximum: 15

            st,adc-diff-channels: false

            st,min-sample-time-nsecs:
              minItems: 1
              maxItems: 16
              items:
                minimum: 80

          required:
            - clocks

      - if:
          properties:
            compatible:
              contains:
                enum:
                  - st,stm32h7-adc
                  - st,stm32mp1-adc

        then:
          properties:
            reg:
              enum:
                - 0x0
                - 0x100

            interrupts:
              minimum: 0
              maximum: 1

            assigned-resolution-bits:
              enum: [8, 10, 12, 14, 16]
              default: 16

            st,adc-channels:
              minItems: 1
              maxItems: 20
              items:
                minimum: 0
                maximum: 19

            st,min-sample-time-nsecs:
              minItems: 1
              maxItems: 20
              items:
                minimum: 40

      - if:
          properties:
            compatible:
              contains:
                const: st,stm32mp13-adc

        then:
          properties:
            reg:
              const: 0x0

            interrupts:
              const: 0

            assigned-resolution-bits:
              enum: [6, 8, 10, 12]
              default: 12

            st,adc-channels:
              minItems: 1
              maxItems: 19
              items:
                minimum: 0
                maximum: 18

            st,min-sample-time-nsecs:
              minItems: 1
              maxItems: 19
              items:
                minimum: 40
    additionalProperties: false

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

examples:
  - |
    // Example 1: with stm32f429, ADC1, single-ended channel 8
      adc123: adc@40012000 {
        compatible = "st,stm32f4-adc-core";
        reg = <0x40012000 0x400>;
        interrupts = <18>;
        clocks = <&rcc 0 168>;
        clock-names = "adc";
        st,max-clk-rate-hz = <36000000>;
        vdda-supply = <&vdda>;
        vref-supply = <&vref>;
        interrupt-controller;
        #interrupt-cells = <1>;
        #address-cells = <1>;
        #size-cells = <0>;
        adc@0 {
          compatible = "st,stm32f4-adc";
          #io-channel-cells = <1>;
          reg = <0x0>;
          clocks = <&rcc 0 168>;
          interrupt-parent = <&adc123>;
          interrupts = <0>;
          st,adc-channels = <8>;
          dmas = <&dma2 0 0 0x400 0x0>;
          dma-names = "rx";
          assigned-resolution-bits = <8>;
        };
        // ...
        // other adc child nodes follow...
      };

  - |
    // Example 2: with stm32mp157c to setup ADC1 with:
    // - channels 0 & 1 as single-ended
    // - channels 2 & 3 as differential (with resp. 6 & 7 negative inputs)
      #include <dt-bindings/interrupt-controller/arm-gic.h>
      #include <dt-bindings/clock/stm32mp1-clks.h>
      adc12: adc@48003000 {
        compatible = "st,stm32mp1-adc-core";
        reg = <0x48003000 0x400>;
        interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>;
        clocks = <&rcc ADC12>, <&rcc ADC12_K>;
        clock-names = "bus", "adc";
        booster-supply = <&booster>;
        vdd-supply = <&vdd>;
        vdda-supply = <&vdda>;
        vref-supply = <&vref>;
        st,syscfg = <&syscfg>;
        interrupt-controller;
        #interrupt-cells = <1>;
        #address-cells = <1>;
        #size-cells = <0>;
        adc@0 {
          compatible = "st,stm32mp1-adc";
          #io-channel-cells = <1>;
          reg = <0x0>;
          interrupt-parent = <&adc12>;
          interrupts = <0>;
          st,adc-channels = <0 1>;
          st,adc-diff-channels = <2 6>, <3 7>;
          st,min-sample-time-nsecs = <5000>;
          dmas = <&dmamux1 9 0x400 0x05>;
          dma-names = "rx";
        };
        // ...
        // other adc child node follow...
      };

  - |
    // Example 3: with stm32mp157c to setup ADC2 with:
    // - internal channels 13, 14, 15.
      #include <dt-bindings/interrupt-controller/arm-gic.h>
      #include <dt-bindings/clock/stm32mp1-clks.h>
      adc122: adc@48003000 {
        compatible = "st,stm32mp1-adc-core";
        reg = <0x48003000 0x400>;
        interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>,
                     <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>;
        clocks = <&rcc ADC12>, <&rcc ADC12_K>;
        clock-names = "bus", "adc";
        booster-supply = <&booster>;
        vdd-supply = <&vdd>;
        vdda-supply = <&vdda>;
        vref-supply = <&vref>;
        st,syscfg = <&syscfg>;
        interrupt-controller;
        #interrupt-cells = <1>;
        #address-cells = <1>;
        #size-cells = <0>;
        adc@100 {
          compatible = "st,stm32mp1-adc";
          #io-channel-cells = <1>;
          reg = <0x100>;
          interrupts = <1>;
          #address-cells = <1>;
          #size-cells = <0>;
          channel@13 {
            reg = <13>;
            label = "vrefint";
            st,min-sample-time-ns = <9000>;
          };
          channel@14 {
            reg = <14>;
            label = "vddcore";
            st,min-sample-time-ns = <9000>;
          };
          channel@15 {
            reg = <15>;
            label = "vbat";
            st,min-sample-time-ns = <9000>;
          };
        };
      };

...


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

title: STMicroelectronics STM32 DFSDM ADC device driver

maintainers:
  - Fabrice Gasnier <fabrice.gasnier@foss.st.com>
  - Olivier Moysan <olivier.moysan@foss.st.com>

description: |
  STM32 DFSDM ADC is a sigma delta analog-to-digital converter dedicated to
  interface external sigma delta modulators to STM32 micro controllers.
  It is mainly targeted for:
  - Sigma delta modulators (motor control, metering...)
  - PDM microphones (audio digital microphone)

  It features up to 8 serial digital interfaces (SPI or Manchester) and
  up to 4 filters on stm32h7 or 6 filters on stm32mp1.

  Each child node matches with a filter instance.

properties:
  compatible:
    enum:
      - st,stm32h7-dfsdm
      - st,stm32mp1-dfsdm

  reg:
    maxItems: 1

  clocks:
    items:
      - description:
          Internal clock used for DFSDM digital processing and control blocks.
          dfsdm clock can also feed CLKOUT, when CLKOUT is used.
      - description: audio clock can be used as an alternate to feed CLKOUT.
    minItems: 1

  clock-names:
    items:
      - const: dfsdm
      - const: audio
    minItems: 1

  "#address-cells":
    const: 1

  "#size-cells":
    const: 0

  spi-max-frequency:
    description:
      SPI clock OUT frequency (Hz). Requested only for SPI master mode.
      This clock must be set according to the "clock" property.
      Frequency must be a multiple of the rcc clock frequency.
      If not, SPI CLKOUT frequency will not be accurate.
    maximum: 20000000

required:
  - compatible
  - reg
  - clocks
  - clock-names
  - "#address-cells"
  - "#size-cells"

additionalProperties: false

patternProperties:
  "^filter@[0-9]+$":
    type: object
    unevaluatedProperties: false
    description: child node

    properties:
      compatible:
        enum:
          - st,stm32-dfsdm-adc
          - st,stm32-dfsdm-dmic

      reg:
        description: Specifies the DFSDM filter instance used.
        maxItems: 1

      interrupts:
        maxItems: 1

      st,adc-channels:
        description: |
          List of single-ended channels muxed for this ADC.
          On stm32h7 and stm32mp1:
          - For st,stm32-dfsdm-adc: up to 8 channels numbered from 0 to 7.
          - For st,stm32-dfsdm-dmic: 1 channel numbered from 0 to 7.
        $ref: /schemas/types.yaml#/definitions/uint32-array
        items:
          minimum: 0
          maximum: 7

      st,adc-channel-names:
        description: List of single-ended channel names.

      st,filter-order:
        description: |
          SinC filter order from 0 to 5.
          - 0: FastSinC
          - [1-5]: order 1 to 5.
          For audio purpose it is recommended to use order 3 to 5.
        $ref: /schemas/types.yaml#/definitions/uint32
        maximum: 5

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

      st,adc-channel-types:
        description: |
          Single-ended channel input type.
          - "SPI_R": SPI with data on rising edge (default)
          - "SPI_F": SPI with data on falling edge
          - "MANCH_R": manchester codec, rising edge = logic 0, falling edge = logic 1
          - "MANCH_F": manchester codec, rising edge = logic 1, falling edge = logic 0
        items:
          enum: [ SPI_R, SPI_F, MANCH_R, MANCH_F ]
        $ref: /schemas/types.yaml#/definitions/non-unique-string-array

      st,adc-channel-clk-src:
        description: |
          Conversion clock source.
          - "CLKIN": external SPI clock (CLKIN x)
          - "CLKOUT": internal SPI clock (CLKOUT) (default)
          - "CLKOUT_F": internal SPI clock divided by 2 (falling edge).
          - "CLKOUT_R": internal SPI clock divided by 2 (rising edge).
        items:
          enum: [ CLKIN, CLKOUT, CLKOUT_F, CLKOUT_R ]
        $ref: /schemas/types.yaml#/definitions/non-unique-string-array

      st,adc-alt-channel:
        description:
          Must be defined if two sigma delta modulators are
          connected on same SPI input.
          If not set, channel n is connected to SPI input n.
          If set, channel n is connected to SPI input n + 1.
        type: boolean

      st,filter0-sync:
        description:
          Set to 1 to synchronize with DFSDM filter instance 0.
          Used for multi microphones synchronization.
        type: boolean

      dmas:
        maxItems: 1

      dma-names:
        items:
          - const: rx

    required:
      - compatible
      - reg
      - interrupts
      - st,adc-channels
      - st,adc-channel-names
      - st,filter-order
      - "#io-channel-cells"

    allOf:
      - if:
          properties:
            compatible:
              contains:
                const: st,stm32-dfsdm-adc

        then:
          properties:
            st,adc-channels:
              minItems: 1
              maxItems: 8

            st,adc-channel-names:
              minItems: 1
              maxItems: 8

            st,adc-channel-types:
              minItems: 1
              maxItems: 8

            st,adc-channel-clk-src:
              minItems: 1
              maxItems: 8

            io-channels:
              description:
                From common IIO binding. Used to pipe external sigma delta
                modulator or internal ADC output to DFSDM channel.

          required:
            - io-channels

      - if:
          properties:
            compatible:
              contains:
                const: st,stm32-dfsdm-dmic

        then:
          properties:
            st,adc-channels:
              maxItems: 1

            st,adc-channel-names:
              maxItems: 1

            st,adc-channel-types:
              maxItems: 1

            st,adc-channel-clk-src:
              maxItems: 1

          required:
            - dmas
            - dma-names

          patternProperties:
            "^dfsdm-dai+$":
              type: object
              additionalProperties: false
              description: child node

              properties:
                compatible:
                  enum:
                    - st,stm32h7-dfsdm-dai

                "#sound-dai-cells":
                  const: 0

                io-channels:
                  description:
                    From common IIO binding. Used to pipe external sigma delta
                    modulator or internal ADC output to DFSDM channel.

              required:
                - compatible
                - "#sound-dai-cells"
                - io-channels

allOf:
  - if:
      properties:
        compatible:
          contains:
            const: st,stm32h7-dfsdm

    then:
      patternProperties:
        "^filter@[0-9]+$":
          properties:
            reg:
              items:
                minimum: 0
                maximum: 3

  - if:
      properties:
        compatible:
          contains:
            const: st,stm32mp1-dfsdm

    then:
      patternProperties:
        "^filter@[0-9]+$":
          properties:
            reg:
              items:
                minimum: 0
                maximum: 5

examples:
  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/clock/stm32mp1-clks.h>
    dfsdm: dfsdm@4400d000 {
      compatible = "st,stm32mp1-dfsdm";
      reg = <0x4400d000 0x800>;
      clocks = <&rcc DFSDM_K>, <&rcc ADFSDM_K>;
      clock-names = "dfsdm", "audio";
      #address-cells = <1>;
      #size-cells = <0>;

      dfsdm0: filter@0 {
        compatible = "st,stm32-dfsdm-dmic";
        reg = <0>;
        interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>;
        dmas = <&dmamux1 101 0x400 0x01>;
        dma-names = "rx";
        #io-channel-cells = <1>;
        st,adc-channels = <1>;
        st,adc-channel-names = "dmic0";
        st,adc-channel-types = "SPI_R";
        st,adc-channel-clk-src = "CLKOUT";
        st,filter-order = <5>;

        asoc_pdm0: dfsdm-dai {
          compatible = "st,stm32h7-dfsdm-dai";
          #sound-dai-cells = <0>;
          io-channels = <&dfsdm0 0>;
        };
      };

      dfsdm_pdm1: filter@1 {
        compatible = "st,stm32-dfsdm-adc";
        reg = <1>;
        interrupts = <GIC_SPI 111 IRQ_TYPE_LEVEL_HIGH>;
        dmas = <&dmamux1 102 0x400 0x01>;
        dma-names = "rx";
        #io-channel-cells = <1>;
        st,adc-channels = <2 3>;
        st,adc-channel-names = "in2", "in3";
        st,adc-channel-types = "SPI_R", "SPI_R";
        st,adc-channel-clk-src = "CLKOUT_F", "CLKOUT_F";
        io-channels = <&sd_adc2 &sd_adc3>;
        st,filter-order = <1>;
      };
    };

...

repo_name: angery/linux


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

title: ADC on an STMPE multifunction device.

maintainers:
  - Stefan Agner <stefan@agner.ch>

description:
  This ADC forms part of an ST microelectronics STMPE multifunction device .
  The ADC is shared with the STMPE touchscreen. As a result some ADC related
  settings are specified in the parent node.
  The node should be a child node of the stmpe node to which it belongs.

properties:
  compatible:
    const: st,stmpe-adc

  st,norequest-mask:
    $ref: /schemas/types.yaml#/definitions/uint32
    description:
      Bitmask specifying which ADC channels should _not_ be
      requestable due to different usage (e.g. touch).

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

required:
  - compatible

additionalProperties: false

examples:
  - |
    stmpe {
        stmpe_adc {
            compatible = "st,stmpe-adc";
            st,norequest-mask = <0x0F>; /* dont use ADC CH3-0 */
        };
    };
...


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

title: Texas Instruments ADC0832 and similar ADCs

maintainers:
  - Akinobu Mita <akinobu.mita@gmail.com>

description: |
  8 bit ADCs with 1, 2, 4 or 8 inputs for single ended or differential
  conversion.

properties:
  compatible:
    enum:
      - ti,adc0831
      - ti,adc0832
      - ti,adc0834
      - ti,adc0838

  reg:
    maxItems: 1

  vref-supply:
    description: External reference, needed to establish input scaling

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

required:
  - compatible
  - reg
  - vref-supply

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

unevaluatedProperties: false

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

        adc@0 {
            compatible = "ti,adc0832";
            reg = <0>;
            vref-supply = <&vdd_supply>;
            spi-max-frequency = <200000>;
            #io-channel-cells = <1>;
        };
    };
...


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

title: Texas Instruments ADC084S021 ADC

maintainers:
  - Mårten Lindahl <martenli@axis.com>

description: |
  8 bit ADC with 4 channels

properties:
  compatible:
    const: ti,adc084s021

  reg:
    maxItems: 1

  vref-supply:
    description: External reference, needed to establish input scaling

  spi-cpol: true
  spi-cpha: true

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

required:
  - compatible
  - reg
  - vref-supply
  - spi-cpol
  - spi-cpha

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

unevaluatedProperties: false

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

        adc@0 {
            compatible = "ti,adc084s021";
            reg = <0>;
            vref-supply = <&adc_vref>;
            spi-cpol;
            spi-cpha;
            spi-max-frequency = <16000000>;
            #io-channel-cells = <1>;
        };
    };
...


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

title: Texas Instruments ADC108S102 and ADC128S102

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

description: |
  Family of 8 channel, 10/12 bit, SPI, single ended ADCs.

properties:
  compatible:
    const:
      ti,adc108s102

  reg: true
  vref-supply: true
  "#io-channel-cells":
    const: 1

required:
  - compatible
  - reg
  - vref-supply

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

unevaluatedProperties: false

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

        adc@0 {
            compatible = "ti,adc108s102";
            reg = <0>;
            vref-supply = <&vdd_supply>;
            spi-max-frequency = <1000000>;
            #io-channel-cells = <1>;
        };
    };
...


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

title: Texas Instruments ADC12138 and similar self-calibrating ADCs

maintainers:
  - Akinobu Mita <akinobu.mita@gmail.com>

description: |
  13 bit ADCs with 1, 2 or 8 inputs and self calibrating circuitry to
  correct for linearity, zero and full scale errors.

properties:
  compatible:
    enum:
      - ti,adc12130
      - ti,adc12132
      - ti,adc12138

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1
    description: End of Conversion (EOC) interrupt

  clocks:
    maxItems: 1
    description: Conversion clock input.

  vref-p-supply:
    description: The regulator supply for positive analog voltage reference

  vref-n-supply:
    description: |
      The regulator supply for negative analog voltage reference
      (Note that this must not go below GND or exceed vref-p)
      If not specified, this is assumed to be analog ground.

  ti,acquisition-time:
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [ 6, 10, 18, 34 ]
    description: |
      The number of conversion clock periods for the S/H's acquisition time.
      For high source impedances, this value can be increased to 18 or 34.
      For less ADC accuracy and/or slower CCLK frequencies this value may be
      decreased to 6.  See section 6.0 INPUT SOURCE RESISTANCE in the
      datasheet for details.

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

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

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>;

        adc@0 {
            compatible = "ti,adc12138";
            reg = <0>;
            interrupts = <28 IRQ_TYPE_EDGE_RISING>;
            interrupt-parent = <&gpio1>;
            clocks = <&cclk>;
            vref-p-supply = <&ldo4_reg>;
            spi-max-frequency = <5000000>;
            ti,acquisition-time = <6>;
            #io-channel-cells = <1>;
        };
    };
...


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

title: Texas Instruments ADC128S052 and similar ADCs

maintainers:
  - Angelo Compagnucci <angelo.compagnucci@gmail.com>

description: |
  Family of 12 bit SPI ADCs with 2 to 8 channels with a range of different
  target sample rates.

properties:
  compatible:
    enum:
      - ti,adc122s021
      - ti,adc122s051
      - ti,adc122s101
      - ti,adc124s021
      - ti,adc124s051
      - ti,adc124s101
      - ti,adc128s052

  reg:
    maxItems: 1

  vref-supply: true

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

required:
  - compatible
  - reg
  - vref-supply

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>;

        adc@0 {
            compatible = "ti,adc128s052";
            reg = <0>;
            vref-supply = <&vdd_supply>;
            spi-max-frequency = <1000000>;
            #io-channel-cells = <1>;
        };
    };
...


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

title: Texas Instruments ADC141S626 and ADC161S626 ADCs

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

description: |
  Single channel 14/16bit differential ADCs

properties:
  compatible:
    enum:
      - ti,adc141s626
      - ti,adc161s626

  reg:
    maxItems: 1

  vdda-supply: true

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

required:
  - compatible
  - reg

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

unevaluatedProperties: false

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

        adc@0 {
            compatible = "ti,adc161s626";
            vdda-supply = <&vdda_fixed>;
            reg = <0>;
            spi-max-frequency = <4300000>;
            #io-channel-cells = <1>;
        };
    };
...


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

title: TI ADS1015/ADS1115 4 channel I2C analog to digital converter

maintainers:
  - Daniel Baluta <daniel.baluta@nxp.com>

description: |
  Datasheet at: https://www.ti.com/lit/gpn/ads1015
  Supports both single ended and differential channels.

properties:
  compatible:
    enum:
      - ti,ads1015
      - ti,ads1115
      - ti,tla2024

  reg:
    maxItems: 1

  "#address-cells":
    const: 1

  "#size-cells":
    const: 0

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

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

additionalProperties: false

patternProperties:
  "^channel@[0-7]+$":
    type: object
    additionalProperties: false
    description:
      Child nodes needed for each channel that the platform uses.

    properties:
      reg:
        description: |
          0: Voltage over AIN0 and AIN1.
          1: Voltage over AIN0 and AIN3.
          2: Voltage over AIN1 and AIN3.
          3: Voltage over AIN2 and AIN3.
          4: Voltage over AIN0 and GND.
          5: Voltage over AIN1 and GND.
          6: Voltage over AIN2 and GND.
          7: Voltage over AIN3 and GND.
        items:
          - minimum: 0
            maximum: 7

      ti,gain:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 5
        description: |
          pga is the programmable gain amplifier (values are full scale)
          0: +/- 6.144 V
          1: +/- 4.096 V
          2: +/- 2.048 V (default)
          3: +/- 1.024 V
          4: +/- 0.512 V
          5: +/- 0.256 V

      ti,datarate:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 6
        description: |
          Data acquisition rate in samples per second
          0: 128
          1: 250
          2: 490
          3: 920
          4: 1600 (default)
          5: 2400
          6: 3300

    required:
      - reg

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

        adc@49 {
            compatible = "ti,ads1015";
            reg = <0x49>;
            #address-cells = <1>;
            #size-cells = <0>;
            channel@0 {
              reg = <0>;
            };
            channel@4 {
              reg = <4>;
              ti,gain = <3>;
              ti,datarate = <5>;
            };
        };
    };
...


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

title: Texas Instruments' ads124s08 and ads124s06 ADC chip

maintainers:
  - Andrew Davis <afd@ti.com>

properties:
  compatible:
    enum:
      - ti,ads124s06
      - ti,ads124s08

  reg:
    maxItems: 1

  spi-cpha: true

  reset-gpios:
    maxItems: 1

  "#io-channel-cells":
    const: 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>;

        adc@0 {
            compatible = "ti,ads124s08";
            reg = <0>;
            spi-max-frequency = <1000000>;
            spi-cpha;
            reset-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
        };
    };
...


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

title: Texas Instruments ADS131E0x 4-, 6- and 8-Channel ADCs

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

description: |
  The ADS131E0x are a family of multichannel, simultaneous sampling,
  24-bit, delta-sigma, analog-to-digital converters (ADCs) with a
  built-in programmable gain amplifier (PGA), internal reference
  and an onboard oscillator.
  The communication with ADC chip is via the SPI bus (mode 1).

  https://www.ti.com/lit/ds/symlink/ads131e08.pdf

properties:
  compatible:
    enum:
      - ti,ads131e04
      - ti,ads131e06
      - ti,ads131e08

  reg:
    maxItems: 1

  spi-cpha: true

  clocks:
    description: |
      Device tree identifier to the clock source (2.048 MHz).
      Note: clock source is selected using CLKSEL pin.
    maxItems: 1

  clock-names:
    items:
      - const: adc-clk

  interrupts:
    description: |
      IRQ line for the ADC data ready.
    maxItems: 1

  vref-supply:
    description: |
      Optional external voltage reference. If not supplied, internal voltage
      reference is used.

  ti,vref-internal:
    description: |
      Select the internal voltage reference value.
      0: 2.4V
      1: 4.0V
      If this field is left empty, 2.4V is selected.
      Note: internal voltage reference is used only if vref-supply is not supplied.
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [0, 1]
    default: 0

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

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

patternProperties:
  "^channel@([0-7])$":
    $ref: "adc.yaml"
    type: object
    description: |
      Represents the external channels which are connected to the ADC.

    properties:
      reg:
        description: |
          The channel number.
          Up to 4 channels, numbered from 0 to 3 for ti,ads131e04.
          Up to 6 channels, numbered from 0 to 5 for ti,ads131e06.
          Up to 8 channels, numbered from 0 to 7 for ti,ads131e08.
        items:
          minimum: 0
          maximum: 7

      ti,gain:
        description: |
          The PGA gain value for the channel.
          If this field is left empty, PGA gain 1 is used.
        $ref: /schemas/types.yaml#/definitions/uint32
        enum: [1, 2, 4, 8, 12]
        default: 1

      ti,mux:
        description: |
          Channel input selection(muliplexer).
          0: Normal input.
          1: Input shorted to (VREFP + VREFN) / 2 (for offset or noise measurements).
          3: MVDD (for supply measurement)
          4: Temperature sensor
          If this field is left empty, normal input is selected.
        $ref: /schemas/types.yaml#/definitions/uint32
        enum: [0, 1, 3, 4]
        default: 0

    required:
      - reg

    additionalProperties: false

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>;

      adc@0 {
        compatible = "ti,ads131e08";
        reg = <0>;
        spi-max-frequency = <1000000>;
        spi-cpha;
        clocks = <&clk2048k>;
        clock-names = "adc-clk";
        interrupt-parent = <&gpio5>;
        interrupts = <28 IRQ_TYPE_EDGE_FALLING>;
        vref-supply = <&adc_vref>;

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

        channel@0 {
          reg = <0>;
        };

        channel@1 {
          reg = <1>;
        };

        channel@2 {
          reg = <2>;
          ti,gain = <2>;
        };

        channel@3 {
          reg = <3>;
        };

        channel@4 {
          reg = <4>;
        };

        channel@5 {
          reg = <5>;
        };

        channel@6 {
          reg = <6>;
        };

        channel@7 {
          reg = <7>;
          ti,mux = <4>;
        };
      };
    };


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

title: Texas Instruments ADS7950 and similar ADCs

maintainers:
  - David Lechner <david@lechnology.com>

description: |
  Family of 4-16 channel, 8-12 bit ADCs with SPI interface.

properties:
  compatible:
    enum:
      - ti,ads7950
      - ti,ads7951
      - ti,ads7952
      - ti,ads7953
      - ti,ads7954
      - ti,ads7955
      - ti,ads7956
      - ti,ads7957
      - ti,ads7958
      - ti,ads7959
      - ti,ads7960
      - ti,ads7961

  reg:
    maxItems: 1

  spi-max-frequency:
    maximum: 20000000

  vref-supply:
    description: Supplies the 2.5V or 5V reference voltage

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

required:
  - compatible
  - reg
  - vref-supply
  - "#io-channel-cells"

additionalProperties: false

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

        adc@0 {
            compatible = "ti,ads7957";
            reg = <0>;
            vref-supply = <&refin_supply>;
            spi-max-frequency = <10000000>;
            #io-channel-cells = <1>;
        };
    };
...


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

title: Texas Instruments ADS8344 ADC

maintainers:
  - Gregory Clement <gregory.clement@bootlin.com>

description: |
  16bit 8-channel ADC with single ended inputs.

properties:
  compatible:
    const: ti,ads8344

  reg:
    maxItems: 1

  vref-supply:
    description: Supply the 2.5V or 5V reference voltage

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

required:
  - compatible
  - reg
  - vref-supply

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

unevaluatedProperties: false

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

        adc@0 {
            compatible = "ti,ads8344";
            reg = <0>;
            vref-supply = <&refin_supply>;
            spi-max-frequency = <10000000>;
            #io-channel-cells = <1>;
        };
    };
...


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

title: Texas Instruments' ADS8684 and ADS8688 ADC chip

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

description: |
   SPI 16bit ADCs with 4/8 channels.

properties:
  compatible:
    enum:
      - ti,ads8684
      - ti,ads8688

  reg:
    maxItems: 1

  vref-supply:
    description: Optional external reference.  If not supplied, assume
      REFSEL input tied low to enable the internal reference.

required:
  - compatible
  - reg

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

unevaluatedProperties: false

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

        adc@0 {
            compatible = "ti,ads8688";
            reg = <0>;
            vref-supply = <&vdd_supply>;
            spi-max-frequency = <1000000>;
        };
    };
...


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

title: TI AM3359 ADC

maintainers:
  - Miquel Raynal <miquel.raynal@bootlin.com>

properties:
  compatible:
    oneOf:
      - enum:
          - ti,am3359-adc
          - ti,am4372-adc
      - items:
          - enum:
              - ti,am654-adc
          - const: ti,am3359-adc

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

  ti,adc-channels:
    description: List of analog inputs available for ADC. AIN0 = 0, AIN1 = 1 and
      so on until AIN7 = 7.
    $ref: /schemas/types.yaml#/definitions/uint32-array
    minItems: 1
    maxItems: 8

  ti,chan-step-opendelay:
    description: List of open delays for each channel of ADC in the order of
      ti,adc-channels. The value corresponds to the number of ADC clock cycles
      to wait after applying the step configuration registers and before sending
      the start of ADC conversion. Maximum value is 0x3FFFF.
    $ref: /schemas/types.yaml#/definitions/uint32-array
    minItems: 1
    maxItems: 8

  ti,chan-step-sampledelay:
    description: List of sample delays for each channel of ADC in the order of
      ti,adc-channels. The value corresponds to the number of ADC clock cycles
      to sample (to hold start of conversion high). Maximum value is 0xFF.
    $ref: /schemas/types.yaml#/definitions/uint32-array
    minItems: 1
    maxItems: 8

  ti,chan-step-avg:
    description: Number of averages to be performed for each channel of ADC. If
      average is 16 (this is also the maximum) then input is sampled 16 times
      and averaged to get more accurate value. This increases the time taken by
      ADC to generate a sample. Maximum value is 16.
    $ref: /schemas/types.yaml#/definitions/uint32-array
    minItems: 1
    maxItems: 8

required:
  - compatible
  - '#io-channel-cells'
  - ti,adc-channels

additionalProperties: false

examples:
  - |
    adc {
        compatible = "ti,am3359-adc";
        #io-channel-cells = <1>;
        ti,adc-channels = <4 5 6 7>;
        ti,chan-step-opendelay = <0x098 0x3ffff 0x098 0x0>;
        ti,chan-step-sampledelay = <0xff 0x0 0xf 0x0>;
        ti,chan-step-avg = <16 2 4 8>;
    };


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

title: Palmas general purpose ADC IP block devicetree bindings

maintainers:
  - Tony Lindgren <tony@atomide.com>

description: |
  This ADC is often used to provide channels via the io-channels
  consumer framework.
  Channels list:
    0 battery type
    1 battery temp NTC (optional current source)
    2 GP
    3 temp (with ext. diode, optional current source)
    4 GP
    5 GP
    6 VBAT_SENSE
    7 VCC_SENSE
    8 Backup Battery voltage
    9 external charger (VCHG)
    10 VBUS
    11 DC-DC current probe (how does this work?)
    12 internal die temp
    13 internal die temp
    14 USB ID pin voltage
    15 test network

properties:
  compatible:
    const: ti,palmas-gpadc

  interrupts:
    minItems: 1
    maxItems: 3

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

  ti,channel0-current-microamp:
    description: Channel 0 current in uA.
    enum:
      - 0
      - 5
      - 15
      - 20

  ti,channel3-current-microamp:
    description: Channel 3 current in uA.
    enum:
      - 0
      - 10
      - 400
      - 800

  ti,enable-extended-delay:
    $ref: /schemas/types.yaml#/definitions/flag
    description: Enable extended delay.

additionalProperties: false

required:
  - compatible
  - "#io-channel-cells"

examples:
  - |
    #include <dt-bindings/clock/mt8183-clk.h>
    pmic {
        compatible = "ti,twl6035-pmic", "ti,palmas-pmic";
        adc {
            compatible = "ti,palmas-gpadc";
            interrupts = <18 0>,
                         <16 0>,
                         <17 0>;
            #io-channel-cells = <1>;
            ti,channel0-current-microamp = <5>;
            ti,channel3-current-microamp = <10>;
        };
    };
...


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

title: Texas Instruments TLC4541 and similar ADCs

maintainers:
  - Phil Reid <preid@electromag.com.au>

description: |
  14/16bit single channel ADC with SPI interface.

properties:
  compatible:
    enum:
      - ti,tlc3541
      - ti,tlc4541

  reg:
    maxItems: 1

  vref-supply: true

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

required:
  - compatible
  - reg
  - vref-supply

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

unevaluatedProperties: false

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

        adc@0 {
            compatible = "ti,tlc4541";
            reg = <0>;
            vref-supply = <&vdd_supply>;
            spi-max-frequency = <200000>;
            #io-channel-cells = <1>;
        };
    };
...


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

title: Texas Instruments TSC2046 touch screen controller.

maintainers:
  - Oleksij Rempel <o.rempel@pengutronix.de>

description: |
  TSC2046 is a touch screen controller with 8 channels ADC.

properties:
  compatible:
    enum:
      - ti,tsc2046e-adc

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  vref-supply:
    description: Optional supply of the reference voltage

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

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

required:
  - compatible
  - reg

patternProperties:
  "^channel@[0-7]$":
    $ref: "adc.yaml"
    type: object

    properties:
      reg:
        description: |
          The channel number. It can have up to 8 channels
        items:
          minimum: 0
          maximum: 7

      settling-time-us: true
      oversampling-ratio: true

    required:
      - reg

    additionalProperties: false

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>;

        adc@0 {
            compatible = "ti,tsc2046e-adc";
            reg = <0>;
            spi-max-frequency = <1000000>;
            interrupts-extended = <&gpio3 20 IRQ_TYPE_LEVEL_LOW>;
            #io-channel-cells = <1>;

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

            channel@0 {
              reg = <0>;
            };
            channel@1 {
              reg = <1>;
              settling-time-us = <700>;
              oversampling-ratio = <5>;
            };
            channel@2 {
              reg = <2>;
            };
            channel@3 {
              reg = <3>;
              settling-time-us = <700>;
              oversampling-ratio = <5>;
            };
            channel@4 {
              reg = <4>;
              settling-time-us = <700>;
              oversampling-ratio = <5>;
            };
            channel@5 {
              reg = <5>;
              settling-time-us = <700>;
              oversampling-ratio = <5>;
            };
            channel@6 {
              reg = <6>;
            };
            channel@7 {
              reg = <7>;
            };
        };
    };
...


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

title: MADC subsystem in the TWL4030 power module

maintainers:
  - Sebastian Reichel <sre@kernel.org>

description:
  The MADC subsystem in the TWL4030 consists of a 10-bit ADC
  combined with a 16-input analog multiplexer.

properties:
  compatible:
    const: ti,twl4030-madc

  interrupts:
    maxItems: 1

  ti,system-uses-second-madc-irq:
    type: boolean
    description:
      Set if the second madc irq register should be used, which is intended
      to be used  by Co-Processors (e.g. a modem).

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

required:
  - compatible
  - interrupts
  - "#io-channel-cells"

additionalProperties: false

examples:
  - |
    twl {
        madc {
            compatible = "ti,twl4030-madc";
            interrupts = <3>;
            #io-channel-cells = <1>;
        };
    };
...


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

title: X-Powers AXP ADC bindings

maintainers:
  - Chen-Yu Tsai <wens@csie.org>

description: |
  ADC is frequently used as a provider to consumers of the ADC channels.
  Device is a child of an axp209 multifunction device
  ADC channels and their indexes per variant:

  AXP209
  ------
   0 | acin_v
   1 | acin_i
   2 | vbus_v
   3 | vbus_i
   4 | pmic_temp
   5 | gpio0_v
   6 | gpio1_v
   7 | ipsout_v
   8 | batt_v
   9 | batt_chrg_i
  10 | batt_dischrg_i
  11 | ts_v

  AXP22x
  ------
   0 | pmic_temp
   1 | batt_v
   2 | batt_chrg_i
   3 | batt_dischrg_i
   4 | ts_v

  AXP813
  ------
   0 | pmic_temp
   1 | gpio0_v
   2 | batt_v
   3 | batt_chrg_i
   4 | batt_dischrg_i
   5 | ts_v

properties:
  compatible:
    oneOf:
      - const: x-powers,axp209-adc
      - const: x-powers,axp221-adc
      - const: x-powers,axp813-adc

      - items:
          - const: x-powers,axp803-adc
          - const: x-powers,axp813-adc

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

additionalProperties: false

examples:
  - |
    axp221 {
        adc {
            compatible = "x-powers,axp221-adc";
            #io-channel-cells = <1>;
        };
    };
...


code:
Xilinx XADC device driver

This binding document describes the bindings for the Xilinx 7 Series XADC as well
as the UltraScale/UltraScale+ System Monitor.

The Xilinx XADC is an ADC that can be found in the Series 7 FPGAs from Xilinx.
The XADC has a DRP interface for communication. Currently two different
frontends for the DRP interface exist. One that is only available on the ZYNQ
family as a hardmacro in the SoC portion of the ZYNQ. The other one is available
on all series 7 platforms and is a softmacro with a AXI interface. This binding
document describes the bindings for both of them since the bindings are very
similar.

The Xilinx System Monitor is an ADC that is found in the UltraScale and
UltraScale+ FPGAs from Xilinx. The System Monitor provides a DRP interface for
communication. Xilinx provides a standard IP core that can be used to access the
System Monitor through an AXI interface in the FPGA fabric. This IP core is
called the Xilinx System Management Wizard. This document describes the bindings
for this IP.

Required properties:
	- compatible: Should be one of
		* "xlnx,zynq-xadc-1.00.a": When using the ZYNQ device
		  configuration interface to interface to the XADC hardmacro.
		* "xlnx,axi-xadc-1.00.a": When using the axi-xadc pcore to
		  interface to the XADC hardmacro.
		* "xlnx,system-management-wiz-1.3": When using the
		  Xilinx System Management Wizard fabric IP core to access the
		  UltraScale and UltraScale+ System Monitor.
	- reg: Address and length of the register set for the device
	- interrupts: Interrupt for the XADC control interface.
	- clocks: When using the ZYNQ this must be the ZYNQ PCAP clock,
	  when using the axi-xadc or the axi-system-management-wizard this must be
	  the clock that provides the clock to the AXI bus interface of the core.

Optional properties:
	- xlnx,external-mux:
		* "none": No external multiplexer is used, this is the default
		  if the property is omitted.
		* "single": External multiplexer mode is used with one
		   multiplexer.
		* "dual": External multiplexer mode is used with two
		  multiplexers for simultaneous sampling.
	- xlnx,external-mux-channel: Configures which pair of pins is used to
	  sample data in external mux mode.
	  Valid values for single external multiplexer mode are:
		0: VP/VN
		1: VAUXP[0]/VAUXN[0]
		2: VAUXP[1]/VAUXN[1]
		...
		16: VAUXP[15]/VAUXN[15]
	  Valid values for dual external multiplexer mode are:
		1: VAUXP[0]/VAUXN[0] - VAUXP[8]/VAUXN[8]
		2: VAUXP[1]/VAUXN[1] - VAUXP[9]/VAUXN[9]
		...
		8: VAUXP[7]/VAUXN[7] - VAUXP[15]/VAUXN[15]

	  This property needs to be present if the device is configured for
	  external multiplexer mode (either single or dual). If the device is
	  not using external multiplexer mode the property is ignored.
	- xnlx,channels: List of external channels that are connected to the ADC
	  Required properties:
		* #address-cells: Should be 1.
		* #size-cells: Should be 0.

	  The child nodes of this node represent the external channels which are
	  connected to the ADC. If the property is no present no external
	  channels will be assumed to be connected.

	  Each child node represents one channel and has the following
	  properties:
		Required properties:
			* reg: Pair of pins the channel is connected to.
				0: VP/VN
				1: VAUXP[0]/VAUXN[0]
				2: VAUXP[1]/VAUXN[1]
				...
				16: VAUXP[15]/VAUXN[15]
			  Note each channel number should only be used at most
			  once.
		Optional properties:
			* xlnx,bipolar: If set the channel is used in bipolar
			  mode.

Examples:
	xadc@f8007100 {
		compatible = "xlnx,zynq-xadc-1.00.a";
		reg = <0xf8007100 0x20>;
		interrupts = <0 7 4>;
		interrupt-parent = <&gic>;
		clocks = <&pcap_clk>;

		xlnx,channels {
			#address-cells = <1>;
			#size-cells = <0>;
			channel@0 {
				reg = <0>;
			};
			channel@1 {
				reg = <1>;
			};
			channel@8 {
				reg = <8>;
			};
		};
	};

	xadc@43200000 {
		compatible = "xlnx,axi-xadc-1.00.a";
		reg = <0x43200000 0x1000>;
		interrupts = <0 53 4>;
		interrupt-parent = <&gic>;
		clocks = <&fpga1_clk>;

		xlnx,channels {
			#address-cells = <1>;
			#size-cells = <0>;
			channel@0 {
				reg = <0>;
				xlnx,bipolar;
			};
		};
	};

	adc@80000000 {
		compatible = "xlnx,system-management-wiz-1.3";
		reg = <0x80000000 0x1000>;
		interrupts = <0 81 4>;
		interrupt-parent = <&gic>;
		clocks = <&fpga1_clk>;

		xlnx,channels {
			#address-cells = <1>;
			#size-cells = <0>;
			channel@0 {
				reg = <0>;
				xlnx,bipolar;
			};
		};
	};


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

title: Xilinx Zynq Ultrascale AMS controller

maintainers:
  - Anand Ashok Dumbre <anand.ashok.dumbre@xilinx.com>

description: |
  The AMS (Analog Monitoring System) includes an ADC as well as on-chip sensors
  that can be used to sample external voltages and monitor on-die operating
  conditions, such as temperature and supply voltage levels.
  The AMS has two SYSMON blocks which are PL (Programmable Logic) SYSMON and
  PS (Processing System) SYSMON.
  All designs should have AMS registers, but PS and PL are optional. The
  AMS controller can work with only PS, only PL and both PS and PL
  configurations. Please specify registers according to your design. Devicetree
  should always have AMS module property. Providing PS & PL module is optional.

  AMS Channel Details
  ```````````````````
  Sysmon Block  |Channel|                       Details                                 |Measurement
                |Number |                                                               |Type
  ---------------------------------------------------------------------------------------------------------
  AMS CTRL      |0      |System PLLs voltage measurement, VCC_PSPLL.                    |Voltage
                |1      |Battery voltage measurement, VCC_PSBATT.                       |Voltage
                |2      |PL Internal voltage measurement, VCCINT.                       |Voltage
                |3      |Block RAM voltage measurement, VCCBRAM.                        |Voltage
                |4      |PL Aux voltage measurement, VCCAUX.                            |Voltage
                |5      |Voltage measurement for six DDR I/O PLLs, VCC_PSDDR_PLL.       |Voltage
                |6      |VCC_PSINTFP_DDR voltage measurement.                           |Voltage
  ---------------------------------------------------------------------------------------------------------
  PS Sysmon     |7      |LPD temperature measurement.                                   |Temperature
                |8      |FPD temperature measurement (REMOTE).                          |Temperature
                |9      |VCC PS LPD voltage measurement (supply1).                      |Voltage
                |10     |VCC PS FPD voltage measurement (supply2).                      |Voltage
                |11     |PS Aux voltage reference (supply3).                            |Voltage
                |12     |DDR I/O VCC voltage measurement.                               |Voltage
                |13     |PS IO Bank 503 voltage measurement (supply5).                  |Voltage
                |14     |PS IO Bank 500 voltage measurement (supply6).                  |Voltage
                |15     |VCCO_PSIO1 voltage measurement.                                |Voltage
                |16     |VCCO_PSIO2 voltage measurement.                                |Voltage
                |17     |VCC_PS_GTR voltage measurement (VPS_MGTRAVCC).                 |Voltage
                |18     |VTT_PS_GTR voltage measurement (VPS_MGTRAVTT).                 |Voltage
                |19     |VCC_PSADC voltage measurement.                                 |Voltage
  ---------------------------------------------------------------------------------------------------------
  PL Sysmon     |20     |PL temperature measurement.                                    |Temperature
                |21     |PL Internal voltage measurement, VCCINT.                       |Voltage
                |22     |PL Auxiliary voltage measurement, VCCAUX.                      |Voltage
                |23     |ADC Reference P+ voltage measurement.                          |Voltage
                |24     |ADC Reference N- voltage measurement.                          |Voltage
                |25     |PL Block RAM voltage measurement, VCCBRAM.                     |Voltage
                |26     |LPD Internal voltage measurement, VCC_PSINTLP (supply4).       |Voltage
                |27     |FPD Internal voltage measurement, VCC_PSINTFP (supply5).       |Voltage
                |28     |PS Auxiliary voltage measurement (supply6).                    |Voltage
                |29     |PL VCCADC voltage measurement (vccams).                        |Voltage
                |30     |Differential analog input signal voltage measurment.           |Voltage
                |31     |VUser0 voltage measurement (supply7).                          |Voltage
                |32     |VUser1 voltage measurement (supply8).                          |Voltage
                |33     |VUser2 voltage measurement (supply9).                          |Voltage
                |34     |VUser3 voltage measurement (supply10).                         |Voltage
                |35     |Auxiliary ch 0 voltage measurement (VAux0).                    |Voltage
                |36     |Auxiliary ch 1 voltage measurement (VAux1).                    |Voltage
                |37     |Auxiliary ch 2 voltage measurement (VAux2).                    |Voltage
                |38     |Auxiliary ch 3 voltage measurement (VAux3).                    |Voltage
                |39     |Auxiliary ch 4 voltage measurement (VAux4).                    |Voltage
                |40     |Auxiliary ch 5 voltage measurement (VAux5).                    |Voltage
                |41     |Auxiliary ch 6 voltage measurement (VAux6).                    |Voltage
                |42     |Auxiliary ch 7 voltage measurement (VAux7).                    |Voltage
                |43     |Auxiliary ch 8 voltage measurement (VAux8).                    |Voltage
                |44     |Auxiliary ch 9 voltage measurement (VAux9).                    |Voltage
                |45     |Auxiliary ch 10 voltage measurement (VAux10).                  |Voltage
                |46     |Auxiliary ch 11 voltage measurement (VAux11).                  |Voltage
                |47     |Auxiliary ch 12 voltage measurement (VAux12).                  |Voltage
                |48     |Auxiliary ch 13 voltage measurement (VAux13).                  |Voltage
                |49     |Auxiliary ch 14 voltage measurement (VAux14).                  |Voltage
                |50     |Auxiliary ch 15 voltage measurement (VAux15).                  |Voltage
  --------------------------------------------------------------------------------------------------------

properties:
  compatible:
    enum:
      - xlnx,zynqmp-ams

  interrupts:
    maxItems: 1

  reg:
    description: AMS Controller register space
    maxItems: 1

  clocks:
    items:
      - description: AMS reference clock

  ranges:
    description:
      Maps the child address space for PS and/or PL.
    maxItems: 1

  '#address-cells':
    const: 1

  '#size-cells':
    const: 1

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

  ams-ps@0:
    type: object
    description: |
      PS (Processing System) SYSMON is memory mapped to PS. This block has
      built-in alarm generation logic that is used to interrupt the processor
      based on condition set.

    properties:
      compatible:
        enum:
          - xlnx,zynqmp-ams-ps

      reg:
        description: Register Space for PS-SYSMON
        maxItems: 1

    required:
      - compatible
      - reg

    additionalProperties: false

  ams-pl@400:
    type: object
    additionalProperties: false
    description:
      PL-SYSMON is capable of monitoring off chip voltage and temperature.
      PL-SYSMON block has DRP, JTAG and I2C interface to enable monitoring
      from external master. Out of this interface currently only DRP is
      supported. This block has alarm generation logic that is used to
      interrupt the processor based on condition set.

    properties:
      compatible:
        items:
          - enum:
              - xlnx,zynqmp-ams-pl

      reg:
        description: Register Space for PL-SYSMON.
        maxItems: 1

      '#address-cells':
        const: 1

      '#size-cells':
        const: 0

    patternProperties:
      "^channel@([2-4][0-9]|50)$":
        type: object
        description:
          Describes the external channels connected.

        properties:
          reg:
            description:
              Pair of pins the channel is connected to. This value is
              same as Channel Number for a particular channel.
            minimum: 20
            maximum: 50

          xlnx,bipolar:
            $ref: /schemas/types.yaml#/definitions/flag
            type: boolean
            description:
              If the set channel is used in bipolar mode.

        required:
          - reg

        additionalProperties: false

required:
  - compatible
  - reg
  - clocks
  - ranges

additionalProperties: false

examples:
  - |
    #include <dt-bindings/clock/xlnx-zynqmp-clk.h>

    bus {
        #address-cells = <2>;
        #size-cells = <2>;

        xilinx_ams: ams@ffa50000 {
            compatible = "xlnx,zynqmp-ams";
            interrupt-parent = <&gic>;
            interrupts = <0 56 4>;
            reg = <0x0 0xffa50000 0x0 0x800>;
            clocks = <&zynqmp_clk AMS_REF>;
            #address-cells = <1>;
            #size-cells = <1>;
            #io-channel-cells = <1>;
            ranges = <0 0 0xffa50800 0x800>;

            ams_ps: ams-ps@0 {
                compatible = "xlnx,zynqmp-ams-ps";
                reg = <0 0x400>;
            };

            ams_pl: ams-pl@400 {
                compatible = "xlnx,zynqmp-ams-pl";
                reg = <0x400 0x400>;
                #address-cells = <1>;
                #size-cells = <0>;
                channel@30 {
                    reg = <30>;
                    xlnx,bipolar;
                };
                channel@31 {
                    reg = <31>;
                };
                channel@38 {
                    reg = <38>;
                    xlnx,bipolar;
                };
            };
        };
    };


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

title: Analog Devices AD74115H device

maintainers:
  - Cosmin Tanislav <cosmin.tanislav@analog.com>

description: |
  The AD74115H is a single-channel software configurable input/output
  device for industrial control applications. It contains functionality for
  analog output, analog input, digital output, digital input, resistance
  temperature detector, and thermocouple measurements integrated into a single
  chip solution with an SPI interface. The device features a 16-bit ADC and a
  14-bit DAC.

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

properties:
  compatible:
    enum:
      - adi,ad74115h

  reg:
    maxItems: 1

  spi-max-frequency:
    maximum: 24000000

  spi-cpol: true

  reset-gpios: true

  interrupts:
    minItems: 1
    maxItems: 2

  interrupt-names:
    minItems: 1
    maxItems: 2
    items:
      enum:
        - adc_rdy
        - alert

  avdd-supply: true
  avcc-supply: true
  dvcc-supply: true
  dovdd-supply: true
  refin-supply: true

  adi,ch-func:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      Channel function.
      0 - High impedance
      1 - Voltage output
      2 - Current output
      3 - Voltage input
      4 - Current input, externally-powered
      5 - Current input, loop-powered
      6 - Resistance input
      7 - RTD measure
      8 - Digital input logic
      9 - Digital input, loop-powered
      10 - Current output with HART
      11 - Current input, externally-powered, with HART
      12 - Current input, loop-powered, with HART
    minimum: 0
    maximum: 12
    default: 0

  adi,conv2-mux:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      Input node for ADC conversion 2.
      0 - SENSE_EXT1 to AGND_SENSE
      1 - SENSE_EXT2 to AGND_SENSE
      2 - SENSE_EXT2 to SENSE_EXT1
      3 - AGND to AGND
    minimum: 0
    maximum: 3
    default: 0

  adi,conv2-range-microvolt:
    description: Conversion range for ADC conversion 2.
    oneOf:
      - items:
          - enum: [-2500000, 0]
          - const: 2500000
      - items:
          - enum: [-12000000, 0]
          - const: 12000000
      - items:
          - const: -2500000
          - const: 0
      - items:
          - const: -104000
          - const: 104000
      - items:
          - const: 0
          - const: 625000

  adi,sense-agnd-buffer-low-power:
    type: boolean
    description:
      Whether to enable low-power buffered mode for the AGND sense pin.

  adi,lf-buffer-low-power:
    type: boolean
    description:
      Whether to enable low-power buffered mode for the low-side filtered
      sense pin.

  adi,hf-buffer-low-power:
    type: boolean
    description:
      Whether to enable low-power buffered mode for the high-side filtered
      sense pin.

  adi,ext2-buffer-low-power:
    type: boolean
    description: Whether to enable low-power buffered mode for the EXT2 pin.

  adi,ext1-buffer-low-power:
    type: boolean
    description: Whether to enable low-power buffered mode for the EXT1 pin.

  adi,comparator-invert:
    type: boolean
    description: Whether to invert the comparator output.

  adi,digital-input-sink-range-high:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      When not present, the digital input range is from 0 to 3700uA in steps
      of 120uA, with a ~2k series resistance.
      When present, the digital input range is from 0 to 7400uA in steps
      of 240uA, with a ~1k series resistance.

  adi,digital-input-sink-microamp:
    description: Sink current in digital input mode.
    minimum: 0
    maximum: 3700
    default: 0

  adi,digital-input-debounce-mode-counter-reset:
    type: boolean
    description: |
      When not present, a counter increments when the signal is asserted
      and decrements when the signal is de-asserted.
      When present, a counter increments while the signal is asserted and
      resets when the signal de-asserts

  adi,digital-input-unbuffered:
    type: boolean
    description: Whether to buffer digital input signals.

  adi,digital-input-short-circuit-detection:
    type: boolean
    description: Whether to detect digital input short circuits.

  adi,digital-input-open-circuit-detection:
    type: boolean
    description: Whether to detect digital input open circuits.

  adi,digital-input-threshold-mode-fixed:
    type: boolean
    description: |
      When not present, the digital input threshold range is -0.96 * AVDD
      to AVDD.
      When present, the threshold range is fixed from -19V to 30V.

  adi,dac-bipolar:
    type: boolean
    description: |
      When not present, the DAC operates in the 0V to 12V range.
      When present, the DAC operates in the -12V to 12V range.

  adi,charge-pump:
    type: boolean
    description: Whether to enable the internal charge pump.

  adi,dac-hart-slew:
    type: boolean
    description: Whether to use a HART-compatible slew rate.

  adi,dac-current-limit-low:
    type: boolean
    description: |
      When not present, the DAC short-circuit current limit is 32mA in
      either source or sink for VOUT and 4mA sink for IOUT.
      When present, the limit is 16mA in either source or sink for VOUT,
      1mA sink for IOUT.

  adi,4-wire-rtd:
    type: boolean
    description: |
      When not present, the ADC should be used for measuring 3-wire RTDs.
      When present, the ADC should be used for measuring 4-wire RTDs.

  adi,3-wire-rtd-excitation-swap:
    type: boolean
    description: Whether to swap the excitation for 3-wire RTD.

  adi,rtd-excitation-current-microamp:
    description: Excitation current to apply to RTD.
    enum: [250, 500, 750, 1000]
    default: 250

  adi,ext1-burnout:
    type: boolean
    description: Whether to enable burnout current for EXT1.

  adi,ext1-burnout-current-nanoamp:
    $ref: /schemas/types.yaml#/definitions/uint32
    description:
      Burnout current in nanoamps to be applied to EXT1.
    enum: [0, 50, 500, 1000, 10000]
    default: 0

  adi,ext1-burnout-current-polarity-sourcing:
    type: boolean
    description: |
      When not present, the burnout current polarity for EXT1 is sinking.
      When present, the burnout current polarity for EXT1 is sourcing.

  adi,ext2-burnout:
    type: boolean
    description: Whether to enable burnout current for EXT2.

  adi,ext2-burnout-current-nanoamp:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Burnout current in nanoamps to be applied to EXT2.
    enum: [0, 50, 500, 1000, 10000]
    default: 0

  adi,ext2-burnout-current-polarity-sourcing:
    type: boolean
    description: |
      When not present, the burnout current polarity for EXT2 is sinking.
      When present, the burnout current polarity for EXT2 is sourcing.

  adi,viout-burnout:
    type: boolean
    description: Whether to enable burnout current for VIOUT.

  adi,viout-burnout-current-nanoamp:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Burnout current in nanoamps to be applied to VIOUT.
    enum: [0, 1000, 10000]
    default: 0

  adi,viout-burnout-current-polarity-sourcing:
    type: boolean
    description: |
      When not present, the burnout current polarity for VIOUT is sinking.
      When present, the burnout current polarity for VIOUT is sourcing.

  adi,gpio0-mode:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      GPIO functions.
      0 - Disabled
      1 - Logic I/O
      2 - Comparator output
      3 - Control HART CD
      4 - Monitor HART CD
      5 - Monitor HART EOM status
    minimum: 0
    maximum: 5
    default: 0

  adi,gpio1-mode:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      GPIO functions.
      0 - Disabled
      1 - Logic I/O
      2 - Drive external digital output FET
      3 - Control HART RXD
      4 - Monitor HART RXD
      5 - Monitor HART SOM status
    minimum: 0
    maximum: 5
    default: 0

  adi,gpio2-mode:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      GPIO functions.
      0 - Disabled
      1 - Logic I/O
      2 - Drive internal digital output FET
      3 - Control HART TXD
      4 - Monitor HART TXD
      5 - Monitor HART TX complete status
    minimum: 0
    maximum: 5
    default: 0

  adi,gpio3-mode:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      GPIO functions.
      0 - Disabled
      1 - Logic I/O
      2 - High impedance
      3 - Control HART RTS
      4 - Monitor HART RTS
      5 - Monitor HART CD complete status
    minimum: 0
    maximum: 5
    default: 0

required:
  - compatible
  - reg
  - spi-cpol
  - avdd-supply

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#
  - if:
      required:
        - adi,digital-input-sink-range-high
    then:
      properties:
        adi,digital-input-sink-microamp:
          maximum: 7400

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>

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

      addac@0 {
        compatible = "adi,ad74115h";
        reg = <0>;

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

        reset-gpios = <&gpio 27 GPIO_ACTIVE_LOW>;

        interrupt-parent = <&gpio>;
        interrupts = <26 IRQ_TYPE_EDGE_FALLING>;
        interrupt-names = "adc_rdy";

        avdd-supply = <&ad74115_avdd>;

        adi,ch-func = <1>;
        adi,conv2-mux = <2>;
        adi,conv2-range-microvolt = <(-12000000) 12000000>;

        adi,gpio0-mode = <1>;
        adi,gpio1-mode = <1>;
        adi,gpio2-mode = <1>;
        adi,gpio3-mode = <1>;

        adi,dac-bipolar;
      };
    };
...


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

title: Analog Devices AD74412R/AD74413R device

maintainers:
  - Cosmin Tanislav <cosmin.tanislav@analog.com>

description: |
  The AD74412R and AD74413R are quad-channel software configurable input/output
  solutions for building and process control applications. They contain
  functionality for analog output, analog input, digital input, resistance
  temperature detector, and thermocouple measurements integrated
  into a single chip solution with an SPI interface.
  The devices feature a 16-bit ADC and four configurable 13-bit DACs to provide
  four configurable input/output channels and a suite of diagnostic functions.
  The AD74413R differentiates itself from the AD74412R by being HART-compatible.
    https://www.analog.com/en/products/ad74412r.html
    https://www.analog.com/en/products/ad74413r.html

properties:
  compatible:
    enum:
      - adi,ad74412r
      - adi,ad74413r

  reg:
    maxItems: 1

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

  spi-max-frequency:
    maximum: 1000000

  spi-cpol: true

  interrupts:
    maxItems: 1

  refin-supply: true

  shunt-resistor-micro-ohms:
    description:
      Shunt (sense) resistor value in micro-Ohms.
    default: 100000000

  reset-gpios:
    maxItems: 1

required:
  - compatible
  - reg
  - spi-max-frequency
  - spi-cpol
  - refin-supply

patternProperties:
  "^channel@[0-3]$":
    type: object
    additionalProperties: false
    description: Represents the external channels which are connected to the device.

    properties:
      reg:
        description: |
          The channel number. It can have up to 4 channels numbered from 0 to 3.
        minimum: 0
        maximum: 3

      adi,ch-func:
        $ref: /schemas/types.yaml#/definitions/uint32
        description: |
          Channel function.
          HART functions are not supported on AD74412R.
          0 - CH_FUNC_HIGH_IMPEDANCE
          1 - CH_FUNC_VOLTAGE_OUTPUT
          2 - CH_FUNC_CURRENT_OUTPUT
          3 - CH_FUNC_VOLTAGE_INPUT
          4 - CH_FUNC_CURRENT_INPUT_EXT_POWER
          5 - CH_FUNC_CURRENT_INPUT_LOOP_POWER
          6 - CH_FUNC_RESISTANCE_INPUT
          7 - CH_FUNC_DIGITAL_INPUT_LOGIC
          8 - CH_FUNC_DIGITAL_INPUT_LOOP_POWER
          9 - CH_FUNC_CURRENT_INPUT_EXT_POWER_HART
          10 - CH_FUNC_CURRENT_INPUT_LOOP_POWER_HART
        minimum: 0
        maximum: 10
        default: 0

      adi,gpo-comparator:
        type: boolean
        description: |
          Whether to configure GPO as a comparator or not.
          When not configured as a comparator, the GPO will be treated as an
          output-only GPIO.

    required:
      - reg

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

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>
    #include <dt-bindings/iio/addac/adi,ad74413r.h>

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

      addac@0 {
        compatible = "adi,ad74413r";
        reg = <0>;
        spi-max-frequency = <1000000>;
        spi-cpol;

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

        interrupt-parent = <&gpio>;
        interrupts = <26 IRQ_TYPE_EDGE_FALLING>;

        refin-supply = <&ad74413r_refin>;
        reset-gpios = <&gpio2 6 GPIO_ACTIVE_LOW>;

        channel@0 {
          reg = <0>;

          adi,ch-func = <CH_FUNC_VOLTAGE_OUTPUT>;
        };

        channel@1 {
          reg = <1>;

          adi,ch-func = <CH_FUNC_CURRENT_OUTPUT>;
        };

        channel@2 {
          reg = <2>;

          adi,ch-func = <CH_FUNC_DIGITAL_INPUT_LOGIC>;
          adi,gpo-comparator;
        };

        channel@3 {
          reg = <3>;

          adi,ch-func = <CH_FUNC_CURRENT_INPUT_EXT_POWER>;
        };
      };
    };
...


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

title: Current Sense Amplifier

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

description: |
  When an io-channel measures the output voltage from a current sense
  amplifier, the interesting measurement is almost always the current
  through the sense resistor, not the voltage output. This binding
  describes such a current sense circuit.

properties:
  compatible:
    const: current-sense-amplifier

  io-channels:
    maxItems: 1
    description: |
      Channel node of a voltage io-channel.

  sense-resistor-micro-ohms:
    description: The sense resistance.

  sense-gain-mult:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Amplifier gain multiplier. The default is <1>.

  sense-gain-div:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Amplifier gain divider. The default is <1>.

required:
  - compatible
  - io-channels
  - sense-resistor-micro-ohms

additionalProperties: false

examples:
  - |
    sysi {
        compatible = "current-sense-amplifier";
        io-channels = <&tiadc 0>;

        sense-resistor-micro-ohms = <20000>;
        sense-gain-mult = <50>;
    };
...


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

title: Current Sense Shunt

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

description: |
  When an io-channel measures the voltage over a current sense shunt,
  the interesting measurement is almost always the current through the
  shunt, not the voltage over it. This binding describes such a current
  sense circuit.

properties:
  compatible:
    const: current-sense-shunt

  io-channels:
    maxItems: 1
    description: |
      Channel node of a voltage io-channel.

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

  shunt-resistor-micro-ohms:
    description: The shunt resistance.

required:
  - compatible
  - io-channels
  - shunt-resistor-micro-ohms

additionalProperties: false

examples:
  - |
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;
        tiadc: adc@48 {
            compatible = "ti,ads1015";
            reg = <0x48>;
            #io-channel-cells = <1>;

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

            channel@0 { /* IN0,IN1 differential */
                reg = <0>;
                ti,gain = <1>;
                ti,datarate = <4>;
            };
        };
    };
    sysi {
        compatible = "current-sense-shunt";
        io-channels = <&tiadc 0>;
        #io-channel-cells = <0>;

        /* Divide the voltage by 3300000/1000000 (or 3.3) for the current. */
        shunt-resistor-micro-ohms = <3300000>;
    };
...


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

title: Temperature Sense RTD

maintainers:
  - Liam Beguin <liambeguin@gmail.com>

description: |
  RTDs (Resistance Temperature Detectors) are a kind of temperature sensors
  used to get a linear voltage to temperature reading within a give range
  (usually 0 to 100 degrees Celsius).

  When an io-channel measures the output voltage across an RTD such as a
  PT1000, the interesting measurement is almost always the corresponding
  temperature, not the voltage output. This binding describes such a circuit.

  The general transfer function here is (using SI units)

    V = R(T) * iexc
    R(T) = r0 * (1 + alpha * T)
    T = 1 / (alpha * r0 * iexc) * (V - r0 * iexc)

  The following circuit matches what's in the examples section.

           5V0
          -----
            |
        +---+----+
        |  R 5k  |
        +---+----+
            |
            V 1mA
            |
            +---- Vout
            |
        +---+----+
        | PT1000 |
        +---+----+
            |
          -----
           GND

properties:
  compatible:
    const: temperature-sense-rtd

  io-channels:
    maxItems: 1
    description: |
      Channel node of a voltage io-channel.

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

  excitation-current-microamp:
    description: The current fed through the RTD sensor.

  alpha-ppm-per-celsius:
    description: |
      alpha can also be expressed in micro-ohms per ohm Celsius. It's a linear
      approximation of the resistance versus temperature relationship
      between 0 and 100 degrees Celsius.

      alpha = (R_100 - R_0) / (100 * R_0)

      Where, R_100 is the resistance of the sensor at 100 degrees Celsius, and
      R_0 (or r-naught-ohms) is the resistance of the sensor at 0 degrees
      Celsius.

      Pure platinum has an alpha of 3925. Industry standards such as IEC60751
      and ASTM E-1137 specify an alpha of 3850.

  r-naught-ohms:
    description: |
      Resistance of the sensor at 0 degrees Celsius.
      Common values are 100 for PT100, 500 for PT500, and 1000 for PT1000

additionalProperties: false
required:
  - compatible
  - io-channels
  - excitation-current-microamp
  - alpha-ppm-per-celsius
  - r-naught-ohms

examples:
  - |
    pt1000_1: temperature-sensor0 {
        compatible = "temperature-sense-rtd";
        #io-channel-cells = <0>;
        io-channels = <&temp_adc1 0>;

        excitation-current-microamp = <1000>; /* i = U/R = 5 / 5000 */
        alpha-ppm-per-celsius = <3908>;
        r-naught-ohms = <1000>;
    };
...


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

title: Temperature Transducer

maintainers:
  - Liam Beguin <liambeguin@gmail.com>

description: |
  A temperature transducer is a device that converts a thermal quantity
  into any other physical quantity. This binding applies to temperature to
  voltage (like the LTC2997), and temperature to current (like the AD590)
  linear transducers.
  In both cases these are assumed to be connected to a voltage ADC.

  When an io-channel measures the output voltage of a temperature analog front
  end such as a temperature transducer, the interesting measurement is almost
  always the corresponding temperature, not the voltage output. This binding
  describes such a circuit.

  The general transfer function here is (using SI units)
    V(T) = Rsense * Isense(T)
    T = (Isense(T) / alpha) + offset
    T = 1 / (Rsense * alpha) * (V + offset * Rsense * alpha)

  When using a temperature to voltage transducer, Rsense is set to 1.

  The following circuits show a temperature to current and a temperature to
  voltage transducer that can be used with this binding.

           VCC
          -----
            |
        +---+---+
        | AD590 |                               VCC
        +---+---+                              -----
            |                                    |
            V proportional to T             +----+----+
            |                          D+ --+         |
            +---- Vout                      | LTC2997 +--- Vout
            |                          D- --+         |
        +---+----+                          +---------+
        | Rsense |                               |
        +---+----+                             -----
            |                                   GND
          -----
           GND

properties:
  compatible:
    const: temperature-transducer

  io-channels:
    maxItems: 1
    description: |
      Channel node of a voltage io-channel.

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

  sense-offset-millicelsius:
    description: |
      Temperature offset.
      This offset is commonly used to convert from Kelvins to degrees Celsius.
      In that case, sense-offset-millicelsius would be set to <(-273150)>.
    default: 0

  sense-resistor-ohms:
    description: |
      The sense resistor.
      By default sense-resistor-ohms cancels out the resistor making the
      circuit behave like a temperature transducer.
    default: 1

  alpha-ppm-per-celsius:
    description: |
      Sometimes referred to as output gain, slope, or temperature coefficient.

      alpha is expressed in parts per million which can be micro-amps per
      degrees Celsius or micro-volts per degrees Celsius. The is the main
      characteristic of a temperature transducer and should be stated in the
      datasheet.

additionalProperties: false

required:
  - compatible
  - io-channels
  - alpha-ppm-per-celsius

examples:
  - |
    ad950: temperature-sensor-0 {
        compatible = "temperature-transducer";
        #io-channel-cells = <0>;
        io-channels = <&temp_adc 3>;

        sense-offset-millicelsius = <(-273150)>; /* Kelvin to degrees Celsius */
        sense-resistor-ohms = <8060>;
        alpha-ppm-per-celsius = <1>; /* 1 uA/K */
    };
  - |
    znq_tmp: temperature-sensor-1 {
        compatible = "temperature-transducer";
        #io-channel-cells = <0>;
        io-channels = <&temp_adc 2>;

        sense-offset-millicelsius = <(-273150)>; /* Kelvin to degrees Celsius */
        alpha-ppm-per-celsius = <4000>; /* 4 mV/K */
    };
...


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

title: Voltage divider

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

description: |
  When an io-channel measures the midpoint of a voltage divider, the
  interesting voltage is often the voltage over the full resistance
  of the divider. This binding describes the voltage divider in such
  a curcuit.

    Vin ----.
            |
         .-----.
         |  R  |
         '-----'
            |
            +---- Vout
            |
         .-----.
         | Rout|
         '-----'
            |
           GND

properties:
  compatible:
    const: voltage-divider

  io-channels:
    maxItems: 1
    description: |
      Channel node of a voltage io-channel.

  output-ohms:
    description:
      Resistance Rout over which the output voltage is measured. See full-ohms.

  full-ohms:
    description:
      Resistance R + Rout for the full divider. The io-channel is scaled by
      the Rout / (R + Rout) quotient.

required:
  - compatible
  - io-channels
  - output-ohms
  - full-ohms

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    /*
     * The system voltage is circa 12V, but divided down with a 22/222
     * voltage divider (R = 200 Ohms, Rout = 22 Ohms) and fed to an ADC.
     */
    spi {
        #address-cells = <1>;
        #size-cells = <0>;
        maxadc: adc@0 {
            compatible = "maxim,max1027";
            reg = <0>;
            #io-channel-cells = <1>;
            interrupt-parent = <&gpio5>;
            interrupts = <15 IRQ_TYPE_EDGE_RISING>;
            spi-max-frequency = <1000000>;
        };
    };
    sysv {
        compatible = "voltage-divider";
        io-channels = <&maxadc 1>;

        /* Scale the system voltage by 22/222 to fit the ADC range. */
        output-ohms = <22>;
        full-ohms = <222>; /* 200 + 22 */
    };
...


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

title: ADA4250 Programmable Gain Instrumentation Amplifier

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

description: |
  Precision Low Power, 110kHz, 26uA, Programmable Gain Instrumentation Amplifier.

properties:
  compatible:
    enum:
      - adi,ada4250

  reg:
    maxItems: 1

  avdd-supply: true

  adi,refbuf-enable:
    description:
      Enable internal buffer to drive the reference pin.
    type: boolean

required:
  - compatible
  - reg
  - avdd-supply

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

unevaluatedProperties: false

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


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

title: HMC425A 6-bit Digital Step Attenuator

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

description: |
  Digital Step Attenuator IIO device with gpio interface.
  HMC425A 0.5 dB LSB GaAs MMIC 6-BIT DIGITAL POSITIVE CONTROL ATTENUATOR, 2.2 - 8.0 GHz
  https://www.analog.com/media/en/technical-documentation/data-sheets/hmc425A.pdf

properties:
  compatible:
    enum:
      - adi,hmc425a

  vcc-supply: true

  ctrl-gpios:
    description:
      Must contain an array of 6 GPIO specifiers, referring to the GPIO pins
      connected to the control pins V1-V6.
    minItems: 6
    maxItems: 6

required:
  - compatible
  - ctrl-gpios

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    gpio_hmc425a: hmc425a {
      compatible = "adi,hmc425a";
      ctrl-gpios = <&gpio 40 GPIO_ACTIVE_HIGH>,
        <&gpio 39 GPIO_ACTIVE_HIGH>,
        <&gpio 38 GPIO_ACTIVE_HIGH>,
        <&gpio 37 GPIO_ACTIVE_HIGH>,
        <&gpio 36 GPIO_ACTIVE_HIGH>,
        <&gpio 35 GPIO_ACTIVE_HIGH>;
      vcc-supply = <&foo>;
    };
...


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

title: Analog device AD7150 and similar capacitance to digital convertors.

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

properties:
  compatible:
    enum:
      - adi,ad7150
      - adi,ad7151
      - adi,ad7156

  reg:
    maxItems: 1

  vdd-supply: true

  interrupts: true

allOf:
  - if:
      properties:
        compatible:
          contains:
            enum:
              - adi,ad7150
              - adi,ad7156
    then:
      properties:
        interrupts:
          minItems: 2
          maxItems: 2
  - if:
      properties:
        compatible:
          contains:
            const: adi,ad7151
    then:
      properties:
        interrupts:
          minItems: 1
          maxItems: 1

required:
  - compatible
  - reg

additionalProperties: false

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

        cdc@48 {
            compatible = "adi,ad7150";
            reg = <0x48>;
            interrupts = <25 2>, <26 2>;
            interrupt-parent = <&gpio>;
        };
    };
...


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

title: AD7746 24-Bit Capacitance-to-Digital Converter with Temperature Sensor

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

description: |
  AD7746 24-Bit Capacitance-to-Digital Converter with Temperature Sensor

  Specifications about the part can be found at:
  https://www.analog.com/media/en/technical-documentation/data-sheets/ad7291.pdf

properties:
  compatible:
    enum:
      - adi,ad7745
      - adi,ad7746
      - adi,ad7747

  reg:
    maxItems: 1

  adi,excitation-vdd-permille:
    description: |
      Set VDD per mille to be used as the excitation voltage.
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [125, 250, 375, 500]

  adi,exca-output-en:
    description: Enables the EXCA pin as the excitation output.
    type: boolean

  adi,exca-output-invert:
    description: |
      Inverts the excitation output in the EXCA pin.
      Normally only one of the EXCX pins would be inverted, check the following
      application notes for more details
      https://www.analog.com/media/en/technical-documentation/application-notes/AN-1585.pdf
    type: boolean

  adi,excb-output-en:
    description: Enables the EXCB pin as the excitation output.
    type: boolean

  adi,excb-output-invert:
    description: Inverts the excitation output in the EXCB pin.
    type: boolean

required:
  - compatible
  - reg

additionalProperties: false

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

      ad7746: cdc@48 {
        compatible = "adi,ad7746";
        reg = <0x48>;
        adi,excitation-vdd-permille = <125>;

        adi,exca-output-en;
        adi,exca-output-invert;
        adi,excb-output-en;
        adi,excb-output-invert;
      };
    };
...