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

title: Moortec Semiconductor MR75203 PVT Controller bindings

maintainers:
  - Rahul Tanwar <rtanwar@maxlinear.com>

description: |
  A Moortec PVT (Process, Voltage, Temperature) monitoring logic design can
  include many different units.
  Such a design will usually consists of several Moortec's embedded analog IPs,
  and a single Moortec controller (mr75203) to configure and control the IPs.

  Some of the Moortec's analog hard IPs that can be used in a design:
  *) Temperature Sensor (TS) - used to monitor core temperature (e.g. mr74137).
  *) Voltage Monitor (VM) - used to monitor voltage levels (e.g. mr74138).
  *) Process Detector (PD) - used to assess silicon speed (e.g. mr74139).
  *) Delay Chain - ring oscillator connected to the PD, used to measure IO
     based transistors (e.g. mr76008 ring oscillator at 1.1V, mr76007 ring
     oscillator at 1.8V).
  *) Pre Scaler - provides divide-by-X scaling of input voltage, which can then
     be presented for VM for measurement within its range (e.g. mr76006 -
     divide by 2 pre-scaler).

  TS, VM & PD also include a digital interface, which consists of configuration
  inputs and measurement outputs.

  Some of the units have number of series, each series can have slightly
  different characteristics.

  The mr75203 binding describes configuration for the controller unit, but also
  for some of the analog IPs.

properties:
  compatible:
    const: moortec,mr75203

  reg:
    items:
      - description: PVT common registers
      - description: PVT temprature sensor registers
      - description: PVT process detector registers
      - description: PVT voltage monitor registers

  reg-names:
    items:
      - const: common
      - const: ts
      - const: pd
      - const: vm

  intel,vm-map:
    description:
      PVT controller has 5 VM (voltage monitor) sensors.
      vm-map defines CPU core to VM instance mapping. A
      value of 0xff means that VM sensor is unused.
    $ref: /schemas/types.yaml#/definitions/uint8-array
    maxItems: 5

  clocks:
    maxItems: 1

  resets:
    maxItems: 1

  "#thermal-sensor-cells":
    const: 1

  moortec,vm-active-channels:
    description:
      Defines the number of channels per VM that are actually used and are
      connected to some input source.
      Maximum number of items - number of VMs.
      Maximum value of each item - number of channels.
      Minimum value of each item - 0 (which means entire VM sensor is not used).
    $ref: /schemas/types.yaml#/definitions/uint8-array

  moortec,vm-pre-scaler-x2:
    description:
      Defines the channels that use a mr76006 pre-scaler to divide the input
      source by 2.
      The pre-scaler is used for input sources that exceed the VM input range.
      The driver uses this information to present to the user with the actual
      value of the voltage source.
      For channels that are not listed, no pre-scaler is assumed.
      Maximum number of items - total number of channels in all VMs.
      Each channel should not appear more than once.
    $ref: /schemas/types.yaml#/definitions/uint8-array

  moortec,ts-series:
    description:
      Definition of the temperature equation and coefficients that shall be
      used to convert the digital output to value in milli-Celsius.
    minimum: 5
    maximum: 6
    default: 5
    $ref: /schemas/types.yaml#/definitions/uint32

  moortec,ts-coeff-g:
    description:
      G coefficient for temperature equation.
      Default for series 5 = 60000
      Default for series 6 = 57400
    multipleOf: 1000
    minimum: 1000
    $ref: /schemas/types.yaml#/definitions/uint32

  moortec,ts-coeff-h:
    description:
      H coefficient for temperature equation.
      Default for series 5 = 200000
      Default for series 6 = 249400
    multipleOf: 1000
    minimum: 1000
    $ref: /schemas/types.yaml#/definitions/uint32

  moortec,ts-coeff-cal5:
    description:
      cal5 coefficient for temperature equation.
      Default for series 5 = 4094
      Default for series 6 = 4096
    minimum: 1
    $ref: /schemas/types.yaml#/definitions/uint32

  moortec,ts-coeff-j:
    description:
      J coefficient for temperature equation.
      Default for series 5 = -100
      Default for series 6 = 0
    multipleOf: 1000
    maximum: 0
    $ref: /schemas/types.yaml#/definitions/int32

required:
  - compatible
  - reg
  - reg-names
  - clocks
  - "#thermal-sensor-cells"

additionalProperties: false

examples:
  - |
    pvt: pvt@e0680000 {
        compatible = "moortec,mr75203";
        reg = <0xe0680000 0x80>,
              <0xe0680080 0x180>,
              <0xe0680200 0x200>,
              <0xe0680400 0xc00>;
        reg-names = "common", "ts", "pd", "vm";
        intel,vm-map = [03 01 04 ff ff];
        clocks = <&osc0>;
        resets = <&rcu0 0x40 7>;
        moortec,vm-active-channels = /bits/ 8 <0x10 0x05>;
        moortec,vm-pre-scaler-x2 = /bits/ 8 <5 6 20>;
        moortec,ts-coeff-g = <61400>;
        moortec,ts-coeff-h = <253700>;
        #thermal-sensor-cells = <1>;
    };


code:
# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/hwmon/national,lm90.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: LM90 series thermometer

maintainers:
  - Jean Delvare <jdelvare@suse.com>
  - Guenter Roeck <linux@roeck-us.net>

properties:
  compatible:
    enum:
      - adi,adm1032
      - adi,adt7461
      - adi,adt7461a
      - adi,adt7481
      - dallas,max6646
      - dallas,max6647
      - dallas,max6649
      - dallas,max6657
      - dallas,max6658
      - dallas,max6659
      - dallas,max6680
      - dallas,max6681
      - dallas,max6695
      - dallas,max6696
      - gmt,g781
      - national,lm86
      - national,lm89
      - national,lm90
      - national,lm99
      - nxp,sa56004
      - onnn,nct1008
      - ti,tmp451
      - ti,tmp461
      - winbond,w83l771

  interrupts:
    items:
      - description: |
          Single interrupt specifier which describes the LM90 "-ALERT" pin
          output.

  reg:
    maxItems: 1

  "#thermal-sensor-cells":
    const: 1

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

  vcc-supply:
    description: phandle to the regulator that provides the +VCC supply

  ti,extended-range-enable:
    description: Set to enable extended range temperature.
    type: boolean

required:
  - compatible
  - reg

patternProperties:
  "^channel@([0-2])$":
    type: object
    description: Represents channels of the device and their specific configuration.

    properties:
      reg:
        description: The channel number. 0 is local channel, 1-2 are remote channels.
        items:
          minimum: 0
          maximum: 2

      label:
        description: A descriptive name for this channel, like "ambient" or "psu".

      temperature-offset-millicelsius:
        description: Temperature offset to be added to or subtracted from remote temperature measurements.

    required:
      - reg

    additionalProperties: false

allOf:
  - if:
      not:
        properties:
          compatible:
            contains:
              enum:
                - adi,adt7461
                - adi,adt7461a
                - adi,adt7481
                - ti,tmp451
                - ti,tmp461
    then:
      properties:
        ti,extended-range-enable: false

  - if:
      properties:
        compatible:
          contains:
            enum:
              - dallas,max6646
              - dallas,max6647
              - dallas,max6649
              - dallas,max6657
              - dallas,max6658
              - dallas,max6659
              - dallas,max6695
              - dallas,max6696
    then:
      patternProperties:
        "^channel@([0-2])$":
          properties:
            temperature-offset-millicelsius: false

  - if:
      properties:
        compatible:
          contains:
            enum:
              - adi,adt7461
              - adi,adt7461a
              - adi,adt7481
              - onnn,nct1008
    then:
      patternProperties:
        "^channel@([0-2])$":
          properties:
            temperature-offset-millicelsius:
              maximum: 127750

  - if:
      properties:
        compatible:
          contains:
            enum:
              - adi,adm1032
              - dallas,max6680
              - dallas,max6681
              - gmt,g781
              - national,lm86
              - national,lm89
              - national,lm90
              - national,lm99
              - nxp,sa56004
              - winbond,w83l771
    then:
      patternProperties:
        "^channel@([0-2])$":
          properties:
            temperature-offset-millicelsius:
              maximum: 127875

  - if:
      properties:
        compatible:
          contains:
            enum:
              - ti,tmp451
              - ti,tmp461
    then:
      patternProperties:
        "^channel@([0-2])$":
          properties:
            temperature-offset-millicelsius:
              maximum: 127937

additionalProperties: false

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

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

        sensor@4c {
            compatible = "onnn,nct1008";
            reg = <0x4c>;
            vcc-supply = <&palmas_ldo6_reg>;
            interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
            #thermal-sensor-cells = <1>;
        };
    };
  - |
    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

      sensor@4c {
        compatible = "adi,adt7481";
        reg = <0x4c>;
        #address-cells = <1>;
        #size-cells = <0>;

        channel@0 {
          reg = <0x0>;
          label = "local";
        };

        channel@1 {
          reg = <0x1>;
          label = "front";
          temperature-offset-millicelsius = <4000>;
        };

        channel@2 {
          reg = <0x2>;
          label = "back";
          temperature-offset-millicelsius = <750>;
        };
      };
    };

repo_name: angery/linux


code:
Nuvoton NPCM7xx PWM and Fan Tacho controller device

The Nuvoton BMC NPCM7XX supports 8 Pulse-width modulation (PWM)
controller outputs and 16 Fan tachometer controller inputs.

Required properties for pwm-fan node
- #address-cells : should be 1.
- #size-cells	: should be 0.
- compatible	: "nuvoton,npcm750-pwm-fan" for Poleg NPCM7XX.
- reg			: specifies physical base address and size of the registers.
- reg-names	: must contain:
					* "pwm" for the PWM registers.
					* "fan" for the Fan registers.
- clocks		: phandle of reference clocks.
- clock-names	: must contain
					* "pwm" for PWM controller operating clock.
					* "fan" for Fan controller operating clock.
- interrupts	: contain the Fan interrupts with flags for falling edge.
- pinctrl-names	: a pinctrl state named "default" must be defined.
- pinctrl-0	: phandle referencing pin configuration of the PWM and Fan
					controller ports.

fan subnode format:
===================
Under fan subnode can be upto 8 child nodes, each child node representing a fan.
Each fan subnode must have one PWM channel and atleast one Fan tach channel.

For PWM channel can be configured cooling-levels to create cooling device.
Cooling device could be bound to a thermal zone for the thermal control.

Required properties for each child node:
- reg : specify the PWM output channel.
	integer value in the range 0 through 7, that represent
	the PWM channel number that used.

- fan-tach-ch : specify the Fan tach input channel.
		integer value in the range 0 through 15, that represent
		the fan tach channel number that used.

		At least one Fan tach input channel is required

Optional property for each child node:
- cooling-levels: PWM duty cycle values in a range from 0 to 255
                  which correspond to thermal cooling states.

Examples:

pwm_fan:pwm-fan-controller@103000 {
	#address-cells = <1>;
	#size-cells = <0>;
	compatible = "nuvoton,npcm750-pwm-fan";
	reg = <0x103000 0x2000>,
		<0x180000 0x8000>;
	reg-names = "pwm", "fan";
	clocks = <&clk NPCM7XX_CLK_APB3>,
		<&clk NPCM7XX_CLK_APB4>;
	clock-names = "pwm","fan";
	interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>,
			<GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
			<GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
			<GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
			<GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
			<GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
			<GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
			<GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
	pinctrl-names = "default";
	pinctrl-0 = <&pwm0_pins &pwm1_pins &pwm2_pins
			&fanin0_pins &fanin1_pins &fanin2_pins
			&fanin3_pins &fanin4_pins>;
	fan@0 {
		reg = <0x00>;
		fan-tach-ch = /bits/ 8 <0x00 0x01>;
		cooling-levels = <127 255>;
	};
	fan@1 {
		reg = <0x01>;
		fan-tach-ch = /bits/ 8 <0x02 0x03>;
	};
	fan@2 {
		reg = <0x02>;
		fan-tach-ch = /bits/ 8 <0x04>;
	};

};


code:
Bindings for the fan / temperature monitor microcontroller used on
the Zyxel NSA 320 and several subsequent models.

Required properties:
- compatible	: "zyxel,nsa320-mcu"
- data-gpios	: The GPIO pin connected to the data line on the MCU
- clk-gpios	: The GPIO pin connected to the clock line on the MCU
- act-gpios	: The GPIO pin connected to the active line on the MCU

Example:

	hwmon {
		compatible = "zyxel,nsa320-mcu";
		pinctrl-0 = <&pmx_mcu_data &pmx_mcu_clk &pmx_mcu_act>;
		pinctrl-names = "default";

		data-gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
		clk-gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>;
		act-gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
	};


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
---
$id: http://devicetree.org/schemas/hwmon/ntc-thermistor.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: NTC thermistor temperature sensors

maintainers:
  - Naveen Krishna Chatradhi <ch.naveen@samsung.com>
  - Linus Walleij <linus.walleij@linaro.org>

description: |
  Thermistors with negative temperature coefficient (NTC) are resistors that
  vary in resistance in an often non-linear way in relation to temperature.
  The negative temperature coefficient means that the resistance decreases
  as the temperature rises. Since the relationship between resistance and
  temperature is non-linear, software drivers most often need to use a look
  up table and interpolation to get from resistance to temperature.

  When used in practice, a thermistor is often connected between ground, a
  pull-up resistor or/and a pull-down resistor and a fixed voltage like this:

      + e.g. 5V = pull-up voltage (puv)
      |
     +-+
     | |
     | | Pull-up resistor
     | | (puo)
     +-+
      |-------------------------o
     +-+ |                      ^
     | |/                       |
     | /                        |
     |/| Thermistor             | Measured voltage (mv)
     / |                        | "connected ground"
    /| |                        |
     +-+                        |
      |-------------------------o
     +-+                        ^
     | |                        |
     | | Pull-down resistor     | Measured voltage (mv)
     | | (pdo)                  | "connected positive"
     +-+                        |
      |                         |
      |                         v
      + GND                     GND

  The arrangements of where we measure the voltage over the thermistor are
  called "connected ground" and "connected positive" and shall be understood as
  the cases when either pull-up or pull-down resistance is zero.

  If the pull-up resistance is 0 one end of the thermistor is connected to the
  positive voltage and we get the thermistor on top of a pull-down resistor
  and we take the measure between the thermistor and the pull-down resistor.

  Conversely if the pull-down resistance is zero, one end of the thermistor is
  connected to ground and we get the thermistor under the pull-up resistor
  and we take the measure between the pull-up resistor and the thermistor.

  We can use both pull-up and pull-down resistors at the same time, and then
  the figure illustrates where the voltage will be measured for the "connected
  ground" and "connected positive" cases.

properties:
  $nodename:
    pattern: "^thermistor(.*)?$"

  compatible:
    oneOf:
      - const: epcos,b57330v2103
      - const: epcos,b57891s0103
      - const: murata,ncp15wb473
      - const: murata,ncp18wb473
      - const: murata,ncp21wb473
      - const: murata,ncp03wb473
      - const: murata,ncp15wl333
      - const: murata,ncp03wf104
      - const: murata,ncp15xh103
      - const: samsung,1404-001221
      # Deprecated "ntp," compatible strings
      - const: ntc,ncp15wb473
        deprecated: true
      - const: ntc,ncp18wb473
        deprecated: true
      - const: ntc,ncp21wb473
        deprecated: true
      - const: ntc,ncp03wb473
        deprecated: true
      - const: ntc,ncp15wl333
        deprecated: true

  "#thermal-sensor-cells":
    description: Thermal sensor cells if used for thermal sensoring.
    const: 0

  pullup-uv:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Pull-up voltage in micro volts. Must always be specified.

  pullup-ohm:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Pull-up resistance in ohms. Must always be specified, even
      if zero.

  pulldown-ohm:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Pull-down resistance in ohms. Must always be specified, even
      if zero.

  connected-positive:
    $ref: /schemas/types.yaml#/definitions/flag
    description: Indicates how the thermistor is connected in series with
      a pull-up and/or a pull-down resistor. See the description above for
      an illustration. If this flag is NOT specified, the thermistor is assumed
      to be connected-ground, which usually means a pull-down resistance of
      zero but complex arrangements are possible.

  # See /schemas/iio/adc/adc.yaml
  io-channels:
    maxItems: 1
    description: IIO ADC channel to read the voltage over the resistor. Must
      always be specified.

required:
  - compatible
  - pullup-uv
  - pullup-ohm
  - pulldown-ohm
  - io-channels

additionalProperties: false

examples:
  - |
    thermistor0 {
      compatible = "murata,ncp18wb473";
      io-channels = <&gpadc 0x06>;
      pullup-uv = <1800000>;
      pullup-ohm = <220000>;
      pulldown-ohm = <0>;
      #thermal-sensor-cells = <0>;
    };


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---

$id: http://devicetree.org/schemas/hwmon/nuvoton,nct6775.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Nuvoton NCT6775 and compatible Super I/O chips

maintainers:
  - Zev Weiss <zev@bewilderbeest.net>

properties:
  compatible:
    enum:
      - nuvoton,nct6106
      - nuvoton,nct6116
      - nuvoton,nct6775
      - nuvoton,nct6776
      - nuvoton,nct6779
      - nuvoton,nct6791
      - nuvoton,nct6792
      - nuvoton,nct6793
      - nuvoton,nct6795
      - nuvoton,nct6796
      - nuvoton,nct6797
      - nuvoton,nct6798

  reg:
    maxItems: 1

  nuvoton,tsi-channel-mask:
    description:
      Bitmask indicating which TSI temperature sensor channels are
      active.  LSB is TSI0, bit 1 is TSI1, etc.
    $ref: /schemas/types.yaml#/definitions/uint32
    maximum: 0xff
    default: 0

required:
  - compatible
  - reg

additionalProperties: false

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

        superio@4d {
            compatible = "nuvoton,nct6779";
            reg = <0x4d>;
            nuvoton,tsi-channel-mask = <0x03>;
        };
    };


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---

$id: http://devicetree.org/schemas/hwmon/nuvoton,nct7802.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Nuvoton NCT7802Y Hardware Monitoring IC

maintainers:
  - Guenter Roeck <linux@roeck-us.net>

description: |
  The NCT7802Y is a hardware monitor IC which supports one on-die and up to
  5 remote temperature sensors with SMBus interface.

  Datasheets:
    https://www.nuvoton.com/export/resource-files/Nuvoton_NCT7802Y_Datasheet_V12.pdf

additionalProperties: false

properties:
  compatible:
    enum:
      - nuvoton,nct7802

  reg:
    maxItems: 1

  "#address-cells":
    const: 1

  "#size-cells":
    const: 0

patternProperties:
  "^channel@[0-3]$":
    type: object

    additionalProperties: false

    properties:
      reg:
        items:
          - enum:
              - 0    # Local Temperature Sensor ("LTD")
              - 1    # Remote Temperature Sensor or Voltage Sensor 1 ("RTD1")
              - 2    # Remote Temperature Sensor or Voltage Sensor 2 ("RTD2")
              - 3    # Remote Temperature Sensor or Voltage Sensor 3 ("RTD3")

      sensor-type:
        items:
          - enum:
              - temperature
              - voltage

      temperature-mode:
        items:
          - enum:
              - thermistor
              - thermal-diode

    required:
      - reg

    allOf:
      # For channels RTD1, RTD2 and RTD3, require sensor-type to be set.
      # Otherwise (for all other channels), do not allow temperature-mode to be
      # set.
      - if:
          properties:
            reg:
              items:
                - enum:
                    - 1
                    - 2
                    - 3
        then:
          required:
            - sensor-type
        else:
          not:
            required:
              - sensor-type

      # For channels RTD1 and RTD2 and if sensor-type is "temperature", require
      # temperature-mode to be set. Otherwise (for all other channels or
      # sensor-type settings), do not allow temperature-mode to be set
      - if:
          properties:
            reg:
              items:
                - enum:
                    - 1
                    - 2
            sensor-type:
              items:
                - enum:
                    - temperature
        then:
          required:
            - temperature-mode
        else:
          not:
            required:
              - temperature-mode

required:
  - compatible
  - reg

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

        nct7802@28 {
            compatible = "nuvoton,nct7802";
            reg = <0x28>;

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

            channel@0 { /* LTD */
              reg = <0>;
            };

            channel@1 { /* RTD1 */
              reg = <1>;
              sensor-type = "voltage";
            };

            channel@2 { /* RTD2 */
              reg = <2>;
              sensor-type = "temperature";
              temperature-mode = "thermal-diode";
            };

            channel@3 { /* RTD3 */
              reg = <3>;
              sensor-type = "temperature";
            };
        };
    };


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---

$id: http://devicetree.org/schemas/hwmon/pmbus/ti,lm25066.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: National Semiconductor/Texas Instruments LM250x6/LM506x power-management ICs

maintainers:
  - Zev Weiss <zev@bewilderbeest.net>

description: |
  The LM25066 family of power-management ICs (a.k.a. hot-swap
  controllers or eFuses in various contexts) are PMBus devices that
  offer temperature, current, voltage, and power monitoring.

  Datasheet: https://www.ti.com/lit/ds/symlink/lm25066.pdf

properties:
  compatible:
    enum:
      - ti,lm25056
      - ti,lm25066
      - ti,lm5064
      - ti,lm5066
      - ti,lm5066i

  reg:
    maxItems: 1

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

required:
  - compatible
  - reg

additionalProperties: false

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

        pmic@40 {
            compatible = "ti,lm25066";
            reg = <0x40>;
            shunt-resistor-micro-ohms = <675>;
        };
    };


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---

$id: http://devicetree.org/schemas/hwmon/pmbus/ti,ucd90320.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: UCD90320 power sequencer

maintainers:
  - Jim Wright <wrightj@linux.vnet.ibm.com>

description: |
  The UCD90320 is a 32-rail PMBus/I2C addressable power-supply sequencer and
  monitor. The 24 integrated ADC channels (AMONx) monitor the power supply
  voltage, current, and temperature. Of the 84 GPIO pins, 8 can be used as
  digital monitors (DMONx), 32 to enable the power supply (ENx), 24 for
  margining (MARx), 16 for logical GPO, and 32 GPIs for cascading, and system
  function.

  http://focus.ti.com/lit/ds/symlink/ucd90320.pdf

properties:
  compatible:
    enum:
      - ti,ucd90320

  reg:
    maxItems: 1

required:
  - compatible
  - reg

additionalProperties: false

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

        ucd90320@11 {
            compatible = "ti,ucd90320";
            reg = <0x11>;
        };
    };


code:
Bindings for a fan connected to the PWM lines

Required properties:
- compatible	: "pwm-fan"
- pwms		: the PWM that is used to control the PWM fan
- cooling-levels      : PWM duty cycle values in a range from 0 to 255
			which correspond to thermal cooling states

Optional properties:
- fan-supply		: phandle to the regulator that provides power to the fan
- interrupts		: This contains an interrupt specifier for each fan
			  tachometer output connected to an interrupt source.
			  The output signal must generate a defined number of
			  interrupts per fan revolution, which require that
			  it must be self resetting edge interrupts. See
			  interrupt-controller/interrupts.txt for the format.
- pulses-per-revolution : define the number of pulses per fan revolution for
			  each tachometer input as an integer (default is 2
			  interrupts per revolution). The value must be
			  greater than zero.

Example:
	fan0: pwm-fan {
		compatible = "pwm-fan";
		#cooling-cells = <2>;
		pwms = <&pwm 0 10000 0>;
		cooling-levels = <0 102 170 230>;
	};

	thermal-zones {
		cpu_thermal: cpu-thermal {
			     thermal-sensors = <&tmu 0>;
			     polling-delay-passive = <0>;
			     polling-delay = <0>;
			     trips {
					cpu_alert1: cpu-alert1 {
						    temperature = <100000>; /* millicelsius */
						    hysteresis = <2000>; /* millicelsius */
						    type = "passive";
					};
			     };
			     cooling-maps {
					map0 {
						    trip = <&cpu_alert1>;
						    cooling-device = <&fan0 0 1>;
					};
			     };
		};

Example 2:
	fan0: pwm-fan {
		compatible = "pwm-fan";
		pwms = <&pwm 0 40000 0>;
		fan-supply = <&reg_fan>;
		interrupt-parent = <&gpio5>;
		interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
		pulses-per-revolution = <2>;
	};

Example 3:
	fan0: pwm-fan {
		compatible = "pwm-fan";
		pwms = <&pwm1 0 25000 0>;
		interrupts-extended = <&gpio1 1 IRQ_TYPE_EDGE_FALLING>,
			<&gpio2 5 IRQ_TYPE_EDGE_FALLING>;
		pulses-per-revolution = <2>, <1>;
	};


code:
# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/hwmon/sensirion,sht15.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Sensirion SHT15 humidity and temperature sensor

maintainers:
  - Krzysztof Kozlowski <krzk@kernel.org>

properties:
  compatible:
    const: sensirion,sht15

  clk-gpios:
    maxItems: 1

  data-gpios:
    maxItems: 1

  vcc-supply:
    description: regulator that drives the VCC pin

required:
  - compatible
  - clk-gpios
  - data-gpios
  - vcc-supply

additionalProperties: false

examples:
  - |
    sensor {
        compatible = "sensirion,sht15";
        clk-gpios = <&gpio4 12 0>;
        data-gpios = <&gpio4 13 0>;
        vcc-supply = <&reg_sht15>;

        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_sensor>;
    };


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

title: Sensirion SHTC1 Humidity and Temperature Sensor IC

maintainers:
  - Christopher Ruehl chris.ruehl@gtsys.com.hk

description: |
  The SHTC1, SHTW1 and SHTC3 are digital humidity and temperature sensors
  designed especially for battery-driven high-volume consumer electronics
  applications.
  For further information refere to Documentation/hwmon/shtc1.rst

  This binding document describes the binding for the hardware monitor
  portion of the driver.

properties:
  compatible:
    enum:
      - sensirion,shtc1
      - sensirion,shtw1
      - sensirion,shtc3

  reg:
    const: 0x70

  sensirion,blocking-io:
    $ref: /schemas/types.yaml#/definitions/flag
    description:
      If set, the driver holds the i2c bus until the measurement is finished.

  sensirion,low-precision:
    $ref: /schemas/types.yaml#/definitions/flag
    description:
      If set, the sensor acquires data with low precision (not recommended).
      The driver acquires data with high precision by default.

required:
  - compatible
  - reg

additionalProperties: false

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

      shtc3@70 {
        compatible = "sensirion,shtc3";
        reg = <0x70>;
        sensirion,blocking-io;
      };
    };
...


code:
* STTS751 thermometer.

Required node properties:
- compatible: "stts751"
- reg: I2C bus address of the device

Optional properties:
- smbus-timeout-disable: when set, the smbus timeout function will be disabled

Example stts751 node:

temp-sensor {
	compatible = "stts751";
	reg = <0x48>;
}


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---

$id: http://devicetree.org/schemas/hwmon/ti,ads7828.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Texas Instruments ADS7828/ADS7830 Analog to Digital Converter (ADC)

maintainers:
  - Krzysztof Kozlowski <krzk@kernel.org>

description: |
  The ADS7828 is 12-Bit, 8-Channel Sampling Analog to Digital Converter (ADC)
  with an I2C interface.

  Datasheets:
    https://www.ti.com/product/ADS7828

properties:
  compatible:
    enum:
      - ti,ads7828
      - ti,ads7830

  reg:
    maxItems: 1

  ti,differential-input:
    description:
      Set to use the device in differential mode.
    type: boolean

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

required:
  - compatible
  - reg

additionalProperties: false

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

        adc@48 {
            compatible = "ti,ads7828";
            reg = <0x48>;
            vref-supply = <&vref>;
            ti,differential-input;
        };
    };


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---

$id: http://devicetree.org/schemas/hwmon/ti,ina2xx.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Texas Instruments INA209 family of power/voltage monitors

maintainers:
  - Krzysztof Kozlowski <krzk@kernel.org>

description: |
  The INA209 is a high-side current shunt and power monitor with
  an I2C interface.

  Datasheets:
    https://www.ti.com/product/INA209

properties:
  compatible:
    enum:
      - ti,ina209
      - ti,ina219
      - ti,ina220
      - ti,ina226
      - ti,ina230
      - ti,ina231
      - ti,ina238

  reg:
    maxItems: 1

  shunt-resistor:
    description:
      Shunt resistor value in micro-Ohm.
    $ref: /schemas/types.yaml#/definitions/uint32

  ti,shunt-gain:
    description: |
      Programmable gain divisor for the shunt voltage accuracy and range. This
      property only applies to devices that have configurable PGA/ADCRANGE. The
      gain value is used configure the gain and to convert the shunt voltage,
      current and power register values when reading measurements from the
      device.

      For devices that have a configurable PGA (e.g. INA209, INA219, INA220),
      the gain value maps directly with the PG bits of the config register.

      For devices that have ADCRANGE configuration (e.g. INA238) a shunt-gain
      value of 1 maps to ADCRANGE=1 where no gain divisor is applied to the
      shunt voltage, and a value of 4 maps to ADCRANGE=0 such that a wider
      voltage range is used.

      The default value is device dependent, and is defined by the reset value
      of PGA/ADCRANGE in the respective configuration registers.
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [1, 2, 4, 8]

required:
  - compatible
  - reg

additionalProperties: false

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

        power-sensor@44 {
            compatible = "ti,ina220";
            reg = <0x44>;
            shunt-resistor = <1000>;
        };
    };


code:
# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/hwmon/ti,tmp102.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: TMP102 temperature sensor

maintainers:
  - Krzysztof Kozlowski <krzk@kernel.org>

properties:
  compatible:
    enum:
      - ti,tmp102

  interrupts:
    maxItems: 1

  reg:
    maxItems: 1

  "#thermal-sensor-cells":
    const: 1

required:
  - compatible
  - reg

additionalProperties: false

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

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

        sensor@48 {
            compatible = "ti,tmp102";
            reg = <0x48>;
            interrupt-parent = <&gpio7>;
            interrupts = <16 IRQ_TYPE_LEVEL_LOW>;
            #thermal-sensor-cells = <1>;
        };
    };


code:
# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/hwmon/ti,tmp108.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: TMP108 temperature sensor

maintainers:
  - Krzysztof Kozlowski <krzk@kernel.org>

properties:
  compatible:
    enum:
      - ti,tmp108

  interrupts:
    items:
      - description: alert interrupt

  reg:
    maxItems: 1

  "#thermal-sensor-cells":
    const: 0

required:
  - compatible
  - reg

additionalProperties: false

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

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

        sensor@48 {
            compatible = "ti,tmp108";
            reg = <0x48>;
            interrupt-parent = <&gpio1>;
            interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
            pinctrl-names = "default";
            pinctrl-0 = <&tmp_alrt>;
            #thermal-sensor-cells = <0>;
        };
    };


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

title: TMP401, TPM411 and TMP43x temperature sensor

maintainers:
  - Guenter Roeck <linux@roeck-us.net>

description: |
  ±1°C Remote and Local temperature sensor

  Datasheets:
  https://www.ti.com/lit/ds/symlink/tmp401.pdf
  https://www.ti.com/lit/ds/symlink/tmp411.pdf
  https://www.ti.com/lit/ds/symlink/tmp431.pdf
  https://www.ti.com/lit/ds/symlink/tmp435.pdf

properties:
  compatible:
    enum:
      - ti,tmp401
      - ti,tmp411
      - ti,tmp431
      - ti,tmp432
      - ti,tmp435

  reg:
    maxItems: 1

  ti,extended-range-enable:
    description:
      When set, this sensor measures over extended temperature range.
    type: boolean

  ti,n-factor:
    description:
      value to be used for converting remote channel measurements to
      temperature.
    $ref: /schemas/types.yaml#/definitions/int32
    minimum: -128
    maximum: 127

  ti,beta-compensation:
    description:
      value to select beta correction range.
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 0
    maximum: 15

allOf:
  - if:
      properties:
        compatible:
          contains:
            enum:
              - ti,tmp401
    then:
      properties:
        ti,n-factor: false

  - if:
      properties:
        compatible:
          contains:
            enum:
              - ti,tmp401
              - ti,tmp411
    then:
      properties:
        ti,beta-compensation: false

required:
  - compatible
  - reg

additionalProperties: false

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

      sensor@4c {
        compatible = "ti,tmp401";
        reg = <0x4c>;
      };
    };
  - |
    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

      sensor@4c {
        compatible = "ti,tmp431";
        reg = <0x4c>;
        ti,extended-range-enable;
        ti,n-factor = <0x3b>;
        ti,beta-compensation = <0x7>;
      };
    };


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

title: TMP42x/TMP44x temperature sensor

maintainers:
  - Guenter Roeck <linux@roeck-us.net>

description: |
  ±1°C Remote and Local temperature sensor
  https://www.ti.com/lit/ds/symlink/tmp422.pdf

properties:
  compatible:
    enum:
      - ti,tmp421
      - ti,tmp422
      - ti,tmp423
      - ti,tmp441
      - ti,tmp442
  reg:
    maxItems: 1

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

required:
  - compatible
  - reg

additionalProperties: false

patternProperties:
  "^channel@([0-3])$":
    type: object
    description: |
      Represents channels of the device and their specific configuration.

    properties:
      reg:
        description: |
          The channel number. 0 is local channel, 1-3 are remote channels
        items:
          minimum: 0
          maximum: 3

      label:
        description: |
          A descriptive name for this channel, like "ambient" or "psu".

      ti,n-factor:
        description: |
          The value (two's complement) to be programmed in the channel specific N correction register.
          For remote channels only.
        $ref: /schemas/types.yaml#/definitions/int32
        minimum: -128
        maximum: 127

    required:
      - reg

    additionalProperties: false

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

      sensor@4c {
        compatible = "ti,tmp422";
        reg = <0x4c>;
      };
    };
  - |
    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

      sensor@4c {
        compatible = "ti,tmp422";
        reg = <0x4c>;
        #address-cells = <1>;
        #size-cells = <0>;

        channel@0 {
          reg = <0x0>;
          ti,n-factor = <0x1>;
          label = "local";
        };

        channel@1 {
          reg = <0x1>;
          ti,n-factor = <0x0>;
          label = "somelabel";
        };

        channel@2 {
          reg = <0x2>;
          status = "disabled";
        };
      };
    };


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

title: TMP464 and TMP468 temperature sensors

maintainers:
  - Agathe Porte <agathe.porte@nokia.com>

description: |
  ±0.0625°C Remote and Local temperature sensor
  https://www.ti.com/lit/ds/symlink/tmp464.pdf
  https://www.ti.com/lit/ds/symlink/tmp468.pdf

properties:
  compatible:
    enum:
      - ti,tmp464
      - ti,tmp468

  reg:
    maxItems: 1

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

required:
  - compatible
  - reg

additionalProperties: false

patternProperties:
  "^channel@([0-8])$":
    type: object
    description: |
      Represents channels of the device and their specific configuration.

    properties:
      reg:
        description: |
          The channel number. 0 is local channel, 1-8 are remote channels.
        items:
          minimum: 0
          maximum: 8

      label:
        description: |
          A descriptive name for this channel, like "ambient" or "psu".

      ti,n-factor:
        description: |
          The value (two's complement) to be programmed in the channel specific N correction register.
          For remote channels only.
        $ref: /schemas/types.yaml#/definitions/int32
        minimum: -128
        maximum: 127

    required:
      - reg

    additionalProperties: false

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

      sensor@4b {
        compatible = "ti,tmp464";
        reg = <0x4b>;
      };
    };
  - |
    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

      sensor@4b {
        compatible = "ti,tmp464";
        reg = <0x4b>;
        #address-cells = <1>;
        #size-cells = <0>;

        channel@0 {
          reg = <0x0>;
          label = "local";
        };

        channel@1 {
          reg = <0x1>;
          ti,n-factor = <(-10)>;
          label = "external";
        };

        channel@2 {
          reg = <0x2>;
          ti,n-factor = <0x10>;
          label = "somelabel";
        };

        channel@3 {
          reg = <0x3>;
          status = "disabled";
        };
      };
    };


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---

$id: http://devicetree.org/schemas/hwmon/ti,tmp513.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: TMP513/512 system monitor sensor

maintainers:
  - Eric Tremblay <etremblay@distech-controls.com>

description: |
  The TMP512 (dual-channel) and TMP513 (triple-channel) are system monitors
  that include remote sensors, a local temperature sensor, and a high-side
  current shunt monitor. These system monitors have the capability of measuring
  remote temperatures, on-chip temperatures, and system voltage/power/current
  consumption.

  Datasheets:
  https://www.ti.com/lit/gpn/tmp513
  https://www.ti.com/lit/gpn/tmp512

properties:
  compatible:
    enum:
      - ti,tmp512
      - ti,tmp513

  reg:
    maxItems: 1

  shunt-resistor-micro-ohms:
    description: |
      If 0, the calibration process will be skiped and the current and power
      measurement engine will not work. Temperature and voltage measurement
      will continue to work. The shunt value also need to respect:
      rshunt <= pga-gain * 40 * 1000 * 1000.
      If not, it's not possible to compute a valid calibration value.
    default: 1000

  ti,pga-gain:
    description: |
      The gain value for the PGA function. This is 8, 4, 2 or 1.
      The PGA gain affect the shunt voltage range.
      The range will be equal to: pga-gain * 40mV
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [1, 2, 4, 8]
    default: 8

  ti,bus-range-microvolt:
    description: |
      This is the operating range of the bus voltage in microvolt
    enum: [16000000, 32000000]
    default: 32000000

  ti,nfactor:
    description: |
      Array of three(TMP513) or two(TMP512) n-Factor value for each remote
      temperature channel.
      See datasheet Table 11 for n-Factor range list and value interpretation.
    $ref: /schemas/types.yaml#/definitions/uint32-array
    minItems: 2
    maxItems: 3
    items:
      default: 0x00
      minimum: 0x00
      maximum: 0xFF

required:
  - compatible
  - reg

additionalProperties: false

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

          tmp513@5c {
              compatible = "ti,tmp513";
              reg = <0x5C>;
              shunt-resistor-micro-ohms = <330000>;
              ti,bus-range-microvolt = <32000000>;
              ti,pga-gain = <8>;
              ti,nfactor = <0x1 0xF3 0x00>;
          };
    };


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---

$id: http://devicetree.org/schemas/hwmon/ti,tps23861.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: TI TPS23861 PoE PSE

maintainers:
  - Robert Marko <robert.marko@sartura.hr>

description: |
  The TPS23861 is a IEEE 802.3at Quad Port Power-over-Ethernet PSE Controller.

  Datasheets:
  https://www.ti.com/lit/gpn/tps23861

properties:
  compatible:
    enum:
      - ti,tps23861

  reg:
    maxItems: 1

  shunt-resistor-micro-ohms:
    description: The value of curent sense resistor in microohms.
    default: 255000
    minimum: 250000
    maximum: 255000

required:
  - compatible
  - reg

additionalProperties: false

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

          tps23861@30 {
              compatible = "ti,tps23861";
              reg = <0x30>;
              shunt-resistor-micro-ohms = <255000>;
          };
    };


code:
Versatile Express hwmon sensors
-------------------------------

Requires node properties:
- "compatible" value : one of
	"arm,vexpress-volt"
	"arm,vexpress-amp"
	"arm,vexpress-temp"
	"arm,vexpress-power"
	"arm,vexpress-energy"
- "arm,vexpress-sysreg,func" when controlled via vexpress-sysreg
  (see Documentation/devicetree/bindings/arm/vexpress-config.yaml
  for more details)

Optional node properties:
- label : string describing the monitored value

Example:
	energy@0 {
		compatible = "arm,vexpress-energy";
		arm,vexpress-sysreg,func = <13 0>;
		label = "A15 Jcore";
	};


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---

$id: http://devicetree.org/schemas/hwmon/winbond,w83781d.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Winbond W83781 and compatible hardware monitor IC

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

properties:
  compatible:
    enum:
      - winbond,w83781d
      - winbond,w83781g
      - winbond,w83782d
      - winbond,w83783s
      - asus,as99127f

  reg:
    maxItems: 1

required:
  - compatible
  - reg

additionalProperties: false

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

        temperature-sensor@28 {
            compatible = "winbond,w83781d";
            reg = <0x28>;
        };
    };


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/i2c/allwinner,sun6i-a31-p2wi.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Allwinner A31 P2WI (Push/Pull 2 Wires Interface)

maintainers:
  - Chen-Yu Tsai <wens@csie.org>
  - Maxime Ripard <mripard@kernel.org>

allOf:
  - $ref: /schemas/i2c/i2c-controller.yaml#

properties:
  compatible:
    const: allwinner,sun6i-a31-p2wi

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    maxItems: 1

  resets:
    maxItems: 1

  clock-frequency:
    minimum: 1
    maximum: 6000000

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

unevaluatedProperties: false

examples:
  - |
    i2c@1f03400 {
        compatible = "allwinner,sun6i-a31-p2wi";
        reg = <0x01f03400 0x400>;
        interrupts = <0 39 4>;
        clocks = <&apb0_gates 3>;
        clock-frequency = <100000>;
        resets = <&apb0_rst 3>;
        #address-cells = <1>;
        #size-cells = <0>;

        axp221: pmic@68 {
            /* compatible = "x-powers,axp221"; */
            reg = <0x68>;
        };
    };

...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
# Copyright 2019 BayLibre, SAS
%YAML 1.2
---
$id: "http://devicetree.org/schemas/i2c/amlogic,meson6-i2c.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"

title: Amlogic Meson I2C Controller

maintainers:
  - Neil Armstrong <neil.armstrong@linaro.org>
  - Beniamino Galvani <b.galvani@gmail.com>

allOf:
  - $ref: /schemas/i2c/i2c-controller.yaml#

properties:
  compatible:
    enum:
      - amlogic,meson6-i2c # Meson6, Meson8 and compatible SoCs
      - amlogic,meson-gxbb-i2c # GXBB and compatible SoCs
      - amlogic,meson-axg-i2c # AXG and compatible SoCs

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    minItems: 1

required:
  - compatible
  - reg
  - interrupts
  - clocks

unevaluatedProperties: false

examples:
  - |
    i2c@c8100500 {
        compatible = "amlogic,meson6-i2c";
        reg = <0xc8100500 0x20>;
        interrupts = <92>;
        clocks = <&clk81>;
        #address-cells = <1>;
        #size-cells = <0>;

        eeprom@52 {
            compatible = "atmel,24c32";
            reg = <0x52>;
        };
    };


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

title: Apple/PASemi I2C controller

maintainers:
  - Sven Peter <sven@svenpeter.dev>

description: |
  Apple SoCs such as the M1 come with a I2C controller based on the one found
  in machines with P. A. Semi's PWRficient processors.
  The bus is used to communicate with e.g. USB PD chips or the speaker
  amp.

allOf:
  - $ref: /schemas/i2c/i2c-controller.yaml#

properties:
  compatible:
    items:
      - enum:
          - apple,t8103-i2c
          - apple,t6000-i2c
      - const: apple,i2c

  reg:
    maxItems: 1

  clocks:
    items:
      - description: I2C bus reference clock

  interrupts:
    maxItems: 1

  clock-frequency:
    description: |
      Desired I2C bus clock frequency in Hz. If not specified, 100 kHz will be
      used. This frequency is generated by dividing the reference clock.
      Allowed values are between ref_clk/(16*4) and ref_clk/(16*255).

  power-domains:
    maxItems: 1

required:
  - compatible
  - reg
  - clocks
  - interrupts

unevaluatedProperties: false

examples:
  - |
    i2c@35010000 {
      compatible = "apple,t8103-i2c", "apple,i2c";
      reg = <0x35010000 0x4000>;
      interrupt-parent = <&aic>;
      interrupts = <0 627 4>;
      clocks = <&ref_clk>;
      #address-cells = <1>;
      #size-cells = <0>;
    };


code:
# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/i2c/arm,i2c-versatile.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: I2C Controller on ARM Ltd development platforms

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

allOf:
  - $ref: /schemas/i2c/i2c-controller.yaml#

properties:
  compatible:
    const: arm,versatile-i2c

  reg:
    maxItems: 1

required:
  - compatible
  - reg

unevaluatedProperties: false

...


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

title: ASPEED I2C on the AST24XX, AST25XX, and AST26XX SoCs

maintainers:
  - Rayn Chen <rayn_chen@aspeedtech.com>

allOf:
  - $ref: /schemas/i2c/i2c-controller.yaml#

properties:
  compatible:
    enum:
      - aspeed,ast2400-i2c-bus
      - aspeed,ast2500-i2c-bus
      - aspeed,ast2600-i2c-bus

  reg:
    minItems: 1
    items:
      - description: address offset and range of bus
      - description: address offset and range of bus buffer

  interrupts:
    maxItems: 1

  clocks:
    maxItems: 1
    description:
      root clock of bus, should reference the APB
      clock in the second cell

  resets:
    maxItems: 1

  bus-frequency:
    minimum: 500
    maximum: 4000000
    default: 100000
    description: frequency of the bus clock in Hz defaults to 100 kHz when not
      specified

  multi-master:
    type: boolean
    description:
      states that there is another master active on this bus

required:
  - reg
  - compatible
  - clocks
  - resets

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/clock/aspeed-clock.h>
    i2c0: i2c-bus@40 {
      #address-cells = <1>;
      #size-cells = <0>;
      compatible = "aspeed,ast2500-i2c-bus";
      reg = <0x40 0x40>;
      clocks = <&syscon ASPEED_CLK_APB>;
      resets = <&syscon ASPEED_RESET_I2C>;
      bus-frequency = <100000>;
      interrupts = <0>;
      interrupt-parent = <&i2c_ic>;
    };


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
# Copyright (C) 2022 Microchip Technology, Inc. and its subsidiaries
%YAML 1.2
---
$id: http://devicetree.org/schemas/i2c/atmel,at91sam-i2c.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: I2C for Atmel/Microchip platforms

maintainers:
  - Alexandre Belloni <alexandre.belloni@bootlin.com>

properties:
  compatible:
    oneOf:
      - items:
          - enum:
              - atmel,at91rm9200-i2c
              - atmel,at91sam9261-i2c
              - atmel,at91sam9260-i2c
              - atmel,at91sam9g20-i2c
              - atmel,at91sam9g10-i2c
              - atmel,at91sam9x5-i2c
              - atmel,sama5d4-i2c
              - atmel,sama5d2-i2c
              - microchip,sam9x60-i2c
      - items:
          - const: microchip,sama7g5-i2c
          - const: microchip,sam9x60-i2c

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  "#address-cells":
    const: 1

  "#size-cells":
    const: 0

  clocks:
    maxItems: 1

  clock-frequency:
    default: 100000

  dmas:
    items:
      - description: TX DMA Channel Specifier
      - description: RX DMA Channel Specifier

  dma-names:
    items:
      - const: tx
      - const: rx

  atmel,fifo-size:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      Maximum number of data the RX and TX FIFOs can store for
      FIFO capable I2C controllers.

  scl-gpios: true

  sda-gpios: true

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

allOf:
  - $ref: "i2c-controller.yaml"
  - if:
      properties:
        compatible:
          contains:
            enum:
              - atmel,sama5d4-i2c
              - atmel,sama5d2-i2c
              - microchip,sam9x60-i2c
              - microchip,sama7g5-i2c
    then:
      properties:
        i2c-sda-hold-time-ns:
          description:
            TWD hold time
          maxItems: 1

unevaluatedProperties: false

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

    i2c0: i2c@fff84000 {
        compatible = "atmel,at91sam9g20-i2c";
        reg = <0xfff84000 0x100>;
        interrupts = <12 IRQ_TYPE_LEVEL_HIGH 6>;
        #address-cells = <1>;
        #size-cells = <0>;
        clocks = <&twi0_clk>;
        clock-frequency = <400000>;

        eeprom@50 {
            compatible = "atmel,24c512";
            reg = <0x50>;
            pagesize = <128>;
        };
    };

    i2c1: i2c@f8034600 {
        compatible = "atmel,sama5d2-i2c";
        reg = <0xf8034600 0x100>;
        interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>;
        dmas = <&dma0
            (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1))
            AT91_XDMAC_DT_PERID(11)>,
               <&dma0
            (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1))
            AT91_XDMAC_DT_PERID(12)>;
        dma-names = "tx", "rx";
        #address-cells = <1>;
        #size-cells = <0>;
        clocks = <&flx0>;
        atmel,fifo-size = <16>;
        i2c-sda-hold-time-ns = <336>;
        pinctrl-names = "default", "gpio";
        pinctrl-0 = <&pinctrl_i2c0>;
        pinctrl-1 = <&pinctrl_i2c0_gpio>;
        sda-gpios = <&pioA 30 GPIO_ACTIVE_HIGH>;
        scl-gpios = <&pioA 31 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;

        eeprom@54 {
            compatible = "atmel,24c02";
            reg = <0x54>;
            pagesize = <16>;
        };
    };


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

title: Broadcom BCM2835 I2C controller

maintainers:
  - Stephen Warren <swarren@wwwdotorg.org>

allOf:
  - $ref: /schemas/i2c/i2c-controller.yaml#

properties:
  compatible:
    oneOf:
      - enum:
          - brcm,bcm2835-i2c
      - items:
          - const: brcm,bcm2711-i2c
          - const: brcm,bcm2835-i2c

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clock-names:
    maxItems: 1

  clocks:
    maxItems: 1

  clock-frequency: true

required:
  - compatible
  - reg
  - interrupts
  - clocks

unevaluatedProperties: false

examples:
  - |
    i2c@7e205000 {
        compatible = "brcm,bcm2835-i2c";
        reg = <0x7e205000 0x1000>;
        interrupts = <2 21>;
        clocks = <&clk_i2c>;
        clock-frequency = <100000>;
    };


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/i2c/brcm,brcmstb-i2c.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Broadcom STB BSC IIC Master Controller

maintainers:
  - Kamal Dasu <kdasu.kdev@gmail.com>

allOf:
  - $ref: /schemas/i2c/i2c-controller.yaml#

properties:
  compatible:
    enum:
      - brcm,bcm2711-hdmi-i2c
      - brcm,brcmstb-i2c
      - brcm,brcmper-i2c

  reg:
    minItems: 1
    items:
      - description: BSC register range
      - description: Auto-I2C register range

  reg-names:
    items:
      - const: bsc
      - const: auto-i2c

  interrupts:
    maxItems: 1

  interrupt-names:
    maxItems: 1

  clock-frequency:
    enum:
      - 46875
      - 50000
      - 93750
      - 97500
      - 187500
      - 200000
      - 375000
      - 390000

required:
  - compatible
  - reg
  - clock-frequency

unevaluatedProperties: false

if:
  properties:
    compatible:
      contains:
        enum:
          - brcm,bcm2711-hdmi-i2c

then:
  properties:
    reg:
      minItems: 2

  required:
    - reg-names

else:
  properties:
    reg:
      maxItems: 1

examples:
  - |
      bsca: i2c@f0406200 {
          clock-frequency = <390000>;
          compatible = "brcm,brcmstb-i2c";
          interrupt-parent = <&irq0_intc>;
          reg = <0xf0406200 0x58>;
          interrupts = <0x18>;
          interrupt-names = "upg_bsca";
      };

  - |
      ddc0: i2c@7ef04500 {
          compatible = "brcm,bcm2711-hdmi-i2c";
          reg = <0x7ef04500 0x100>, <0x7ef00b00 0x300>;
          reg-names = "bsc", "auto-i2c";
          clock-frequency = <390000>;
      };

...


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

title: Broadcom iProc I2C controller

maintainers:
  - Rafał Miłecki <rafal@milecki.pl>

properties:
  compatible:
    enum:
      - brcm,iproc-i2c
      - brcm,iproc-nic-i2c

  reg:
    maxItems: 1

  clock-frequency:
    enum: [ 100000, 400000 ]

  interrupts:
    description: |
      Should contain the I2C interrupt. For certain revisions of the I2C
      controller, I2C interrupt is unwired to the interrupt controller. In such
      case, this property should be left unspecified, and driver will fall back
      to polling mode
    maxItems: 1

  brcm,ape-hsls-addr-mask:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Host view of address mask into the 'APE' co-processor

allOf:
  - $ref: /schemas/i2c/i2c-controller.yaml#
  - if:
      properties:
        compatible:
          contains:
            const: brcm,iproc-nic-i2c
    then:
      required:
        - brcm,ape-hsls-addr-mask

unevaluatedProperties: false

required:
  - reg
  - clock-frequency
  - '#address-cells'
  - '#size-cells'

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

    i2c@18008000 {
        compatible = "brcm,iproc-i2c";
        reg = <0x18008000 0x100>;
        #address-cells = <1>;
        #size-cells = <0>;
        interrupts = <GIC_SPI 85 IRQ_TYPE_NONE>;
        clock-frequency = <100000>;

        wm8750@1a {
            compatible = "wlf,wm8750";
            reg = <0x1a>;
        };
    };


code:
Broadcom Kona Family I2C
=========================

This I2C controller is used in the following Broadcom SoCs:

  BCM11130
  BCM11140
  BCM11351
  BCM28145
  BCM28155

Required Properties
-------------------
- compatible: "brcm,bcm11351-i2c", "brcm,kona-i2c"
- reg: Physical base address and length of controller registers
- interrupts: The interrupt number used by the controller
- clocks: clock specifier for the kona i2c external clock
- clock-frequency: The I2C bus frequency in Hz
- #address-cells: Should be <1>
- #size-cells: Should be <0>

Refer to clocks/clock-bindings.txt for generic clock consumer
properties.

Example:

i2c@3e016000 {
	compatible = "brcm,bcm11351-i2c","brcm,kona-i2c";
	reg = <0x3e016000 0x80>;
	interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
	clocks = <&bsc1_clk>;
	clock-frequency = <400000>;
	#address-cells = <1>;
	#size-cells = <0>;
};


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

title: Cadence I2C controller

maintainers:
  - Michal Simek <michal.simek@xilinx.com>

allOf:
  - $ref: /schemas/i2c/i2c-controller.yaml#

properties:
  compatible:
    enum:
      - cdns,i2c-r1p10 # cadence i2c controller version 1.0
      - cdns,i2c-r1p14 # cadence i2c controller version 1.4

  reg:
    maxItems: 1

  clocks:
    minItems: 1

  interrupts:
    maxItems: 1

  clock-frequency:
    minimum: 1
    maximum: 400000
    description: |
      Desired operating frequency, in Hz, of the bus.

  clock-name:
    const: pclk
    description: |
      Input clock name.

required:
  - compatible
  - reg
  - clocks
  - interrupts

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    i2c@e0004000 {
        compatible = "cdns,i2c-r1p10";
        clocks = <&clkc 38>;
        interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
        reg = <0xe0004000 0x1000>;
        clock-frequency = <400000>;
        #address-cells = <1>;
        #size-cells = <0>;
    };


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---

$id: http://devicetree.org/schemas/i2c/google,cros-ec-i2c-tunnel.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: I2C bus that tunnels through the ChromeOS EC (cros-ec)

maintainers:
  - Doug Anderson <dianders@chromium.org>
  - Benson Leung <bleung@chromium.org>

description: |
  On some ChromeOS board designs we've got a connection to the EC
  (embedded controller) but no direct connection to some devices on the
  other side of the EC (like a battery and PMIC).  To get access to
  those devices we need to tunnel our i2c commands through the EC.

  The node for this device should be under a cros-ec node like
  google,cros-ec-spi or google,cros-ec-i2c.

allOf:
  - $ref: i2c-controller.yaml#

properties:
  compatible:
    const: google,cros-ec-i2c-tunnel

  google,remote-bus:
    description: The EC bus we'd like to talk to.
    $ref: /schemas/types.yaml#/definitions/uint32

required:
  - compatible
  - google,remote-bus

unevaluatedProperties: false

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

        cros-ec@0 {
            compatible = "google,cros-ec-spi";
            reg = <0>;
            spi-max-frequency = <5000000>;
            interrupts = <99 0>;

            i2c-tunnel {
                compatible = "google,cros-ec-i2c-tunnel";
                #address-cells = <1>;
                #size-cells = <0>;

                google,remote-bus = <0>;

                battery: sbs-battery@b {
                    compatible = "sbs,sbs-battery";
                    reg = <0xb>;
                    sbs,poll-retry-count = <1>;
                };
            };
        };
    };


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

title: HiSilicon common I2C controller

maintainers:
  - Yicong Yang <yangyicong@hisilicon.com>

description:
  The HiSilicon common I2C controller can be used for many different
  types of SoC such as Huawei Ascend AI series chips.

allOf:
  - $ref: /schemas/i2c/i2c-controller.yaml#

properties:
  compatible:
    const: hisilicon,ascend910-i2c

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    maxItems: 1

  clock-frequency:
    default: 400000

  i2c-sda-falling-time-ns:
    default: 343

  i2c-scl-falling-time-ns:
    default: 203

  i2c-sda-hold-time-ns:
    default: 830

  i2c-scl-rising-time-ns:
    default: 365

  i2c-digital-filter-width-ns:
    default: 0

required:
  - compatible
  - reg
  - interrupts

unevaluatedProperties: false

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

    i2c@38b0000 {
      compatible = "hisilicon,ascend910-i2c";
      reg = <0x38b0000 0x10000>;
      interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
      i2c-sda-falling-time-ns = <56>;
      i2c-scl-falling-time-ns = <56>;
      i2c-sda-hold-time-ns = <56>;
      i2c-scl-rising-time-ns = <56>;
      i2c-digital-filter;
      i2c-digital-filter-width-ns = <0x0>;
      clocks = <&alg_clk>;
      clock-frequency = <400000>;
    };


code:
* Altera I2C Controller
* This is Altera's synthesizable logic block I2C Controller for use
* in Altera's FPGAs.

Required properties :
 - compatible : should be "altr,softip-i2c-v1.0"
 - reg        : Offset and length of the register set for the device
 - interrupts : <IRQ> where IRQ is the interrupt number.
 - clocks     : phandle to input clock.
 - #address-cells = <1>;
 - #size-cells = <0>;

Recommended properties :
 - clock-frequency : desired I2C bus clock frequency in Hz.

Optional properties :
 - fifo-size : Size of the RX and TX FIFOs in bytes.
 - Child nodes conforming to i2c bus binding

Example :

	i2c@100080000 {
		compatible = "altr,softip-i2c-v1.0";
		reg = <0x00000001 0x00080000 0x00000040>;
		interrupt-parent = <&intc>;
		interrupts = <0 43 4>;
		clocks = <&clk_0>;
		clock-frequency = <100000>;
		#address-cells = <1>;
		#size-cells = <0>;
		fifo-size = <4>;

		eeprom@51 {
			compatible = "atmel,24c32";
			reg = <0x51>;
			pagesize = <32>;
		};
	};


code:
GPIO-based I2C Arbitration Using a Challenge & Response Mechanism
=================================================================
This uses GPIO lines and a challenge & response mechanism to arbitrate who is
the master of an I2C bus in a multimaster situation.

In many cases using GPIOs to arbitrate is not needed and a design can use
the standard I2C multi-master rules.  Using GPIOs is generally useful in
the case where there is a device on the bus that has errata and/or bugs
that makes standard multimaster mode not feasible.

Note that this scheme works well enough but has some downsides:
* It is nonstandard (not using standard I2C multimaster)
* Having two masters on a bus in general makes it relatively hard to debug
  problems (hard to tell if i2c issues were caused by one master, another, or
  some device on the bus).

Algorithm:

All masters on the bus have a 'bus claim' line which is an output that the
others can see. These are all active low with pull-ups enabled.  We'll
describe these lines as:

- OUR_CLAIM: output from us signaling to other hosts that we want the bus
- THEIR_CLAIMS: output from others signaling that they want the bus

The basic algorithm is to assert your line when you want the bus, then make
sure that the other side doesn't want it also.  A detailed explanation is best
done with an example.

Let's say we want to claim the bus.  We:
1. Assert OUR_CLAIM.
2. Waits a little bit for the other sides to notice (slew time, say 10
   microseconds).
3. Check THEIR_CLAIMS.  If none are asserted then the we have the bus and we are
   done.
4. Otherwise, wait for a few milliseconds and see if THEIR_CLAIMS are released.
5. If not, back off, release the claim and wait for a few more milliseconds.
6. Go back to 1 (until retry time has expired).

Required properties:
- compatible: i2c-arb-gpio-challenge
- our-claim-gpio: The GPIO that we use to claim the bus.
- their-claim-gpios: The GPIOs that the other sides use to claim the bus.
  Note that some implementations may only support a single other master.
- I2C arbitration bus node. See i2c-arb.txt in this directory.

Optional properties:
- slew-delay-us: microseconds to wait for a GPIO to go high. Default is 10 us.
- wait-retry-us: we'll attempt another claim after this many microseconds.
    Default is 3000 us.
- wait-free-us: we'll give up after this many microseconds. Default is 50000 us.

Example:
	i2c@12ca0000 {
		compatible = "acme,some-i2c-device";
		#address-cells = <1>;
		#size-cells = <0>;
	};

	i2c-arbitrator {
		compatible = "i2c-arb-gpio-challenge";

		i2c-parent = <&{/i2c@12CA0000}>;

		our-claim-gpio = <&gpf0 3 1>;
		their-claim-gpios = <&gpe0 4 1>;
		slew-delay-us = <10>;
		wait-retry-us = <3000>;
		wait-free-us = <50000>;

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

			i2c@52 {
				// Normal I2C device
			};
		};
	};


code:
Common i2c arbitration bus properties.

- i2c-arb child node

Required properties for the i2c-arb child node:
- #address-cells = <1>;
- #size-cells = <0>;

Optional properties for i2c-arb child node:
- Child nodes conforming to i2c bus binding

Example :

	/*
	   An NXP pca9541 I2C bus master selector at address 0x74
	   with a NXP pca8574 GPIO expander attached.
	 */

	arb@74 {
		compatible = "nxp,pca9541";
		reg = <0x74>;

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

			gpio@38 {
				compatible = "nxp,pca8574";
				reg = <0x38>;
				#gpio-cells = <2>;
				gpio-controller;
			};
		};
	};


code:
LSI Axxia I2C

Required properties :
- compatible : Must be "lsi,api2c"
- reg : Offset and length of the register set for the device
- interrupts : the interrupt specifier
- #address-cells : Must be <1>;
- #size-cells : Must be <0>;
- clock-names : Must contain "i2c".
- clocks: Must contain an entry for each name in clock-names. See the common
  clock bindings.

Optional properties :
- clock-frequency : Desired I2C bus clock frequency in Hz. If not specified,
  the default 100 kHz frequency will be used. As only Normal and Fast modes
  are supported, possible values are 100000 and 400000.

Example :

i2c@2010084000 {
	compatible = "lsi,api2c";
	device_type = "i2c";
	#address-cells = <1>;
	#size-cells = <0>;
	reg = <0x20 0x10084000 0x00 0x1000>;
	interrupts = <0 19 4>;
	clocks = <&clk_per>;
	clock-names = "i2c";
	clock-frequency = <400000>;
};


code:
Device tree bindings for i2c-cbus-gpio driver

Required properties:
	- compatible = "i2c-cbus-gpio";
	- gpios: clk, dat, sel
	- #address-cells = <1>;
	- #size-cells = <0>;

Optional properties:
	- child nodes conforming to i2c bus binding

Example:

i2c@0 {
	compatible = "i2c-cbus-gpio";
	gpios = <&gpio 66 0 /* clk */
		 &gpio 65 0 /* dat */
		 &gpio 64 0 /* sel */
		>;
	#address-cells = <1>;
	#size-cells = <0>;

	retu: retu@1 {
		compatible = "nokia,retu";
		reg = <0x1>;
	};
};


code:
* Texas Instruments Davinci/Keystone I2C

This file provides information, what the device node for the
davinci/keystone i2c interface contains.

Required properties:
- compatible: "ti,davinci-i2c" or "ti,keystone-i2c";
- reg : Offset and length of the register set for the device
- clocks: I2C functional clock phandle.
	  For 66AK2G this property should be set per binding,
	  Documentation/devicetree/bindings/clock/ti,sci-clk.yaml

SoC-specific Required Properties:

The following are mandatory properties for Keystone 2 66AK2G SoCs only:

- power-domains:	Should contain a phandle to a PM domain provider node
			and an args specifier containing the I2C device id
			value. This property is as per the binding,
			Documentation/devicetree/bindings/soc/ti/sci-pm-domain.yaml

Recommended properties :
- interrupts : standard interrupt property.
- clock-frequency : desired I2C bus clock frequency in Hz.
- ti,has-pfunc: boolean; if defined, it indicates that SoC supports PFUNC
	registers. PFUNC registers allow to switch I2C pins to function as
	GPIOs, so they can be toggled manually.

Example (enbw_cmc board):
	i2c@1c22000 {
		compatible = "ti,davinci-i2c";
		reg = <0x22000 0x1000>;
		clock-frequency = <100000>;
		interrupts = <15>;
		interrupt-parent = <&intc>;
		#address-cells = <1>;
		#size-cells = <0>;

		dtt@48 {
			compatible = "national,lm75";
			reg = <0x48>;
		};
	};


code:
Pinctrl-based I2C Bus DeMux

This binding describes an I2C bus demultiplexer that uses pin multiplexing to
route the I2C signals, and represents the pin multiplexing configuration using
the pinctrl device tree bindings. This may be used to select one I2C IP core at
runtime which may have a better feature set for a given task than another I2C
IP core on the SoC. The most simple example is to fall back to GPIO bitbanging
if your current runtime configuration hits an errata of the internal IP core.

    +-------------------------------+
    | SoC                           |
    |                               |   +-----+  +-----+
    |   +------------+              |   | dev |  | dev |
    |   |I2C IP Core1|--\           |   +-----+  +-----+
    |   +------------+   \-------+  |      |        |
    |                    |Pinctrl|--|------+--------+
    |   +------------+   +-------+  |
    |   |I2C IP Core2|--/           |
    |   +------------+              |
    |                               |
    +-------------------------------+

Required properties:
- compatible: "i2c-demux-pinctrl"
- i2c-parent: List of phandles of I2C masters available for selection. The first
	      one will be used as default.
- i2c-bus-name: The name of this bus. Also needed as pinctrl-name for the I2C
		parents.

Furthermore, I2C mux properties and child nodes. See i2c-mux.yaml in this
directory.

Example:

Here is a snipplet for a bus to be demuxed. It contains various i2c clients for
HDMI, so the bus is named "i2c-hdmi":

	i2chdmi: i2c@8 {

		compatible = "i2c-demux-pinctrl";
		i2c-parent = <&gpioi2c>, <&iic2>, <&i2c2>;
		i2c-bus-name = "i2c-hdmi";
		#address-cells = <1>;
		#size-cells = <0>;

		ak4643: sound-codec@12 {
			compatible = "asahi-kasei,ak4643";

			#sound-dai-cells = <0>;
			reg = <0x12>;
		};

		composite-in@20 {
			compatible = "adi,adv7180";
			reg = <0x20>;
			remote = <&vin1>;

			port {
				adv7180: endpoint {
					bus-width = <8>;
					remote-endpoint = <&vin1ep0>;
				};
			};
		};

		hdmi@39 {
			compatible = "adi,adv7511w";
			reg = <0x39>;
			interrupt-parent = <&gpio1>;
			interrupts = <15 IRQ_TYPE_LEVEL_LOW>;

			adi,input-depth = <8>;
			adi,input-colorspace = "rgb";
			adi,input-clock = "1x";
			adi,input-style = <1>;
			adi,input-justification = "evenly";

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

				port@0 {
					reg = <0>;
					adv7511_in: endpoint {
						remote-endpoint = <&du_out_lvds0>;
					};
				};

				port@1 {
					reg = <1>;
					adv7511_out: endpoint {
						remote-endpoint = <&hdmi_con>;
					};
				};
			};
		};
	};

And for clarification, here are the snipplets for the i2c-parents:

	gpioi2c: i2c@9 {
		#address-cells = <1>;
		#size-cells = <0>;
		compatible = "i2c-gpio";
		gpios = <&gpio5 6 GPIO_ACTIVE_HIGH /* sda */
			 &gpio5 5 GPIO_ACTIVE_HIGH /* scl */
			>;
		i2c-gpio,delay-us = <5>;
	};

...

&i2c2	{
	pinctrl-0 = <&i2c2_pins>;
	pinctrl-names = "i2c-hdmi";

	clock-frequency = <100000>;
};

...

&iic2	{
	pinctrl-0 = <&iic2_pins>;
	pinctrl-names = "i2c-hdmi";

	clock-frequency = <100000>;
};

Please note:

- pinctrl properties for the parent I2C controllers need a pinctrl state
  with the same name as i2c-bus-name, not "default"!

- the i2c masters must have their status "disabled". This driver will
  enable them at runtime when needed.


code:
Conexant Digicolor I2C controller

Required properties:
 - compatible: must be "cnxt,cx92755-i2c"
 - reg: physical address and length of the device registers
 - interrupts: a single interrupt specifier
 - clocks: clock for the device
 - #address-cells: should be <1>
 - #size-cells: should be <0>

Optional properties:
- clock-frequency: the desired I2C bus clock frequency in Hz; in
  absence of this property the default value is used (100 kHz).

Example:

	i2c: i2c@f0000120 {
		compatible = "cnxt,cx92755-i2c";
		reg = <0xf0000120 0x10>;
		interrupts = <28>;
		clocks = <&main_clk>;
		clock-frequency = <100000>;
		#address-cells = <1>;
		#size-cells = <0>;
	};


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

title: Samsung's High Speed I2C controller

maintainers:
  - Krzysztof Kozlowski <krzk@kernel.org>

description: |
  The Samsung's High Speed I2C controller is used to interface with I2C devices
  at various speeds ranging from 100kHz to 3.4MHz.

  In case the HSI2C controller is encapsulated within USI block (it's the case
  e.g. for Exynos850 and Exynos Auto V9 SoCs), it might be also necessary to
  define USI node in device tree file, choosing "i2c" configuration. Please see
  Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml for details.

properties:
  compatible:
    oneOf:
      - enum:
          - samsung,exynos5250-hsi2c    # Exynos5250 and Exynos5420
          - samsung,exynos5260-hsi2c    # Exynos5260
          - samsung,exynos7-hsi2c       # Exynos7
          - samsung,exynosautov9-hsi2c  # ExynosAutoV9 and Exynos850
      - const: samsung,exynos5-hsi2c    # Exynos5250 and Exynos5420
        deprecated: true

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clock-frequency:
    default: 100000
    description:
      Desired operating frequency in Hz of the bus.

      If not specified, the bus operates in fast-speed mode at 100kHz.

      If specified, the bus operates in high-speed mode only if the
      clock-frequency is >= 1MHz.

  clocks:
    minItems: 1
    items:
      - description: I2C operating clock
      - description: Bus clock (APB)

  clock-names:
    minItems: 1
    items:
      - const: hsi2c
      - const: hsi2c_pclk

required:
  - compatible
  - reg
  - interrupts
  - clocks

allOf:
  - $ref: /schemas/i2c/i2c-controller.yaml#
  - if:
      properties:
        compatible:
          contains:
            enum:
              - samsung,exynosautov9-hsi2c

    then:
      properties:
        clocks:
          minItems: 2

        clock-names:
          minItems: 2

      required:
        - clock-names

    else:
      properties:
        clocks:
          maxItems: 1

unevaluatedProperties: false

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

    hsi2c_8: i2c@12e00000 {
        compatible = "samsung,exynos5250-hsi2c";
        reg = <0x12e00000 0x1000>;
        interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>;
        #address-cells = <1>;
        #size-cells = <0>;
        clock-frequency = <100000>;
        clocks = <&clock CLK_USI4>;
        clock-names = "hsi2c";

        pmic@66 {
            /* compatible = "samsung,s2mps11-pmic"; */
            reg = <0x66>;
        };
    };

  - |
    #include <dt-bindings/clock/exynos850.h>
    #include <dt-bindings/interrupt-controller/arm-gic.h>

    hsi2c_2: i2c@138c0000 {
        compatible = "samsung,exynosautov9-hsi2c";
        reg = <0x138c0000 0xc0>;
        interrupts = <GIC_SPI 195 IRQ_TYPE_LEVEL_HIGH>;
        #address-cells = <1>;
        #size-cells = <0>;
        clocks = <&cmu_peri CLK_GOUT_HSI2C2_IPCLK>,
                 <&cmu_peri CLK_GOUT_HSI2C2_PCLK>;
        clock-names = "hsi2c", "hsi2c_pclk";

        pmic@66 {
            /* compatible = "samsung,s2mps11-pmic"; */
            reg = <0x66>;
        };
    };


code:
Device-tree bindings for FSI-attached I2C master and busses
-----------------------------------------------------------

Required properties:
 - compatible = "ibm,i2c-fsi";
 - reg = < address size >;		: The FSI CFAM address and address
					  space size.
 - #address-cells = <1>;		: Number of address cells in child
					  nodes.
 - #size-cells = <0>;			: Number of size cells in child nodes.
 - child nodes				: Nodes to describe busses off the I2C
					  master.

Child node required properties:
 - reg = < port number >		: The port number on the I2C master.

Child node optional properties:
 - child nodes				: Nodes to describe devices on the I2C
					  bus.

Examples:

    i2c@1800 {
        compatible = "ibm,i2c-fsi";
        reg = < 0x1800 0x400 >;
        #address-cells = <1>;
        #size-cells = <0>;

        i2c-bus@0 {
            reg = <0>;
        };

        i2c-bus@1 {
            reg = <1>;

            eeprom@50 {
                compatible = "vendor,dev-name";
            };
        };
    };


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

title: Common i2c gate properties

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

description: |
  An i2c gate is useful to e.g. reduce the digital noise for RF tuners connected
  to the i2c bus. Gates are similar to arbitrators in that you need to perform
  some kind of operation to access the i2c bus past the arbitrator/gate, but
  there are no competing masters to consider for gates and therefore there is
  no arbitration happening for gates.

allOf:
  - $ref: /schemas/i2c/i2c-controller.yaml

properties:
  $nodename:
    const: i2c-gate

additionalProperties: true

examples:
  - |
    i2c-gate {
        #address-cells = <1>;
        #size-cells = <0>;
        ak8975@c {
            compatible = "asahi-kasei,ak8975";
            reg = <0x0c>;
        };
    };
...


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

title: Bindings for GPIO bitbanged I2C

maintainers:
  - Wolfram Sang <wsa@kernel.org>

allOf:
  - $ref: /schemas/i2c/i2c-controller.yaml#

properties:
  compatible:
    items:
      - const: i2c-gpio

  sda-gpios:
    description:
      gpio used for the sda signal, this should be flagged as
      active high using open drain with (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)
      from <dt-bindings/gpio/gpio.h> since the signal is by definition
      open drain.
    maxItems: 1

  scl-gpios:
    description:
      gpio used for the scl signal, this should be flagged as
      active high using open drain with (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)
      from <dt-bindings/gpio/gpio.h> since the signal is by definition
      open drain.
    maxItems: 1

  i2c-gpio,scl-output-only:
    description: scl as output only
    type: boolean

  i2c-gpio,delay-us:
    description: delay between GPIO operations (may depend on each platform)

  i2c-gpio,timeout-ms:
    description: timeout to get data

  # Deprecated properties, do not use in new device tree sources:
  gpios:
    minItems: 2
    maxItems: 2
    description: sda and scl gpio, alternative for {sda,scl}-gpios

  i2c-gpio,sda-open-drain:
    type: boolean
    deprecated: true
    description: this means that something outside of our control has put
      the GPIO line used for SDA into open drain mode, and that something is
      not the GPIO chip. It is essentially an inconsistency flag.

  i2c-gpio,scl-open-drain:
    type: boolean
    deprecated: true
    description: this means that something outside of our control has put the
      GPIO line used for SCL into open drain mode, and that something is not
      the GPIO chip. It is essentially an inconsistency flag.

required:
  - compatible
  - sda-gpios
  - scl-gpios

unevaluatedProperties: false

...


code:
I2C for Hisilicon hix5hd2 chipset platform

Required properties:
- compatible: Must be "hisilicon,hix5hd2-i2c"
- reg: physical base address of the controller and length of memory mapped
     region.
- interrupts: interrupt number to the cpu.
- #address-cells = <1>;
- #size-cells = <0>;
- clocks: phandles to input clocks.

Optional properties:
- clock-frequency: Desired I2C bus frequency in Hz, otherwise defaults to 100000
- Child nodes conforming to i2c bus binding

Examples:
I2C0@f8b10000 {
	compatible = "hisilicon,hix5hd2-i2c";
	reg = <0xf8b10000 0x1000>;
	interrupts = <0 38 4>;
	clocks = <&clock HIX5HD2_I2C0_RST>;
	#address-cells = <1>;
	#size-cells = <0>;
}


code:
IMG Serial Control Bus (SCB) I2C Controller

Required Properties:
- compatible: "img,scb-i2c"
- reg: Physical base address and length of controller registers
- interrupts: Interrupt number used by the controller
- clocks : Should contain a clock specifier for each entry in clock-names
- clock-names : Should contain the following entries:
                "scb", for the SCB core clock.
                "sys", for the system clock.
- clock-frequency: The I2C bus frequency in Hz
- #address-cells: Should be <1>
- #size-cells: Should be <0>

Example:

i2c@18100000 {
	compatible = "img,scb-i2c";
	reg = <0x18100000 0x200>;
	interrupts = <GIC_SHARED 2 IRQ_TYPE_LEVEL_HIGH>;
	clocks = <&i2c0_clk>, <&system_clk>;
	clock-names = "scb", "sys";
	clock-frequency = <400000>;
	#address-cells = <1>;
	#size-cells = <0>;
};


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

title: Freescale Low Power Inter IC (LPI2C) for i.MX

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

allOf:
  - $ref: /schemas/i2c/i2c-controller.yaml#

properties:
  compatible:
    oneOf:
      - enum:
          - fsl,imx7ulp-lpi2c
      - items:
          - enum:
              - fsl,imx8qxp-lpi2c
              - fsl,imx8dxl-lpi2c
              - fsl,imx8qm-lpi2c
              - fsl,imx8ulp-lpi2c
              - fsl,imx93-lpi2c
          - const: fsl,imx7ulp-lpi2c

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  assigned-clock-parents: true
  assigned-clock-rates: true
  assigned-clocks: true
  clock-frequency: true

  clock-names:
    items:
      - const: per
      - const: ipg

  clocks:
    maxItems: 2

  dmas:
    items:
      - description: DMA controller phandle and request line for TX
      - description: DMA controller phandle and request line for RX

  dma-names:
    items:
      - const: tx
      - const: rx

  power-domains:
    maxItems: 1

required:
  - compatible
  - reg
  - interrupts
  - clocks

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/clock/imx7ulp-clock.h>
    #include <dt-bindings/interrupt-controller/arm-gic.h>

    i2c@40a50000 {
        compatible = "fsl,imx7ulp-lpi2c";
        reg = <0x40A50000 0x10000>;
        interrupt-parent = <&intc>;
        interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
        clocks = <&clks IMX7ULP_CLK_LPI2C7>,
                 <&clks IMX7ULP_CLK_NIC1_BUS_DIV>;
    };


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

title: Freescale Inter IC (I2C) and High Speed Inter IC (HS-I2C) for i.MX

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

allOf:
  - $ref: /schemas/i2c/i2c-controller.yaml#

properties:
  compatible:
    oneOf:
      - const: fsl,imx1-i2c
      - const: fsl,imx21-i2c
      - const: fsl,vf610-i2c
      - items:
          - enum:
              - fsl,ls1012a-i2c
              - fsl,ls1021a-i2c
              - fsl,ls1028a-i2c
              - fsl,ls1043a-i2c
              - fsl,ls1046a-i2c
              - fsl,ls1088a-i2c
              - fsl,ls208xa-i2c
              - fsl,lx2160a-i2c
          - const: fsl,vf610-i2c
      - items:
          - const: fsl,imx35-i2c
          - const: fsl,imx1-i2c
      - items:
          - const: fsl,imx7d-i2c
          - const: fsl,imx21-i2c
      - items:
          - enum:
              - fsl,imx25-i2c
              - fsl,imx27-i2c
              - fsl,imx31-i2c
              - fsl,imx50-i2c
              - fsl,imx51-i2c
              - fsl,imx53-i2c
              - fsl,imx6q-i2c
              - fsl,imx6sl-i2c
              - fsl,imx6sx-i2c
              - fsl,imx6sll-i2c
              - fsl,imx6ul-i2c
              - fsl,imx7s-i2c
              - fsl,imx8mq-i2c
              - fsl,imx8mm-i2c
              - fsl,imx8mn-i2c
              - fsl,imx8mp-i2c
          - const: fsl,imx21-i2c

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    maxItems: 1

  clock-names:
    const: ipg

  clock-frequency:
    minimum: 1
    default: 100000
    maximum: 400000

  dmas:
    items:
      - description: DMA controller phandle and request line for RX
      - description: DMA controller phandle and request line for TX

  dma-names:
    items:
      - const: rx
      - const: tx

  sda-gpios:
    maxItems: 1

  scl-gpios:
    maxItems: 1

required:
  - compatible
  - reg
  - interrupts
  - clocks

unevaluatedProperties: false

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

    i2c@83fc4000 {
        compatible = "fsl,imx51-i2c", "fsl,imx21-i2c";
        reg = <0x83fc4000 0x4000>;
        interrupts = <63>;
        clocks = <&clks IMX5_CLK_I2C2_GATE>;
    };

  - |
    #include <dt-bindings/clock/vf610-clock.h>

    i2c@40066000 {
        compatible = "fsl,vf610-i2c";
        reg = <0x40066000 0x1000>;
        interrupts = <71 IRQ_TYPE_LEVEL_HIGH>;
        clocks = <&clks VF610_CLK_I2C0>;
        clock-names = "ipg";
        dmas = <&edma0 0 50>,
               <&edma0 0 51>;
        dma-names = "rx", "tx";
    };


code:
i2c Controller on XScale platforms such as IOP3xx and IXP4xx

Required properties:
- compatible : Must be one of
  "intel,iop3xx-i2c"
  "intel,ixp4xx-i2c";
- reg
- #address-cells = <1>;
- #size-cells = <0>;

Optional properties:
- Child nodes conforming to i2c bus binding

Example:

i2c@c8011000 {
	compatible = "intel,ixp4xx-i2c";
	reg = <0xc8011000 0x18>;
	interrupts = <33 IRQ_TYPE_LEVEL_LOW>;
};


code:
NXP I2C controller for LPC2xxx/178x/18xx/43xx

Required properties:
 - compatible: must be "nxp,lpc1788-i2c"
 - reg: physical address and length of the device registers
 - interrupts: a single interrupt specifier
 - clocks: clock for the device
 - #address-cells: should be <1>
 - #size-cells: should be <0>

Optional properties:
- clock-frequency: the desired I2C bus clock frequency in Hz; in
  absence of this property the default value is used (100 kHz).

Example:
i2c0: i2c@400a1000 {
	compatible = "nxp,lpc1788-i2c";
	reg = <0x400a1000 0x1000>;
	interrupts = <18>;
	clocks = <&ccu1 CLK_APB1_I2C0>;
	#address-cells = <1>;
	#size-cells = <0>;
};

&i2c0 {
	clock-frequency = <400000>;

	lm75@48 {
		compatible = "nxp,lm75";
		reg = <0x48>;
	};
};


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

title: I2C-Bus adapter for MPC824x/83xx/85xx/86xx/512x/52xx SoCs

maintainers:
  - Chris Packham <chris.packham@alliedtelesis.co.nz>

allOf:
  - $ref: /schemas/i2c/i2c-controller.yaml#

properties:
  compatible:
    oneOf:
      - items:
          - enum:
              - mpc5200-i2c
              - fsl,mpc5200-i2c
              - fsl,mpc5121-i2c
              - fsl,mpc8313-i2c
              - fsl,mpc8543-i2c
              - fsl,mpc8544-i2c
          - const: fsl-i2c
      - items:
          - const: fsl,mpc5200b-i2c
          - const: fsl,mpc5200-i2c
          - const: fsl-i2c

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  fsl,preserve-clocking:
    $ref: /schemas/types.yaml#/definitions/flag
    description: |
      if defined, the clock settings from the bootloader are
      preserved (not touched)

  fsl,timeout:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      I2C bus timeout in microseconds

  fsl,i2c-erratum-a004447:
    $ref: /schemas/types.yaml#/definitions/flag
    description: |
      Indicates the presence of QorIQ erratum A-004447, which
      says that the standard i2c recovery scheme mechanism does
      not work and an alternate implementation is needed.

required:
  - compatible
  - reg
  - interrupts

unevaluatedProperties: false

examples:
  - |
    /* MPC5121 based board */
    i2c@1740 {
        #address-cells = <1>;
        #size-cells = <0>;
        compatible = "fsl,mpc5121-i2c", "fsl-i2c";
        reg = <0x1740 0x20>;
        interrupts = <11 0x8>;
        interrupt-parent = <&ipic>;
        clock-frequency = <100000>;
    };

  - |
    /* MPC5200B based board */
    i2c@3d00 {
        #address-cells = <1>;
        #size-cells = <0>;
        compatible = "fsl,mpc5200b-i2c", "fsl,mpc5200-i2c", "fsl-i2c";
        reg = <0x3d00 0x40>;
        interrupts = <2 15 0>;
        interrupt-parent = <&mpc5200_pic>;
        fsl,preserve-clocking;
    };

  - |
    /* MPC8544 base board */
    i2c@3100 {
        #address-cells = <1>;
        #size-cells = <0>;
        compatible = "fsl,mpc8544-i2c", "fsl-i2c";
        reg = <0x3100 0x100>;
        interrupts = <43 2>;
        interrupt-parent = <&mpic>;
        clock-frequency = <400000>;
        fsl,timeout = <10000>;
    };
...


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

title: MediaTek I2C controller

description:
  This driver interfaces with the native I2C controller present in
  various MediaTek SoCs.

allOf:
  - $ref: /schemas/i2c/i2c-controller.yaml#

maintainers:
  - Qii Wang <qii.wang@mediatek.com>

properties:
  compatible:
    oneOf:
      - const: mediatek,mt2712-i2c
      - const: mediatek,mt6577-i2c
      - const: mediatek,mt6589-i2c
      - const: mediatek,mt7622-i2c
      - const: mediatek,mt7986-i2c
      - const: mediatek,mt8168-i2c
      - const: mediatek,mt8173-i2c
      - const: mediatek,mt8183-i2c
      - const: mediatek,mt8186-i2c
      - const: mediatek,mt8188-i2c
      - const: mediatek,mt8192-i2c
      - items:
          - enum:
              - mediatek,mt7629-i2c
              - mediatek,mt8516-i2c
          - const: mediatek,mt2712-i2c
      - items:
          - enum:
              - mediatek,mt2701-i2c
              - mediatek,mt6797-i2c
              - mediatek,mt7623-i2c
          - const: mediatek,mt6577-i2c
      - items:
          - enum:
              - mediatek,mt8195-i2c
          - const: mediatek,mt8192-i2c

  reg:
    items:
      - description: Physical base address
      - description: DMA base address

  interrupts:
    maxItems: 1

  clocks:
    minItems: 2
    items:
      - description: Main clock for I2C bus
      - description: Clock for I2C via DMA
      - description: Bus arbitrator clock
      - description: Clock for I2C from PMIC

  clock-names:
    minItems: 2
    items:
      - const: main
      - const: dma
      - const: arb
      - const: pmic

  clock-div:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Frequency divider of clock source in I2C module

  clock-frequency:
    default: 100000
    description:
      SCL frequency to use (in Hz). If omitted, 100kHz is used.

  mediatek,have-pmic:
    description: Platform controls I2C from PMIC side
    type: boolean

  mediatek,use-push-pull:
    description: Use push-pull mode I/O config
    type: boolean

  vbus-supply:
    description: Phandle to the regulator providing power to SCL/SDA

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

unevaluatedProperties: false

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

    i2c0: i2c@1100d000 {
      compatible = "mediatek,mt6577-i2c";
      reg = <0x1100d000 0x70>, <0x11000300 0x80>;
      interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_LOW>;
      clocks = <&i2c0_ck>, <&ap_dma_ck>;
      clock-names = "main", "dma";
      clock-div = <16>;
      clock-frequency = <400000>;
      mediatek,have-pmic;

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


code:
# SPDX-License-Identifier: GPL-2.0-only
%YAML 1.2
---
$id: http://devicetree.org/schemas/i2c/i2c-mux-gpio.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: GPIO-based I2C Bus Mux

maintainers:
  - Wolfram Sang <wsa@kernel.org>

description: |
  This binding describes an I2C bus multiplexer that uses GPIOs to route the I2C signals.

                                  +-----+  +-----+
                                  | dev |  | dev |
    +------------+                +-----+  +-----+
    | SoC        |                   |        |
    |            |          /--------+--------+
    |   +------+ |  +------+    child bus A, on GPIO value set to 0
    |   | I2C  |-|--| Mux  |
    |   +------+ |  +--+---+    child bus B, on GPIO value set to 1
    |            |     |    \----------+--------+--------+
    |   +------+ |     |               |        |        |
    |   | GPIO |-|-----+            +-----+  +-----+  +-----+
    |   +------+ |                  | dev |  | dev |  | dev |
    +------------+                  +-----+  +-----+  +-----+

  For each I2C child node, an I2C child bus will be created. They will be numbered based on their
  order in the device tree.

  Whenever an access is made to a device on a child bus, the value set in the relevant node's reg
  property will be output using the list of GPIOs, the first in the list holding the least-
  significant value.

  If an idle state is defined, using the idle-state (optional) property, whenever an access is not
  being made to a device on a child bus, the GPIOs will be set according to the idle value.

  If an idle state is not defined, the most recently used value will be left programmed into
  hardware whenever no access is being made to a device on a child bus.

properties:
  compatible:
    const: i2c-mux-gpio

  i2c-parent:
    description: phandle of the I2C bus that this multiplexer's master-side port is connected to
    $ref: "/schemas/types.yaml#/definitions/phandle"

  mux-gpios:
    description: list of GPIOs used to control the muxer
    minItems: 1
    maxItems: 4  # Should be enough

  idle-state:
    description: Value to set the muxer to when idle. When no value is given, it defaults to the
      last value used.
    $ref: "/schemas/types.yaml#/definitions/uint32"

allOf:
  - $ref: i2c-mux.yaml

unevaluatedProperties: false

required:
  - compatible
  - i2c-parent
  - mux-gpios

examples:
  - |
    i2cmux {
      compatible = "i2c-mux-gpio";
      #address-cells = <1>;
      #size-cells = <0>;
      mux-gpios = <&gpio1 22 0>, <&gpio1 23 0>;
      i2c-parent = <&i2c1>;

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

        ssd1307: oled@3c {
          compatible = "solomon,ssd1307fb-i2c";
          reg = <0x3c>;
          pwms = <&pwm 4 3000>;
          reset-gpios = <&gpio2 7 1>;
        };
      };

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

        pca9555: pca9555@20 {
          compatible = "nxp,pca9555";
          gpio-controller;
          #gpio-cells = <2>;
          reg = <0x20>;
        };
      };
    };