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

title: ADRF6780 Microwave Upconverter

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

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

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

properties:
  compatible:
    enum:
      - adi,adrf6780

  reg:
    maxItems: 1

  spi-max-frequency:
    maximum: 1000000

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

  clock-names:
    items:
      - const: lo_in

  clock-output-names:
    maxItems: 1

  adi,vga-buff-en:
    description:
      RF Variable Gain Amplifier Buffer Enable. Gain is controlled by
      the voltage on the VATT pin.
    type: boolean

  adi,lo-buff-en:
    description:
      Local Oscillator Amplifier Enable. Disable to put the part in
      a power down state.
    type: boolean

  adi,if-mode-en:
    description:
      Intermediate Frequency Mode Enable. Either IF Mode or I/Q Mode
      can be enabled at a time.
    type: boolean

  adi,iq-mode-en:
    description:
      I/Q Mode Enable. Either IF Mode or I/Q Mode can be enabled at a
      time.
    type: boolean

  adi,lo-x2-en:
    description:
      Double the Local Oscillator output frequency from the Local
      Oscillator Input Frequency. Either LOx1 or LOx2 can be enabled
      at a time.
    type: boolean

  adi,lo-ppf-en:
    description:
      Local Oscillator input frequency equal to the Local Oscillator
      output frequency (LO x1). Either LOx1 or LOx2 can be enabled
      at a time.
    type: boolean

  adi,lo-en:
    description:
      Enable additional cirtuitry in the LO chain. Disable to put the
      part in a power down state.
    type: boolean

  adi,uc-bias-en:
    description:
      Enable all bias circuitry thourghout the entire part.
      Disable to put the part in a power down state.
    type: boolean

  adi,lo-sideband:
    description:
      Switch to the Lower LO Sideband. By default the Upper LO
      sideband is enabled.
    type: boolean

  adi,vdet-out-en:
    description:
      VDET Output Select Enable. Expose the RF detector output to the
      VDET external pin.
    type: boolean

  '#clock-cells':
    const: 0

dependencies:
  adi,lo-x2-en: [ "adi,lo-en" ]
  adi,lo-ppf-en: [ "adi,lo-en" ]

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

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

unevaluatedProperties: false

examples:
  - |
    spi {
      #address-cells = <1>;
      #size-cells = <0>;
      adrf6780@0 {
        compatible = "adi,adrf6780";
        reg = <0>;
        spi-max-frequency = <1000000>;
        clocks = <&adrf6780_lo>;
        clock-names = "lo_in";
      };
    };
...


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

title: Analog Devices ADXRS290 Dual-Axis MEMS Gyroscope

maintainers:
  - Nishant Malpani <nish.malpani25@gmail.com>

description: |
  Bindings for the Analog Devices ADXRS290 dual-axis MEMS gyroscope device.
  https://www.analog.com/media/en/technical-documentation/data-sheets/ADXRS290.pdf

properties:
  compatible:
    const: adi,adxrs290

  reg:
    maxItems: 1

  spi-max-frequency:
    maximum: 5000000

  spi-cpol: true

  spi-cpha: true

  interrupts:
    maxItems: 1

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

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>;
        gyro@0 {
                   compatible = "adi,adxrs290";
                   reg = <0>;
                   spi-max-frequency = <5000000>;
                   spi-cpol;
                   spi-cpha;
                   interrupt-parent = <&gpio>;
                   interrupts = <25 IRQ_TYPE_EDGE_RISING>;
        };
    };
...

repo_name: angery/linux


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

title: Bosch BMG160 triaxial rotation sensor (gyroscope)

maintainers:
  - H. Nikolaus Schaller <hns@goldelico.com>

properties:
  compatible:
    enum:
      - bosch,bmg160
      - bosch,bmi055_gyro
      - bosch,bmi088_gyro

  reg:
    maxItems: 1

  vdd-supply: true
  vddio-supply: true

  interrupts:
    minItems: 1
    maxItems: 2
    description:
      Should be configured with type IRQ_TYPE_EDGE_RISING.
      If two interrupts are provided, expected order is INT1 and INT2.

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;
        gyroscope@69 {
            compatible = "bosch,bmg160";
            reg = <0x69>;
            interrupt-parent = <&gpio6>;
            interrupts = <18 IRQ_TYPE_EDGE_RISING>;
        };
    };
...


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

title: Invensense MPU-3050 Gyroscope

maintainers:
  - Linus Walleij <linus.walleij@linaro.org>

properties:
  compatible:
    const: invensense,mpu3050

  reg:
    maxItems: 1

  vdd-supply: true

  vlogic-supply: true

  interrupts:
    minItems: 1
    description:
      Interrupt mapping for the trigger interrupt from the internal oscillator.

  mount-matrix: true

  i2c-gate:
    $ref: /schemas/i2c/i2c-controller.yaml
    unevaluatedProperties: false
    description: |
      The MPU-3050 will pass through and forward the I2C signals from the
      incoming I2C bus, alternatively drive traffic to a slave device (usually
      an accelerometer) on its own initiative. Therefore is supports an
      i2c-gate subnode.

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;
        gyroscope@68 {
            compatible = "invensense,mpu3050";
            reg = <0x68>;
            interrupt-parent = <&foo>;
            interrupts = <12 IRQ_TYPE_EDGE_FALLING>;
            vdd-supply = <&bar>;
            vlogic-supply = <&baz>;

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

                magnetometer@c {
                    compatible = "asahi-kasei,ak8975";
                    reg = <0x0c>;
                };
            };
        };
    };
...


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

title: NXP FXAS21002C Gyroscope

maintainers:
  - Rui Miguel Silva <rmfrfs@gmail.com>

description: |
  3 axis digital gyroscope device with an I2C and SPI interface.
  http://www.nxp.com/products/sensors/gyroscopes/3-axis-digital-gyroscope:FXAS21002C

properties:
  compatible:
    const: nxp,fxas21002c

  reg:
    maxItems: 1

  vdd-supply:
    description: Regulator that provides power to the sensor

  vddio-supply:
    description: Regulator that provides power to the bus

  reset-gpios:
    maxItems: 1
    description: GPIO connected to reset

  interrupts:
    minItems: 1
    maxItems: 2
    description: Either interrupt may be triggered on rising or falling edges.

  interrupt-names:
    minItems: 1
    maxItems: 2
    items:
      enum:
        - INT1
        - INT2

  drive-open-drain:
    type: boolean
    description: the interrupt/data ready line will be configured as open drain,
                 which is useful if several sensors share the same interrupt
                 line.

  spi-max-frequency:
    maximum: 2000000

required:
  - compatible
  - reg

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

unevaluatedProperties: false

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

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

        gyroscope@20 {
          compatible = "nxp,fxas21002c";
          reg = <0x20>;

          vdd-supply = <&reg_peri_3p15v>;
          vddio-supply = <&reg_peri_3p15v>;

          interrupt-parent = <&gpio1>;
          interrupts = <7 IRQ_TYPE_EDGE_RISING>;
          interrupt-names = "INT1";
        };
    };
    spi0 {
        #address-cells = <1>;
        #size-cells = <0>;

        gyroscope@0 {
          compatible = "nxp,fxas21002c";
          reg = <0x0>;

          spi-max-frequency = <2000000>;

          interrupt-parent = <&gpio2>;
          interrupts = <7 IRQ_TYPE_EDGE_RISING>;
          interrupt-names = "INT2";
        };
    };


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

title: Maxim MAX30100 heart rate and pulse oximeter sensor

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

properties:
  compatible:
    const: maxim,max30100

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1
    description: Connected to ADC_RDY pin.

  maxim,led-current-microamp:
    minItems: 2
    maxItems: 2
    description: |
      LED current whilst the engine is running. First indexed value is
      the configuration for the RED LED, and second value is for the IR LED.

additionalProperties: false

required:
  - compatible
  - reg
  - interrupts

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

        heart-rate@57 {
            compatible = "maxim,max30100";
            reg = <0x57>;
            maxim,led-current-microamp = <24000 50000>;
            interrupt-parent = <&gpio1>;
            interrupts = <16 2>;
        };
    };
...


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

title: Maxim MAX30102 heart rate and pulse oximeter and MAX30105 particle-sensor

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

properties:
  compatible:
    enum:
      - maxim,max30102
      - maxim,max30105

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1
    description: Connected to ADC_RDY pin.

  maxim,red-led-current-microamp:
    description: RED LED current. Each step is approximately 200 microamps.
    minimum: 0
    maximum: 50800

  maxim,ir-led-current-microamp:
    description: IR LED current. Each step is approximately 200 microamps.
    minimum: 0
    maximum: 50800

  maxim,green-led-current-microamp:
    description: Green LED current. Each step is approximately 200 microamps.
    minimum: 0
    maximum: 50800

allOf:
  - if:
      properties:
        compatible:
          contains:
            const: maxim,max30100
    then:
      properties:
        maxim,green-led-current-microamp: false

additionalProperties: false

required:
  - compatible
  - reg
  - interrupts

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

        heart-rate@57 {
            compatible = "maxim,max30102";
            reg = <0x57>;
            maxim,red-led-current-microamp = <7000>;
            maxim,ir-led-current-microamp = <7000>;
            interrupt-parent = <&gpio1>;
            interrupts = <16 2>;
        };
    };
...


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

title: Texas Instruments AFE4403 Heart rate and Pulse Oximeter

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

properties:
  compatible:
    const: ti,afe4403

  reg:
    maxItems: 1

  tx-supply:
    description: Supply to transmitting LEDs.

  interrupts:
    maxItems: 1
    description: Connected to ADC_RDY pin.

  reset-gpios: true

required:
  - compatible
  - 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>
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        heart_mon@0 {
            compatible = "ti,afe4403";
            reg = <0>;
            spi-max-frequency = <10000000>;
            tx-supply = <&vbat>;
            interrupt-parent = <&gpio1>;
            interrupts = <28 IRQ_TYPE_EDGE_RISING>;
            reset-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
        };
    };
...


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

title: Texas Instruments AFE4404 Heart rate and Pulse Oximeter

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

properties:
  compatible:
    const: ti,afe4404

  reg:
    maxItems: 1

  tx-supply:
    description: Supply to transmitting LEDs.

  interrupts:
    maxItems: 1
    description: Connected to ADC_RDY pin.

  reset-gpios: true

additionalProperties: false

required:
  - compatible
  - reg

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

        heart_mon@58 {
            compatible = "ti,afe4404";
            reg = <0x58>;
            tx-supply = <&vbat>;
            interrupt-parent = <&gpio1>;
            interrupts = <28 IRQ_TYPE_EDGE_RISING>;
            reset-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
        };
    };
...


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

title: DHT11 humidity + temperature sensor

maintainers:
  - Harald Geyer <harald@ccbib.org>

description: |
   A simple and low cost module providing a non standard single GPIO based
   interface.  It is believed the part is made by aosong but don't have
   absolute confirmation of this, or what the aosong part number is.

properties:
  compatible:
    const: dht11

  reg:
    maxItems: 1

  gpios:
    maxItems: 1
    description:
      Single, interrupt capable, GPIO used to communicate with the device.

required:
  - compatible
  - gpios

additionalProperties: false

examples:
  - |
    humidity_sensor {
        compatible = "dht11";
        gpios = <&gpio0 6 0>;
    };
...


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

title: HTS221 STM humidity + temperature sensor

maintainers:
  - Lorenzo Bianconi <lorenzo@kernel.org>

description: |
   Humidity and temperature sensor with I2C interface and data ready
   interrupt.

properties:
  compatible:
    const: st,hts221

  reg:
    maxItems: 1

  drive-open-drain:
    type: boolean
    description:
      The interrupt/data ready line will be configured as open drain, which
      is useful if several sensors share the same interrupt line.

  vdd-supply: true

  interrupts:
    maxItems: 1

required:
  - compatible
  - reg

additionalProperties: false

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

        hts221@5f {
            compatible = "st,hts221";
            reg = <0x5f>;
            interrupt-parent = <&gpio0>;
            interrupts = <0 IRQ_TYPE_EDGE_RISING>;
        };
    };
...


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

title: HDC2010/HDC2080 humidity and temperature iio sensors

maintainers:
  - Eugene Zaikonnikov <ez@norophonic.com>

description: |
  Relative humidity and tempereature sensors on I2C bus

  Datasheets are available at:
    http://www.ti.com/product/HDC2010/datasheet
    http://www.ti.com/product/HDC2080/datasheet

properties:
  compatible:
    enum:
      - ti,hdc2010
      - ti,hdc2080

  vdd-supply: true

  reg:
    maxItems: 1

required:
  - compatible
  - reg

additionalProperties: false

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

      humidity@40 {
          compatible = "ti,hdc2010";
          reg = <0x40>;
      };
    };


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

title: Analog Devices AD5933/AD5934 Impedance Converter, Network Analyzer

maintainers:
  - Marcelo Schmitt <marcelo.schmitt1@gmail.com>
  - Gabriel Capella <gabriel@capella.pro>

description: |
  https://www.analog.com/media/en/technical-documentation/data-sheets/AD5933.pdf
  https://www.analog.com/media/en/technical-documentation/data-sheets/AD5934.pdf

properties:
  compatible:
    enum:
      - adi,ad5933
      - adi,ad5934

  reg:
    maxItems: 1

  vdd-supply:
    description: |
      The regulator supply for DVDD, AVDD1 and AVDD2 when they
      are connected together.  Used to calculate voltage scaling of measurement
      channels.

  clocks:
    maxItems: 1

  clock-names:
    const: mclk

additionalProperties: false

required:
  - compatible
  - reg
  - vdd-supply

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

        impedance-analyzer@d {
            compatible = "adi,ad5933";
            reg = <0x0d>;
            vdd-supply = <&vdd_supply>;
            clocks = <&ref_clk>;
            clock-names = "mclk";
        };
    };
...


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

title: Analog Devices ADIS16460 and similar IMUs

maintainers:
  - Dragos Bogdan <dragos.bogdan@analog.com>

description: |
  Analog Devices ADIS16460 and similar IMUs
  https://www.analog.com/media/en/technical-documentation/data-sheets/ADIS16460.pdf

properties:
  compatible:
    enum:
      - adi,adis16460

  reg:
    maxItems: 1

  spi-cpha: true

  spi-cpol: true

  interrupts:
    maxItems: 1

required:
  - compatible
  - reg
  - interrupts

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

unevaluatedProperties: false

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

        imu@0 {
            compatible = "adi,adis16460";
            reg = <0>;
            spi-max-frequency = <5000000>;
            spi-cpol;
            spi-cpha;
            interrupt-parent = <&gpio0>;
            interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
        };
    };


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

title: Analog Devices ADIS16475 and similar IMUs

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

description: |
  Analog Devices ADIS16475 and similar IMUs
  https://www.analog.com/media/en/technical-documentation/data-sheets/ADIS16475.pdf

properties:
  compatible:
    enum:
      - adi,adis16475-1
      - adi,adis16475-2
      - adi,adis16475-3
      - adi,adis16477-1
      - adi,adis16477-2
      - adi,adis16477-3
      - adi,adis16470
      - adi,adis16465-1
      - adi,adis16465-2
      - adi,adis16465-3
      - adi,adis16467-1
      - adi,adis16467-2
      - adi,adis16467-3
      - adi,adis16500
      - adi,adis16505-1
      - adi,adis16505-2
      - adi,adis16505-3
      - adi,adis16507-1
      - adi,adis16507-2
      - adi,adis16507-3

  reg:
    maxItems: 1

  spi-cpha: true

  spi-cpol: true

  spi-max-frequency:
    maximum: 2000000

  interrupts:
    maxItems: 1

  clocks:
    maxItems: 1

  reset-gpios:
    description:
      Must be the device tree identifier of the RESET pin. If specified,
      it will be asserted during driver probe. As the line is active low,
      it should be marked GPIO_ACTIVE_LOW.
    maxItems: 1

  adi,sync-mode:
    description:
      Configures the device SYNC pin. The following modes are supported
      0 - output_sync
      1 - direct_sync
      2 - scaled_sync
      3 - pulse_sync
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 0
    maximum: 3

required:
  - compatible
  - reg
  - interrupts
  - spi-cpha
  - spi-cpol

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#
  - if:
      properties:
        compatible:
          contains:
            enum:
              - adi,adis16500
              - adi,adis16505-1
              - adi,adis16505-2
              - adi,adis16505-3
              - adi,adis16507-1
              - adi,adis16507-2
              - adi,adis16507-3

    then:
      properties:
        adi,sync-mode:
          minimum: 0
          maximum: 2

  - if:
      properties:
        adi,sync-mode:
          enum: [1, 2, 3]

    then:
      dependencies:
        adi,sync-mode: [ clocks ]

unevaluatedProperties: false

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

            adis16475: adis16475-3@0 {
                    compatible = "adi,adis16475-3";
                    reg = <0>;
                    spi-cpha;
                    spi-cpol;
                    spi-max-frequency = <2000000>;
                    interrupts = <4 IRQ_TYPE_EDGE_RISING>;
                    interrupt-parent = <&gpio>;
            };
    };
...


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

title: Analog Devices ADIS16480 and similar IMUs

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

properties:
  compatible:
    enum:
      - adi,adis16375
      - adi,adis16480
      - adi,adis16485
      - adi,adis16488
      - adi,adis16490
      - adi,adis16495-1
      - adi,adis16495-2
      - adi,adis16495-3
      - adi,adis16497-1
      - adi,adis16497-2
      - adi,adis16497-3

  reg:
    maxItems: 1

  interrupts:
    minItems: 1
    maxItems: 2
    description: |
      Accepted interrupt types are:
      * IRQ_TYPE_EDGE_RISING
      * IRQ_TYPE_EDGE_FALLING

  interrupt-names:
    minItems: 1
    maxItems: 2
    description:
      Default if not supplied is DIO1.
    items:
      enum:
        - DIO1
        - DIO2
        - DIO3
        - DIO4

  spi-cpha: true
  spi-cpol: true

  reset-gpios:
    maxItems: 1
    description: Connected to RESET pin which is active low.

  clocks:
    maxItems: 1
    description: If not provided, then the internal clock is used.

  clock-names:
    description: |
      sync: In sync mode, the internal clock is disabled and the frequency
            of the external clock signal establishes therate of data
            collection and processing. See Fig 14 and 15 in the datasheet.
            The clock-frequency must be:
            * 3000 to 4500 Hz for adis1649x devices.
            * 700 to 2400 Hz for adis1648x devices.
      pps:  In Pulse Per Second (PPS) Mode, the rate of data collection and
            production is equal to the product of the external clock
            frequency and the scale factor in the SYNC_SCALE register, see
            Table 154 in the datasheet.
            The clock-frequency must be:
            * 1 to 128 Hz for adis1649x devices.
            * This mode is not supported by adis1648x devices.
    enum:
      - sync
      - pps

  adi,ext-clk-pin:
    $ref: /schemas/types.yaml#/definitions/string
    description: |
      The DIOx line to be used as an external clock input.
      Each DIOx pin supports only one function at a time (data ready line
      selection or external clock input). When a single pin has two
      two assignments, the enable bit for the lower priority function
      automatically resets to zero (disabling the lower priority function).
      Data ready has highest priority.
      If not provided then DIO2 is assigned as default external clock
      input pin.
    enum:
      - DIO1
      - DIO2
      - DIO3
      - DIO4

required:
  - compatible
  - reg
  - interrupts
  - spi-cpha
  - spi-cpol
  - spi-max-frequency

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

        imu@0 {
            compatible = "adi,adis16495-1";
            reg = <0>;
            spi-max-frequency = <3200000>;
            spi-cpol;
            spi-cpha;
            interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
            interrupt-parent = <&gpio>;
            interrupt-names = "DIO2";
            clocks = <&adis16495_sync>;
            clock-names = "sync";
            adi,ext-clk-pin = "DIO1";
        };
    };
...


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

title: Bosch BMI160

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

description: |
  Inertial Measurement Unit with Accelerometer, Gyroscope and externally
  connectable Magnetometer
  https://www.bosch-sensortec.com/bst/products/all_products/bmi160

properties:
  compatible:
    const: bosch,bmi160

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  interrupt-names:
    enum:
      - INT1
      - INT2
    description: |
      set to "INT1" if INT1 pin should be used as interrupt input, set
      to "INT2" if INT2 pin should be used instead

  drive-open-drain:
    description: |
      set if the specified interrupt pin should be configured as
      open drain. If not set, defaults to push-pull.

  vdd-supply:
    description: provide VDD power to the sensor.

  vddio-supply:
    description: provide VDD IO power to the sensor.

  mount-matrix:
    description: an optional 3x3 mounting rotation matrix

required:
  - compatible
  - reg

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

unevaluatedProperties: false

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

        bmi160@68 {
                compatible = "bosch,bmi160";
                reg = <0x68>;
                vdd-supply = <&pm8916_l17>;
                vddio-supply = <&pm8916_l6>;
                interrupt-parent = <&gpio4>;
                interrupts = <12 IRQ_TYPE_EDGE_RISING>;
                interrupt-names = "INT1";
                mount-matrix = "0", "1", "0",
                               "-1", "0", "0",
                               "0", "0", "1";
        };
    };
  - |
    // Example for SPI
    #include <dt-bindings/interrupt-controller/irq.h>
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        bmi160@0 {
                compatible = "bosch,bmi160";
                reg = <0>;
                spi-max-frequency = <10000000>;
                interrupt-parent = <&gpio2>;
                interrupts = <12 IRQ_TYPE_EDGE_RISING>;
                interrupt-names = "INT2";
        };
    };


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

title: Bosch BNO055

maintainers:
  - Andrea Merello <andrea.merello@iit.it>

description: |
  Inertial Measurement Unit with Accelerometer, Gyroscope, Magnetometer and
  internal MCU for sensor fusion
  https://www.bosch-sensortec.com/products/smart-sensors/bno055/

properties:
  compatible:
    enum:
      - bosch,bno055

  reg:
    maxItems: 1

  reset-gpios:
    maxItems: 1

  clocks:
    maxItems: 1

required:
  - compatible

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    serial {
      imu {
        compatible = "bosch,bno055";
        reset-gpios = <&gpio0 54 GPIO_ACTIVE_LOW>;
        clocks = <&imu_clk>;
      };
    };

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

      imu@28 {
        compatible = "bosch,bno055";
        reg = <0x28>;
        reset-gpios = <&gpio0 54 GPIO_ACTIVE_LOW>;
        clocks = <&imu_clk>;
      };
    };


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

title: InvenSense ICM-426xx Inertial Measurement Unit

maintainers:
  - Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>

description: |
  6-axis MotionTracking device that combines a 3-axis gyroscope and a 3-axis
  accelerometer.

  It has a configurable host interface that supports I3C, I2C and SPI serial
  communication, features a 2kB FIFO and 2 programmable interrupts with
  ultra-low-power wake-on-motion support to minimize system power consumption.

  Other industry-leading features include InvenSense on-chip APEX Motion
  Processing engine for gesture recognition, activity classification, and
  pedometer, along with programmable digital filters, and an embedded
  temperature sensor.

  https://invensense.tdk.com/wp-content/uploads/2020/03/DS-000292-ICM-42605-v1.4.pdf

properties:
  compatible:
    enum:
      - invensense,icm42600
      - invensense,icm42602
      - invensense,icm42605
      - invensense,icm42622
      - invensense,icm42631

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  drive-open-drain:
    type: boolean

  vdd-supply:
    description: Regulator that provides power to the sensor

  vddio-supply:
    description: Regulator that provides power to the bus

  spi-cpha: true
  spi-cpol: true

required:
  - compatible
  - reg
  - interrupts

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

unevaluatedProperties: false

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

        icm42605@68 {
          compatible = "invensense,icm42605";
          reg = <0x68>;
          interrupt-parent = <&gpio2>;
          interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
          vdd-supply = <&vdd>;
          vddio-supply = <&vddio>;
        };
    };
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>
    spi0 {
        #address-cells = <1>;
        #size-cells = <0>;

        icm42602@0 {
          compatible = "invensense,icm42602";
          reg = <0>;
          spi-max-frequency = <24000000>;
          spi-cpha;
          spi-cpol;
          interrupt-parent = <&gpio1>;
          interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
          vdd-supply = <&vdd>;
          vddio-supply = <&vddio>;
        };
    };


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

title: InvenSense MPU-6050 Six-Axis (Gyro + Accelerometer) MEMS MotionTracking Device

maintainers:
  - Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>

description: |
  These devices support both I2C and SPI bus interfaces.

properties:
  compatible:
    oneOf:
      - enum:
          - invensense,iam20680
          - invensense,icm20608
          - invensense,icm20609
          - invensense,icm20689
          - invensense,icm20602
          - invensense,icm20690
          - invensense,mpu6000
          - invensense,mpu6050
          - invensense,mpu6500
          - invensense,mpu6515
          - invensense,mpu6880
          - invensense,mpu9150
          - invensense,mpu9250
          - invensense,mpu9255
      - items:
          - const: invensense,icm20608d
          - const: invensense,icm20608

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  vdd-supply: true
  vddio-supply: true

  mount-matrix: true

  i2c-gate:
    $ref: /schemas/i2c/i2c-controller.yaml
    unevaluatedProperties: false
    description: |
      These devices also support an auxiliary i2c bus via an i2c-gate.

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#
  - if:
      not:
        properties:
          compatible:
            contains:
              enum:
                - invensense,mpu9150
                - invensense,mpu9250
                - invensense,mpu9255
    then:
      properties:
        i2c-gate: false

unevaluatedProperties: false

required:
  - compatible
  - reg
  - interrupts

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

        imu@68 {
            compatible = "invensense,mpu9250";
            reg = <0x68>;
            interrupt-parent = <&gpio3>;
            interrupts = <21 IRQ_TYPE_LEVEL_HIGH>;
            mount-matrix = "-0.984807753012208",  /* x0 */
                           "0",                   /* y0 */
                           "-0.173648177666930",  /* z0 */
                           "0",                   /* x1 */
                           "-1",                  /* y1 */
                           "0",                   /* z1 */
                           "-0.173648177666930",  /* x2 */
                           "0",                   /* y2 */
                           "0.984807753012208";   /* z2 */
            i2c-gate {
                #address-cells = <1>;
                #size-cells = <0>;
                magnetometer@c {
                    compatible = "asahi-kasei,ak8975";
                    reg = <0x0c>;
                };
            };
        };
    };
...


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

title: Freescale FXOS8700 Inertial Measurement Unit

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

description: |
  Accelerometer and magnetometer combo device with an i2c and SPI interface.
  https://www.nxp.com/products/sensors/motion-sensors/6-axis/digital-motion-sensor-3d-accelerometer-2g-4g-8g-plus-3d-magnetometer:FXOS8700CQ

properties:
  compatible:
    enum:
      - nxp,fxos8700

  reg:
    maxItems: 1

  interrupts:
    minItems: 1
    maxItems: 2

  interrupt-names:
    minItems: 1
    maxItems: 2
    items:
      enum:
        - INT1
        - INT2

  drive-open-drain:
    type: boolean

required:
  - compatible
  - 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>
    i2c0 {
        #address-cells = <1>;
        #size-cells = <0>;

        fxos8700@1e {
          compatible = "nxp,fxos8700";
          reg = <0x1e>;

          interrupt-parent = <&gpio2>;
          interrupts = <7 IRQ_TYPE_EDGE_RISING>;
          interrupt-names = "INT1";
        };
    };
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>
    spi0 {
        #address-cells = <1>;
        #size-cells = <0>;

        fxos8700@0 {
          compatible = "nxp,fxos8700";
          reg = <0>;

          spi-max-frequency = <1000000>;
          interrupt-parent = <&gpio1>;
          interrupts = <7 IRQ_TYPE_EDGE_RISING>;
          interrupt-names = "INT2";
        };
    };


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

title: STM 6-axis (acc + gyro) IMU Mems sensors

maintainers:
  - Lorenzo Bianconi <lorenzo@kernel.org>

description:
  Devices have both I2C and SPI interfaces.

properties:
  compatible:
    oneOf:
      - enum:
          - st,lsm6ds3
          - st,lsm6ds3h
          - st,lsm6dsl
          - st,lsm6dsm
          - st,ism330dlc
          - st,lsm6dso
          - st,asm330lhh
          - st,lsm6dsox
          - st,lsm6dsr
          - st,lsm6ds3tr-c
          - st,ism330dhcx
          - st,lsm9ds1-imu
          - st,lsm6ds0
          - st,lsm6dsrx
          - st,lsm6dst
          - st,lsm6dsop
          - st,lsm6dsv
          - st,lsm6dso16is
      - items:
          - const: st,asm330lhhx
          - const: st,lsm6dsr
      - items:
          - const: st,lsm6dstx
          - const: st,lsm6dst
      - items:
          - const: st,lsm6dsv16x
          - const: st,lsm6dsv
      - items:
          - const: st,ism330is
          - const: st,lsm6dso16is

  reg:
    maxItems: 1

  interrupts:
    minItems: 1
    maxItems: 2
    description:
      Supports up to 2 interrupt lines via the INT1 and INT2 pins.

  vdd-supply:
    description: if defined provides VDD power to the sensor.

  vddio-supply:
    description: if defined provides VDD IO power to the sensor.

  st,drdy-int-pin:
    $ref: '/schemas/types.yaml#/definitions/uint32'
    description: |
      The pin on the package that will be used to signal data ready
    enum:
      - 1
      - 2

  st,pullups:
    type: boolean
    description: enable/disable internal i2c controller pullup resistors.

  st,disable-sensor-hub:
    type: boolean
    description:
      Enable/disable internal i2c controller slave autoprobing at bootstrap.
      Disable sensor-hub is useful if i2c controller clock/data lines are
      connected through a pull-up with other chip lines (e.g. SDO/SA0).

  drive-open-drain:
    type: boolean
    description:
      The interrupt/data ready line will be configured as open drain, which
      is useful if several sensors share the same interrupt line.

  wakeup-source:
    $ref: /schemas/types.yaml#/definitions/flag

required:
  - compatible
  - reg

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

unevaluatedProperties: false

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

        imu@6b {
            compatible = "st,lsm6dsm";
            reg = <0x6b>;
            interrupt-parent = <&gpio0>;
            interrupts = <0 IRQ_TYPE_EDGE_RISING>;
        };
    };
...


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

title: Analog Devices ADUX1020 Photometric sensor

maintainers:
  - Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

description: |
  Photometric sensor over an i2c interface.
  https://www.analog.com/media/en/technical-documentation/data-sheets/ADUX1020.pdf

properties:
  compatible:
    enum:
      - adi,adux1020

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

required:
  - compatible
  - reg

additionalProperties: false

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

    i2c {

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

        adux1020@64 {
                compatible = "adi,adux1020";
                reg = <0x64>;
                interrupt-parent = <&msmgpio>;
                interrupts = <24 IRQ_TYPE_LEVEL_HIGH>;
        };
    };
...


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

title: AMS AS73211 JENCOLOR(R) Digital XYZ Sensor

maintainers:
  - Christian Eggers <ceggers@arri.de>

description: |
  XYZ True Color Sensor with I2C Interface
  https://ams.com/documents/20143/36005/AS73211_DS000556_3-01.pdf/a65474c0-b302-c2fd-e30a-c98df87616df

properties:
  compatible:
    enum:
      - ams,as73211

  reg:
    description:
      I2C address of the device (0x74...0x77).
    maxItems: 1

  interrupts:
    description:
      Interrupt specifier for the READY interrupt generated by the device.
    maxItems: 1

required:
  - compatible
  - reg

additionalProperties: false

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

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

        as73211@74 {
            compatible = "ams,as73211";
            reg = <0x74>;
            pinctrl-names = "default";
            pinctrl-0 = <&pinctrl_color_sensor>;
            interrupt-parent = <&gpio2>;
            interrupts = <19 IRQ_TYPE_EDGE_RISING>; /* READY */
        };
    };
...


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

title: AMS TAOS TSL2563 ambient light sensor

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

description: |
  Ambient light sensor with an i2c interface.

properties:
  compatible:
    enum:
      - amstaos,tsl2560
      - amstaos,tsl2561
      - amstaos,tsl2562
      - amstaos,tsl2563

  reg:
    maxItems: 1

  amstaos,cover-comp-gain:
    description: Multiplier for gain compensation
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [1, 16]

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    i2c {

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

      light-sensor@29 {
        compatible = "amstaos,tsl2563";
        reg = <0x29>;
        amstaos,cover-comp-gain = <16>;
      };
    };
...


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

title: AMS/TAOS TSL2591 Ambient Light Sensor (ALS)

maintainers:
  - Joe Sandom <joe.g.sandom@gmail.com>

description: |
  AMS/TAOS TSL2591 is a very-high sensitivity
  light-to-digital converter that transforms light intensity into a digital
  signal.

properties:
  compatible:
    const: amstaos,tsl2591

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1
    description:
      Interrupt (INT:Pin 2) Active low. Should be set to IRQ_TYPE_EDGE_FALLING.
      interrupt is used to detect if the light intensity has fallen below
      or reached above the configured threshold values.

required:
  - compatible
  - reg

additionalProperties: false

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

        tsl2591@29 {
            compatible = "amstaos,tsl2591";
            reg = <0x29>;
            interrupts = <20 IRQ_TYPE_EDGE_FALLING>;
       };
    };
...


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

title: Avago APDS9300 ambient light sensor

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

description: |
  Datasheet at https://www.avagotech.com/docs/AV02-1077EN

properties:
  compatible:
    const: avago,apds9300

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

additionalProperties: false

required:
  - compatible
  - reg

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

        light-sensor@39 {
            compatible = "avago,apds9300";
            reg = <0x39>;
            interrupt-parent = <&gpio2>;
            interrupts = <29 8>;
        };
    };
...


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

title: Avago APDS9960 gesture/RGB/ALS/proximity sensor

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

description: |
  Datasheet at https://www.avagotech.com/docs/AV02-4191EN

properties:
  compatible:
    const: avago,apds9960

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

additionalProperties: false

required:
  - compatible
  - reg

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

        light-sensor@39 {
            compatible = "avago,apds9960";
            reg = <0x39>;
            interrupt-parent = <&gpio1>;
            interrupts = <16 1>;
        };
    };
...


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

title: ROHM BH1750 ambient light sensor

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

description: |
  Ambient light sensor with an i2c interface.

properties:
  compatible:
    enum:
      - rohm,bh1710
      - rohm,bh1715
      - rohm,bh1721
      - rohm,bh1750
      - rohm,bh1751

  reg:
    maxItems: 1

required:
  - compatible
  - reg

additionalProperties: false

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

      light-sensor@23 {
        compatible = "rohm,bh1750";
        reg = <0x23>;
      };
    };

...


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

title:
  Capella Microsystems CM3605 Ambient Light and Short Distance Proximity Sensor

maintainers:
  - Linus Walleij <linus.walleij@linaro.org>
  - Kevin Tsai <ktsai@capellamicro.com>

description: |
  The CM3605 is an entirely analog part. However, it requires quite a bit of
  software logic to interface a host operating system.

  This ALS and proximity sensor was one of the very first deployed in mobile
  handsets, notably it is used in the very first Nexus One Android phone from
  2010.

properties:
  compatible:
    const: capella,cm3605

  aset-gpios:
    maxItems: 1
    description:
      ASET line (drive low to activate the ALS, should be flagged
      GPIO_ACTIVE_LOW)

  interrupts:
    maxItems: 1
    description:
      Connected to the POUT (proximity sensor out) line. The edge
      detection must be set to IRQ_TYPE_EDGE_BOTH so as to detect
      movements toward and away from the proximity sensor.

  io-channels:
    maxItems: 1
    description:
      ADC channel used for converting the voltage from AOUT to a digital
      representation.

  io-channel-names:
    const: aout

  vdd-supply: true

  capella,aset-resistance-ohms:
    enum: [50000, 100000, 300000, 600000]
    description: >
      Sensitivity calibration resistance. Note that calibration curves
      are only provided for specific allowed values. Default: 100 kOhms.

required:
  - compatible
  - aset-gpios
  - interrupts
  - io-channels
  - io-channel-names

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>
    light-sensor {
        compatible = "capella,cm3605";
        vdd-supply = <&foo_reg>;
        aset-gpios = <&foo_gpio 1 GPIO_ACTIVE_LOW>;
        capella,aset-resistance-ohms = <100000>;
        interrupts = <1 IRQ_TYPE_EDGE_BOTH>;
        io-channels = <&adc 0x01>;
        io-channel-names = "aout";
    };
...


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

title: Capella CM36651 I2C Proximity and Color Light sensor

maintainers:
  - Beomho Seo <beomho.seo@samsung.com>

properties:
  compatible:
    const: capella,cm36651

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  vled-supply:
    description: |
      Supply for the IR_LED which is part of the cm36651 for proximity detection.

additionalProperties: false

required:
  - compatible
  - reg
  - interrupts
  - vled-supply

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

        light-sensor@18 {
            compatible = "capella,cm36651";
            reg = <0x18>;
            interrupt-parent = <&gpx0>;
            interrupts = <2 0>;
            vled-supply = <&ps_als_reg>;
        };
    };
...


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

title: Dyna-Image AL3010 sensor

maintainers:
  - David Heidelberg <david@ixit.cz>

properties:
  compatible:
    const: dynaimage,al3010

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  vdd-supply:
    description: Regulator that provides power to the sensor

required:
  - compatible
  - reg

additionalProperties: false

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

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

        light-sensor@1c {
            compatible = "dynaimage,al3010";
            reg = <0x1c>;
            vdd-supply = <&vdd_reg>;
            interrupts = <0 99 4>;
        };
    };


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

title: Dyna-Image AL3320A sensor

maintainers:
  - David Heidelberg <david@ixit.cz>

properties:
  compatible:
    const: dynaimage,al3320a

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  vdd-supply:
    description: Regulator that provides power to the sensor

required:
  - compatible
  - reg

additionalProperties: false

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

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

        light-sensor@1c {
            compatible = "dynaimage,al3320a";
            reg = <0x1c>;
            vdd-supply = <&vdd_reg>;
            interrupts = <0 99 4>;
        };
    };


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

title: |
  Intersil 29018/29023/29035 Ambient Light, Infrared Light, and Proximity Sensor

maintainers:
  - Brian Masney <masneyb@onstation.org>

description: |
  Ambient and infrared light sensing with proximity detection over an i2c
  interface.

  https://www.renesas.com/us/en/www/doc/datasheet/isl29018.pdf
  https://www.renesas.com/us/en/www/doc/datasheet/isl29023.pdf
  https://www.renesas.com/us/en/www/doc/datasheet/isl29035.pdf

properties:
  compatible:
    enum:
      - isil,isl29018
      - isil,isl29023
      - isil,isl29035

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

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

required:
  - compatible
  - reg

additionalProperties: false

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

    i2c {

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

        sensor@44 {
                compatible = "isil,isl29018";
                reg = <0x44>;
                interrupts-extended = <&msmgpio 61 IRQ_TYPE_LEVEL_HIGH>;
        };
    };
...


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

title: LiteON LTR501 I2C Proximity and Light sensor

maintainers:
  - Nikita Travkin <nikita@trvn.ru>

allOf:
  - $ref: ../common.yaml#

properties:
  compatible:
    enum:
      - liteon,ltr501
      - liteon,ltr559
      - liteon,ltr301

  reg:
    maxItems: 1

  vdd-supply: true
  vddio-supply: true

  interrupts:
    maxItems: 1

  proximity-near-level: true

additionalProperties: false

required:
  - compatible
  - reg

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

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

        light-sensor@23 {
            compatible = "liteon,ltr559";
            reg = <0x23>;
            proximity-near-level = <75>;

            vdd-supply = <&pm8916_l17>;
            vddio-supply = <&pm8916_l6>;

            interrupt-parent = <&msmgpio>;
            interrupts = <115 IRQ_TYPE_EDGE_FALLING>;
        };
    };


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

title: LTRF216A Ambient Light Sensor

maintainers:
  - Shreeya Patel <shreeya.patel@collabora.com>

description:
  Ambient light sensing with an i2c interface.

properties:
  compatible:
    const: liteon,ltrf216a

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  vdd-supply:
    description: Regulator that provides power to the sensor.

required:
  - compatible
  - reg

additionalProperties: false

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

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

        light-sensor@53 {
            compatible = "liteon,ltrf216a";
            reg = <0x53>;
            vdd-supply = <&vdd_regulator>;
            interrupt-parent = <&gpio0>;
            interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
        };
    };


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

title: MAX44009 Ambient Light Sensor

maintainers:
  - Robert Eshleman <bobbyeshleman@gmail.com>

properties:
  compatible:
    const: maxim,max44009

  reg:
    maxItems: 1
    description: Default address is 0x4a

  interrupts:
    maxItems: 1
    description: Should be configured with type IRQ_TYPE_EDGE_FALLING

additionalProperties: false

required:
  - compatible
  - reg

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

        light-sensor@4a {
            compatible = "maxim,max44009";
            reg = <0x4a>;

            interrupt-parent = <&gpio1>;
            interrupts = <17 IRQ_TYPE_EDGE_FALLING>;
        };
    };
...


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

title: ON Semiconductor NOA1305 Ambient Light Sensor

maintainers:
  - Martyn Welch <martyn.welch@collabora.com>

description: |
  Ambient sensing with an i2c interface.

  https://www.onsemi.com/pub/Collateral/NOA1305-D.PDF

properties:
  compatible:
    enum:
      - onnn,noa1305

  reg:
    maxItems: 1

  vin-supply:
    description: Regulator that provides power to the sensor

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    i2c {

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

        light@39 {
                compatible = "onnn,noa1305";
                reg = <0x39>;
        };
    };
...


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

title: Sharp GP2AP002A00F and GP2AP002S00F proximity and ambient light sensors

maintainers:
  - Linus Walleij <linus.walleij@linaro.org>

description: |
  Proximity and ambient light sensor with IR LED for the proximity
  sensing and an analog output for light intensity. The ambient light
  sensor output is not available on the GP2AP002S00F variant.

properties:
  compatible:
    enum:
      - sharp,gp2ap002a00f
      - sharp,gp2ap002s00f

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1
    description: an interrupt for proximity, usually a GPIO line

  vdd-supply:
    description: VDD power supply a phandle to a regulator

  vio-supply:
    description: VIO power supply a phandle to a regulator

  io-channels:
    maxItems: 1
    description: ALSOUT ADC channel to read the ambient light

  io-channel-names:
    const: alsout

  sharp,proximity-far-hysteresis:
    $ref: /schemas/types.yaml#/definitions/uint8
    description: |
      Hysteresis setting for "far" object detection, this setting is
      device-unique and adjust the optical setting for proximity detection
      of a "far away" object in front of the sensor.

  sharp,proximity-close-hysteresis:
    $ref: /schemas/types.yaml#/definitions/uint8
    description: |
      Hysteresis setting for "close" object detection, this setting is
      device-unique and adjust the optical setting for proximity detection
      of a "close" object in front of the sensor.

required:
  - compatible
  - reg
  - interrupts
  - sharp,proximity-far-hysteresis
  - sharp,proximity-close-hysteresis

additionalProperties: false

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

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

      light-sensor@44 {
        compatible = "sharp,gp2ap002a00f";
        reg = <0x44>;
        interrupts = <18 IRQ_TYPE_EDGE_FALLING>;
        vdd-supply = <&vdd_regulator>;
        vio-supply = <&vio_regulator>;
        io-channels = <&adc_channel>;
        io-channel-names = "alsout";
        sharp,proximity-far-hysteresis = /bits/ 8 <0x2f>;
        sharp,proximity-close-hysteresis = /bits/ 8 <0x0f>;
      };
    };

...


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

title: Sharp GP2AP020A00F I2C Proximity/ALS sensor

maintainers:
  - Kyungmin Park <kyungmin.park@samsung.com>

description: |
  The proximity detector sensor requires power supply for its built-in led.

properties:
  compatible:
    const: sharp,gp2ap020a00f

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  vled-supply: true

additionalProperties: false

required:
  - compatible
  - reg
  - interrupts
  - vled-supply

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

        light-sensor@39 {
            compatible = "sharp,gp2ap020a00f";
            reg = <0x39>;
            interrupts = <2 0>;
            vled-supply = <&als_reg>;
        };
    };
...


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

title: ST UVIS25 uv sensor

maintainers:
  - Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>

properties:
  compatible:
    const: st,uvis25

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

additionalProperties: false

required:
  - compatible
  - reg

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

        uv-sensor@47 {
            compatible = "st,uvis25";
            reg = <0x47>;
            interrupt-parent = <&gpio0>;
            interrupts = <0 IRQ_TYPE_EDGE_RISING>;
        };
    };
...


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

title: STMicro VL6180 ALS, range and proximity sensor

maintainers:
  - Manivannan Sadhasivam <manivannanece23@gmail.com>
  - Peter Meerwald-Stadler <pmeerw@pmeerw.net>

description: |
  Proximity sensing module incorporating time of flight sensor
  Datasheet at https://www.st.com/resource/en/datasheet/vl6180x.pdf

properties:
  compatible:
    const: st,vl6180

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

additionalProperties: false

required:
  - compatible
  - reg

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

        proximity@29 {
            compatible = "st,vl6180";
            reg = <0x29>;
        };
    };
...


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

title: |
  Sensortek STK33xx I2C Ambient Light and Proximity sensor

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

description: |
  Ambient light and proximity sensor over an i2c interface.

allOf:
  - $ref: ../common.yaml#

properties:
  compatible:
    enum:
      - sensortek,stk3310
      - sensortek,stk3311
      - sensortek,stk3335

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  proximity-near-level: true

required:
  - compatible
  - reg

additionalProperties: false

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

    i2c {

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

        stk3310@48 {
                compatible = "sensortek,stk3310";
                reg = <0x48>;
                proximity-near-level = <25>;
                interrupt-parent = <&gpio1>;
                interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
        };
    };
...


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

title: Texas Instruments OPT3001 Ambient Light Sensor

maintainers:
  - Andreas Dannenberg <dannenberg@ti.com>

description: |
  The device supports interrupt-driven and interrupt-less operation, depending
  on whether an interrupt property has been populated into the DT.

properties:
  compatible:
    const: ti,opt3001

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1
    description: Should be configured with type IRQ_TYPE_EDGE_FALLING

additionalProperties: false

required:
  - compatible
  - reg

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

        light-sensor@44 {
            compatible = "ti,opt3001";
            reg = <0x44>;
            interrupt-parent = <&gpio1>;
            interrupts = <28 IRQ_TYPE_EDGE_FALLING>;
        };
    };
...


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

title: AMS/TAOS Ambient Light Sensor (ALS)

maintainers:
  - Brian Masney <masneyb@onstation.org>

description: |
  Ambient light sensing with an i2c interface.

properties:
  compatible:
    enum:
      - amstaos,tsl2580
      - amstaos,tsl2581
      - amstaos,tsl2583

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

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

required:
  - compatible
  - reg

additionalProperties: false

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

        light-sensor@29 {
                compatible = "amstaos,tsl2581";
                reg = <0x29>;
        };
    };
...


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

title: AMS/TAOS Ambient Light Sensor (ALS) and Proximity Detector

maintainers:
  - Brian Masney <masneyb@onstation.org>

description: |
  Ambient light sensing and proximity detection with an i2c interface.
  https://ams.com/documents/20143/36005/TSL2772_DS000181_2-00.pdf

properties:
  compatible:
    enum:
      - amstaos,tsl2571
      - amstaos,tsl2671
      - amstaos,tmd2671
      - amstaos,tsl2771
      - amstaos,tmd2771
      - amstaos,tsl2572
      - amstaos,tsl2672
      - amstaos,tmd2672
      - amstaos,tsl2772
      - amstaos,tmd2772
      - avago,apds9930

  reg:
    maxItems: 1

  amstaos,proximity-diodes:
    description: Proximity diodes to enable
    $ref: /schemas/types.yaml#/definitions/uint32-array
    minItems: 1
    maxItems: 2
    items:
      minimum: 0
      maximum: 1

  interrupts:
    maxItems: 1

  led-max-microamp:
    description: Current for the proximity LED
    enum:
      - 13000
      - 25000
      - 50000
      - 100000

  vdd-supply:
    description: Regulator that provides power to the sensor

  vddio-supply:
    description: Regulator that provides power to the bus

required:
  - compatible
  - reg

additionalProperties: false

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

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

        sensor@39 {
                compatible = "amstaos,tsl2772";
                reg = <0x39>;
                interrupts-extended = <&msmgpio 61 IRQ_TYPE_EDGE_FALLING>;
                vdd-supply = <&pm8941_l17>;
                vddio-supply = <&pm8941_lvs1>;
                amstaos,proximity-diodes = <0>;
                led-max-microamp = <100000>;
        };
    };
...


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

title: UPISEMI us5182d I2C ALS and Proximity sensor

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

properties:
  compatible:
    const: upisemi,usd5182

  reg:
    maxItems: 1

  upisemi,glass-coef:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      glass attenuation factor - compensation factor of resolution 1000
      for material transmittance.
    default: 1000

  upisemi,dark-ths:
    $ref: /schemas/types.yaml#/definitions/uint16-array
    minItems: 8
    maxItems: 8
    description:
      16-bit thresholds (adc counts) corresponding to every scale.

  upisemi,upper-dark-gain:
    $ref: /schemas/types.yaml#/definitions/uint8
    description: |
      8-bit dark gain compensation factor(4 int and 4 fractional bits - Q4.4)
      applied when light > threshold.
    default: 0

  upisemi,lower-dark-gain:
    $ref: /schemas/types.yaml#/definitions/uint8
    description: |
      8-bit dark gain compensation factor(4 int and 4 fractional bits - Q4.4)
      applied when light < threshold.
    default: 0x16

  upisemi,continuous:
    $ref: /schemas/types.yaml#/definitions/flag
    description: |
      This chip has two power modes: one-shot (chip takes one measurement and
      then shuts itself down) and continuous (chip takes continuous
      measurements). The one-shot mode is more power-friendly but the
      continuous mode may be more reliable. If this property is specified
      the continuous mode will be used instead of the default one-shot one for
      raw reads.

additionalProperties: false

required:
  - compatible
  - reg

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

        light-sensor@39 {
            compatible = "upisemi,usd5182";
            reg = <0x39>;
            upisemi,glass-coef = < 1000 >;
            upisemi,dark-ths = /bits/ 16 <170 200 512 512 800 2000 4000 8000>;
            upisemi,upper-dark-gain = /bits/ 8 <0x00>;
            upisemi,lower-dark-gain = /bits/ 8 <0x16>;
        };
    };
...


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

title: VEML6030 Ambient Light Sensor (ALS)

maintainers:
  - Rishi Gupta <gupt21@gmail.com>

description: |
  Bindings for the ambient light sensor veml6030 from Vishay
  Semiconductors over an i2c interface.

  Irrespective of whether interrupt is used or not, application
  can get the ALS and White channel reading from IIO raw interface.

  If the interrupts are used, application will receive an IIO event
  whenever configured threshold is crossed.

  Specifications about the sensor can be found at:
    https://www.vishay.com/docs/84366/veml6030.pdf

properties:
  compatible:
    enum:
      - vishay,veml6030

  reg:
    description:
      I2C address of the device.
    enum:
      - 0x10 # ADDR pin pulled down
      - 0x48 # ADDR pin pulled up

  interrupts:
    description:
      interrupt mapping for IRQ. Configure with IRQ_TYPE_LEVEL_LOW.
      Refer to interrupt-controller/interrupts.txt for generic
      interrupt client node bindings.
    maxItems: 1

required:
  - compatible
  - reg

additionalProperties: false

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

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

        light-sensor@10 {
                compatible = "vishay,veml6030";
                reg = <0x10>;
                interrupts = <12 IRQ_TYPE_LEVEL_LOW>;
        };
    };
...


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

title: VISHAY VCNL4000 ambient light and proximity sensor

maintainers:
  - Peter Meerwald <pmeerw@pmeerw.net>

description: |
  Ambient light sensing with proximity detection over an i2c
  interface.

allOf:
  - $ref: ../common.yaml#

properties:
  compatible:
    enum:
      - vishay,vcnl4000
      - vishay,vcnl4010
      - vishay,vcnl4020
      - vishay,vcnl4040
      - vishay,vcnl4200

  interrupts:
    maxItems: 1

  reg:
    maxItems: 1

  proximity-near-level: true

required:
  - compatible
  - reg

additionalProperties: false

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

        light-sensor@51 {
            compatible = "vishay,vcnl4200";
            reg = <0x51>;
            proximity-near-level = <220>;
        };
    };
...


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

title: VISHAY VCNL4035 ambient Light and proximity sensor

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

description: |
  Datasheet at https://www.vishay.com/docs/84251/vcnl4035x01.pdf

properties:
  compatible:
    const: vishay,vcnl4035

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

additionalProperties: false

required:
  - compatible
  - reg

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

        light-sensor@60 {
            compatible = "vishay,vcnl4035";
            reg = <0x60>;
            interrupt-parent = <&gpio4>;
            interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
        };
    };
...


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

title: Asahi Kasei AK8974 magnetometer sensor

maintainers:
  - Linus Walleij <linus.walleij@linaro.org>

properties:
  compatible:
    enum:
      - alps,hscdtd008a
      - asahi-kasei,ak8974

  reg:
    maxItems: 1

  interrupts:
    minItems: 1
    maxItems: 2
    description: |
      Data ready (DRDY) and interrupt (INT1) lines from the chip. The DRDY
      interrupt must be placed first. The interrupts can be triggered on
      rising or falling edges.

  avdd-supply: true

  dvdd-supply: true

  mount-matrix: true

additionalProperties: false

required:
  - compatible
  - reg

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

        magnetometer@f {
            compatible = "asahi-kasei,ak8974";
            reg = <0x0f>;
            avdd-supply = <&foo_reg>;
            dvdd-supply = <&bar_reg>;
            interrupts = <0 IRQ_TYPE_EDGE_RISING>,
                         <1 IRQ_TYPE_EDGE_RISING>;
        };
    };
...


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

title: AsahiKASEI AK8975 magnetometer sensor

maintainers:
  - Jonathan Albrieux <jonathan.albrieux@gmail.com>

properties:
  compatible:
    oneOf:
      - enum:
          - asahi-kasei,ak8975
          - asahi-kasei,ak8963
          - asahi-kasei,ak09911
          - asahi-kasei,ak09912
          - asahi-kasei,ak09916
      - enum:
          - ak8975
          - ak8963
          - ak09911
          - ak09912
          - ak09916
        deprecated: true

  reg:
    maxItems: 1

  gpios:
    maxItems: 1
    description: |
      AK8975 has a "Data ready" pin (DRDY) which informs that data
      is ready to be read and is possible to listen on it. If used,
      this should be active high. Prefer interrupt over this.

  interrupts:
    maxItems: 1
    description: interrupt for DRDY pin. Triggered on rising edge.

  vdd-supply:
    description: |
      an optional regulator that needs to be on to provide VDD power to
      the sensor.

  vid-supply:
    description: |
      an optional regulator that needs to be on to provide VID power to
      the sensor.

  mount-matrix:
    description: an optional 3x3 mounting rotation matrix.

  reset-gpios:
    maxItems: 1
    description: |
      an optional pin needed for AK09911 to set the reset state. This should
      be usually active low

required:
  - compatible
  - reg

additionalProperties: false

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

        magnetometer@c {
            compatible = "asahi-kasei,ak8975";
            reg = <0x0c>;
            interrupt-parent = <&gpio6>;
            interrupts = <15 IRQ_TYPE_EDGE_RISING>;
            vdd-supply = <&ldo_3v3_gnss>;
            reset-gpios = <&msmgpio 111 GPIO_ACTIVE_LOW>;
            mount-matrix = "-0.984807753012208",  /* x0 */
                           "0",                   /* y0 */
                           "-0.173648177666930",  /* z0 */
                           "0",                   /* x1 */
                           "-1",                  /* y1 */
                           "0",                   /* z1 */
                           "-0.173648177666930",  /* x2 */
                           "0",                   /* y2 */
                           "0.984807753012208";   /* z2 */
        };
    };


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

title: Bosch BMC150 magnetometer sensor

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

description: |
  Supports a range of parts, some of which form part of a multi die
  package that also contains other sensors.  The interface is independent
  however, so a separate driver is used to support the magnetometer part.
  Datasheet at:
  http://ae-bst.resource.bosch.com/media/products/dokumente/bmc150/BST-BMC150-DS000-04.pdf

properties:
  compatible:
    description:
      Note the bmm150_magn is a deprecated compatible as this part contains only
      a magnetometer.
    enum:
      - bosch,bmc150_magn
      - bosch,bmc156_magn
      - bosch,bmm150
      - bosch,bmm150_magn

  reg:
    maxItems: 1

  vdd-supply: true
  vddio-supply: true

  interrupts:
    maxItems: 1

additionalProperties: false

required:
  - compatible
  - reg

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

        magnetometer@12 {
            compatible = "bosch,bmc150_magn";
            reg = <0x12>;
            interrupt-parent = <&gpio1>;
            interrupts = <0 1>;
        };
    };
...


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

title: Freescale MAG3110 magnetometer sensor

maintainers:
  - Anson Huang <Anson.Huang@nxp.com>

properties:
  compatible:
    const: fsl,mag3110

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  vdd-supply: true

  vddio-supply: true

additionalProperties: false

required:
  - compatible
  - reg

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

        magnetometer@e {
            compatible = "fsl,mag3110";
            reg = <0x0e>;
            pinctrl-names = "default";
            pinctrl-0 = <&pinctrl_i2c3_mag3110_int>;
            interrupt-parent = <&gpio3>;
            interrupts = <16 IRQ_TYPE_EDGE_RISING>;
        };
    };
...


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

title: Honeywell HMC5843 magnetometer sensor

maintainers:
  - Neil Brown <neilb@suse.de>

properties:
  compatible:
    enum:
      - honeywell,hmc5843
      - honeywell,hmc5883
      - honeywell,hmc5883l
      - honeywell,hmc5983

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

additionalProperties: false

required:
  - compatible
  - reg

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

        magnetometer@1e {
            compatible = "honeywell,hmc5843";
            reg = <0x1e>;
        };
    };
...


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

title: PNI RM3100 3-axis magnetometer sensor

maintainers:
  - Song Qiang <songqiang1304521@gmail.com>

properties:
  compatible:
    const: pni,rm3100

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

additionalProperties: false

required:
  - compatible
  - reg

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

        magnetometer@20 {
            compatible = "pni,rm3100";
            reg = <0x20>;
            interrupt-parent = <&gpio0>;
            interrupts = <4 IRQ_TYPE_LEVEL_HIGH>;
        };
    };
...


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

title: Yamaha YAS530 family of magnetometer sensors

maintainers:
  - Linus Walleij <linus.walleij@linaro.org>

description:
  The Yamaha YAS530 magnetometers is a line of 3-axis magnetometers
  first introduced by Yamaha in 2009 with the YAS530. They are successors
  of Yamaha's first magnetometer YAS529. Over the years this magnetometer
  has been miniaturized and appeared in a number of different variants.

properties:
  $nodename:
    pattern: '^magnetometer@[0-9a-f]+$'

  compatible:
    items:
      - enum:
          - yamaha,yas530
          - yamaha,yas532
          - yamaha,yas533
          - yamaha,yas535
          - yamaha,yas536
          - yamaha,yas537
          - yamaha,yas539

  reg:
    maxItems: 1

  reset-gpios:
    maxItems: 1
    description: The YAS530 sensor has a RSTN pin used to reset
      the logic inside the sensor. This GPIO line should connect
      to that pin and be marked as GPIO_ACTIVE_LOW.

  interrupts:
    maxItems: 1
    description: Interrupt for INT pin for interrupt generation.
      The polarity, whether the interrupt is active on the rising
      or the falling edge, is software-configurable in the hardware.

  vdd-supply:
    description: An optional regulator providing core power supply
      on the VDD pin, typically 1.8 V or 3.0 V.

  iovdd-supply:
    description: An optional regulator providing I/O power supply
      for the I2C interface on the IOVDD pin, typically 1.8 V.

  mount-matrix:
    description: An optional 3x3 mounting rotation matrix.

allOf:
  - if:
      not:
        properties:
          compatible:
            items:
              const: yamaha,yas530
    then:
      properties:
        reset-gpios: false

  - if:
      properties:
        compatible:
          items:
            const: yamaha,yas539
    then:
      properties:
        interrupts: false

required:
  - compatible
  - reg

additionalProperties: false

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

        magnetometer@2e {
          compatible = "yamaha,yas530";
          reg = <0x2e>;
          vdd-supply = <&ldo1_reg>;
          iovdd-supply = <&ldo2_reg>;
          reset-gpios = <&gpio6 12 GPIO_ACTIVE_LOW>;
          interrupts = <13 IRQ_TYPE_EDGE_RISING>;
        };
    };

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

        magnetometer@2e {
          compatible = "yamaha,yas539";
          reg = <0x2e>;
          vdd-supply = <&ldo1_reg>;
        };
    };


code:
For discussion. Unclear are:
* is the definition of +/- values practical or counterintuitive?
* are the definitions unambiguous and easy to follow?
* are the examples correct?
* should we have HOWTO engineer a correct matrix for a new device (without comparing to a different one)?

====

Mounting matrix

The mounting matrix is a device tree property used to orient any device
that produce three-dimensional data in relation to the world where it is
deployed.

The purpose of the mounting matrix is to translate the sensor frame of
reference into the device frame of reference using a translation matrix as
defined in linear algebra.

The typical usecase is that where a component has an internal representation
of the (x,y,z) triplets, such as different registers to read these coordinates,
and thus implying that the component should be mounted in a certain orientation
relative to some specific device frame of reference.

For example a device with some kind of screen, where the user is supposed to
interact with the environment using an accelerometer, gyroscope or magnetometer
mounted on the same chassis as this screen, will likely take the screen as
reference to (x,y,z) orientation, with (x,y) corresponding to these axes on the
screen and (z) being depth, the axis perpendicular to the screen.

For a screen you probably want (x) coordinates to go from negative on the left
to positive on the right, (y) from negative on the bottom to positive on top
and (z) depth to be negative under the screen and positive in front of it,
toward the face of the user.

A sensor can be mounted in any angle along the axes relative to the frame of
reference. This means that the sensor may be flipped upside-down, left-right,
or tilted at any angle relative to the frame of reference.

Another frame of reference is how the device with its sensor relates to the
external world, the environment where the device is deployed. Usually the data
from the sensor is used to figure out how the device is oriented with respect
to this world. When using the mounting matrix, the sensor and device orientation
becomes identical and we can focus on the data as it relates to the surrounding
world.

Device-to-world examples for some three-dimensional sensor types:

- Accelerometers have their world frame of reference toward the center of
  gravity, usually to the core of the planet. A reading of the (x,y,z) values
  from the sensor will give a projection of the gravity vector through the
  device relative to the center of the planet, i.e. relative to its surface at
  this point. Up and down in the world relative to the device frame of
  reference can thus be determined. and users would likely expect a value of
  9.81 m/s^2 upwards along the (z) axis, i.e. out of the screen when the device
  is held with its screen flat on the planets surface and 0 on the other axes,
  as the gravity vector is projected 1:1 onto the sensors (z)-axis.

  If you tilt the device, the g vector virtually coming out of the display
  is projected onto the (x,y) plane of the display panel.

  Example:

         ^ z: +g                   ^ z: > 0
         !                        /!
         ! x=y=0                 / ! x: > 0
     +--------+             +--------+
     !        !             !        !
     +--------+             +--------+
         !                    /
         !                   /
         v                  v
      center of         center of
       gravity           gravity

  If the device is tilted to the left, you get a positive x value. If you point
  its top towards surface, you get a negative y axis.

     (---------)
     !         !           y: -g
     !         !             ^
     !         !             !
     !         !
     !         !  x: +g <- z: +g  -> x: -g
     ! 1  2  3 !
     ! 4  5  6 !             !
     ! 7  8  9 !             v
     ! *  0  # !           y: +g
     (---------)

- Magnetometers (compasses) have their world frame of reference relative to the
  geomagnetic field. The system orientation vis-a-vis the world is defined with
  respect to the local earth geomagnetic reference frame where (y) is in the
  ground plane and positive towards magnetic North, (x) is in the ground plane,
  perpendicular to the North axis and positive towards the East and (z) is
  perpendicular to the ground plane and positive upwards.

     ^^^ North: y > 0

     (---------)
     !         !
     !         !
     !         !
     !         !  >
     !         !  > North: x > 0
     ! 1  2  3 !  >
     ! 4  5  6 !
     ! 7  8  9 !
     ! *  0  # !
     (---------)

  Since the geomagnetic field is not uniform this definition fails if we come
  closer to the poles.

  Sensors and driver can not and should not take care of this because there
  are complex calculations and empirical data to be taken care of. We leave
  this up to user space.

  The definition we take:

  If the device is placed at the equator and the top is pointing north, the
  display is readable by a person standing upright on the earth surface, this
  defines a positive y value.

- Gyroscopes detects the movement relative the device itself. The angular
  velocity is defined as orthogonal to the plane of rotation, so if you put the
  device on a flat surface and spin it around the z axis (such as rotating a
  device with a screen lying flat on a table), you should get a negative value
  along the (z) axis if rotated clockwise, and a positive value if rotated
  counter-clockwise according to the right-hand rule.

     (---------)     y > 0
     !         !     v---\
     !         !
     !         !
     !         !      <--\
     !         !         ! z > 0
     ! 1  2  3 !       --/
     ! 4  5  6 !
     ! 7  8  9 !
     ! *  0  # !
     (---------)

So unless the sensor is ideally mounted, we need a means to indicate the
relative orientation of any given sensor of this type with respect to the
frame of reference.

To achieve this, use the device tree property "mount-matrix" for the sensor.

This supplies a 3x3 rotation matrix in the strict linear algebraic sense,
to orient the senor axes relative to a desired point of reference. This means
the resulting values from the sensor, after scaling to proper units, should be
multiplied by this matrix to give the proper vectors values in three-dimensional
space, relative to the device or world point of reference.

For more information, consult:
https://en.wikipedia.org/wiki/Rotation_matrix

The mounting matrix has the layout:

 (mxx, myx, mzx)
 (mxy, myy, mzy)
 (mxz, myz, mzz)

Values are intended to be multiplied as:

  x' = mxx * x + myx * y + mzx * z
  y' = mxy * x + myy * y + mzy * z
  z' = mxz * x + myz * y + mzz * z

It is represented as an array of strings containing the real values for
producing the transformation matrix.

Examples:

Identity matrix (nothing happens to the coordinates, which means the device was
mechanically mounted in an ideal way and we need no transformation):

mount-matrix = "1", "0", "0",
               "0", "1", "0",
               "0", "0", "1";

The sensor is mounted 30 degrees (Pi/6 radians) tilted along the X axis, so we
compensate by performing a -30 degrees rotation around the X axis:

mount-matrix = "1", "0", "0",
               "0", "0.866", "0.5",
               "0", "-0.5", "0.866";

The sensor is flipped 180 degrees (Pi radians) around the Z axis, i.e. mounted
upside-down:

mount-matrix = "0.998", "0.054", "0",
               "-0.054", "0.998", "0",
               "0", "0", "1";

???: this does not match "180 degrees" - factors indicate ca. 3 degrees compensation


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

title: I/O channel multiplexer bindings

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

description: |
  If a multiplexer is used to select which hardware signal is fed to
  e.g. an ADC channel, these bindings describe that situation.

  For each non-empty string in the channels property, an io-channel will be
  created. The number of this io-channel is the same as the index into the list
  of strings in the channels property, and also matches the mux controller
  state. The mux controller state is described in
  Documentation/devicetree/bindings/mux/mux-controller.yaml

properties:

  compatible:
    const: io-channel-mux

  io-channels:
    maxItems: 1
    description: Channel node of the parent channel that has multiplexed input.

  io-channel-names:
    const: parent

  mux-controls: true
  mux-control-names: true

  channels:
    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
    description:
      List of strings, labeling the mux controller states. An empty
      string for a state means that the channel is not available.

  settle-time-us:
    default: 0
    description:
      Time required for analog signals to settle after muxing.

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

required:
  - compatible
  - io-channels
  - io-channel-names
  - mux-controls
  - channels

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    mux: mux-controller {
      compatible = "gpio-mux";
      #mux-control-cells = <0>;

      mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>,
                  <&pioA 1 GPIO_ACTIVE_HIGH>;
    };

    adc-mux {
      compatible = "io-channel-mux";
      io-channels = <&adc 0>;
      io-channel-names = "parent";

      mux-controls = <&mux>;
      channels = "sync", "in", "system-regulator";
    };
...


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

title: Analog Devices AD5272 digital potentiometer

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

description: |
  Datasheet: https://www.analog.com/en/products/ad5272.html

properties:
  compatible:
    enum:
      - adi,ad5272-020
      - adi,ad5272-050
      - adi,ad5272-100
      - adi,ad5274-020
      - adi,ad5274-100

  reg:
    maxItems: 1

  reset-gpios:
    maxItems: 1
    description:
      Active low signal to the AD5272 RESET input.

additionalProperties: false

required:
  - compatible
  - reg

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

        potentiometer@2f {
            compatible = "adi,ad5272-020";
            reg = <0x2F>;
            reset-gpios = <&gpio3 6 GPIO_ACTIVE_LOW>;
        };
    };
...


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

title: Maxim Integrated MAX5432-MAX5435 Digital Potentiometers

maintainers:
  - Martin Kaiser <martin@kaiser.cx>

description: |
  Maxim Integrated MAX5432-MAX5435 Digital Potentiometers connected via I2C

  Datasheet:
    https://datasheets.maximintegrated.com/en/ds/MAX5432-MAX5435.pdf

properties:
  compatible:
    enum:
      - maxim,max5432
      - maxim,max5433
      - maxim,max5434
      - maxim,max5435

  reg:
    maxItems: 1

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    i2c {
      #address-cells = <1>;
      #size-cells = <0>;
      max5434@28 {
        compatible = "maxim,max5434";
        reg = <0x28>;
      };
    };


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

title: Microchip MCP41010/41050/41100/42010/42050/42100 Digital Potentiometer

maintainers:
  - Chris Coffey <cmc@babblebit.net>

description: |
  Datasheet: https://ww1.microchip.com/downloads/en/devicedoc/11195c.pdf

properties:
  compatible:
    enum:
      - microchip,mcp41010
      - microchip,mcp41050
      - microchip,mcp41100
      - microchip,mcp42010
      - microchip,mcp42050
      - microchip,mcp42100

  reg:
    maxItems: 1

required:
  - compatible
  - reg

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

unevaluatedProperties: false

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

        potentiometer@0 {
            compatible = "microchip,mcp41010";
            reg = <0>;
            spi-max-frequency = <500000>;
        };
    };
...


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

title: Microchip MCP413X/414X/415X/416X/423X/424X/425X/426X Digital Potentiometer

maintainers:
  - Slawomir Stepien <sst@poczta.fm>

properties:
  compatible:
    enum:
      - microchip,mcp4131-103
      - microchip,mcp4131-104
      - microchip,mcp4131-502
      - microchip,mcp4131-503
      - microchip,mcp4132-103
      - microchip,mcp4132-104
      - microchip,mcp4132-502
      - microchip,mcp4132-503
      - microchip,mcp4141-103
      - microchip,mcp4141-104
      - microchip,mcp4141-502
      - microchip,mcp4141-503
      - microchip,mcp4142-103
      - microchip,mcp4142-104
      - microchip,mcp4142-502
      - microchip,mcp4142-503
      - microchip,mcp4151-103
      - microchip,mcp4151-104
      - microchip,mcp4151-502
      - microchip,mcp4151-503
      - microchip,mcp4152-103
      - microchip,mcp4152-104
      - microchip,mcp4152-502
      - microchip,mcp4152-503
      - microchip,mcp4161-103
      - microchip,mcp4161-104
      - microchip,mcp4161-502
      - microchip,mcp4161-503
      - microchip,mcp4162-103
      - microchip,mcp4162-104
      - microchip,mcp4162-502
      - microchip,mcp4162-503
      - microchip,mcp4231-103
      - microchip,mcp4231-104
      - microchip,mcp4231-502
      - microchip,mcp4231-503
      - microchip,mcp4232-103
      - microchip,mcp4232-104
      - microchip,mcp4232-502
      - microchip,mcp4232-503
      - microchip,mcp4241-103
      - microchip,mcp4241-104
      - microchip,mcp4241-502
      - microchip,mcp4241-503
      - microchip,mcp4242-103
      - microchip,mcp4242-104
      - microchip,mcp4242-502
      - microchip,mcp4242-503
      - microchip,mcp4251-103
      - microchip,mcp4251-104
      - microchip,mcp4251-502
      - microchip,mcp4251-503
      - microchip,mcp4252-103
      - microchip,mcp4252-104
      - microchip,mcp4252-502
      - microchip,mcp4252-503
      - microchip,mcp4261-103
      - microchip,mcp4261-104
      - microchip,mcp4261-502
      - microchip,mcp4261-503
      - microchip,mcp4262-103
      - microchip,mcp4262-104
      - microchip,mcp4262-502
      - microchip,mcp4262-503

  reg:
    maxItems: 1

required:
  - compatible
  - reg

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

unevaluatedProperties: false

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

        potentiometer@0 {
            compatible = "microchip,mcp4131-502";
            reg = <0>;
            spi-max-frequency = <500000>;
        };
    };
...