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

title: MT6360 PMIC from MediaTek Integrated

maintainers:
  - Gene Chen <gene_chen@richtek.com>

description: |
  MT6360 is a PMIC device with the following sub modules.
  It is interfaced to host controller using I2C interface.

  This document describes the binding for PMIC device and its sub module.

properties:
  compatible:
    const: mediatek,mt6360

  reg:
    maxItems: 1

  wakeup-source: true

  interrupts:
    maxItems: 1

  interrupt-names:
    const: IRQB

  interrupt-controller: true

  "#interrupt-cells":
    const: 1
    description:
      The first cell is the IRQ number.

  regulators:
    $ref: /schemas/regulator/mt6360-regulator.yaml#

  charger:
    $ref: /schemas/power/supply/mt6360_charger.yaml#

  tcpc:
    $ref: /schemas/usb/mediatek,mt6360-tcpc.yaml#

  led-controller:
    $ref: /schemas/leds/leds-mt6360.yaml#

required:
  - compatible
  - reg
  - interrupts
  - interrupt-controller
  - "#interrupt-cells"

additionalProperties:
  type: object

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    #include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
    #include <dt-bindings/leds/common.h>
    #include <dt-bindings/usb/pd.h>
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        pmic@34 {
            compatible = "mediatek,mt6360";
            reg = <0x34>;
            wakeup-source;
            interrupts-extended = <&gpio26 0 IRQ_TYPE_LEVEL_LOW>;
            interrupt-names = "IRQB";
            interrupt-controller;
            #interrupt-cells = <1>;

            mt6360_charger: charger {
                compatible = "mediatek,mt6360-chg";
                richtek,vinovp-microvolt = <14500000>;

                otg_vbus_regulator: usb-otg-vbus-regulator {
                    regulator-name = "usb-otg-vbus";
                    regulator-min-microvolt = <4425000>;
                    regulator-max-microvolt = <5825000>;
                };
            };

            led-controller {
                compatible = "mediatek,mt6360-led";
                #address-cells = <1>;
                #size-cells = <0>;

                multi-led@0 {
                    reg = <0>;
                    function = LED_FUNCTION_INDICATOR;
                    color = <LED_COLOR_ID_RGB>;
                    led-max-microamp = <24000>;
                    #address-cells = <1>;
                    #size-cells = <0>;
                    led@0 {
                        reg = <0>;
                        color = <LED_COLOR_ID_RED>;
                    };
                    led@1 {
                        reg = <1>;
                        color = <LED_COLOR_ID_GREEN>;
                    };
                    led@2 {
                        reg = <2>;
                        color = <LED_COLOR_ID_BLUE>;
                    };
                };
                led@3 {
                    reg = <3>;
                    function = LED_FUNCTION_INDICATOR;
                    color = <LED_COLOR_ID_WHITE>;
                    led-max-microamp = <150000>;
                };
                led@4 {
                    reg = <4>;
                    function = LED_FUNCTION_FLASH;
                    color = <LED_COLOR_ID_WHITE>;
                    function-enumerator = <1>;
                    led-max-microamp = <200000>;
                    flash-max-microamp = <500000>;
                    flash-max-timeout-us = <1024000>;
                };
                led@5 {
                    reg = <5>;
                    function = LED_FUNCTION_FLASH;
                    color = <LED_COLOR_ID_WHITE>;
                    function-enumerator = <2>;
                    led-max-microamp = <200000>;
                    flash-max-microamp = <500000>;
                    flash-max-timeout-us = <1024000>;
                };
            };

            regulators {
                compatible = "mediatek,mt6360-regulator";
                LDO_VIN3-supply = <&BUCK2>;
                buck1 {
                    regulator-name = "mt6360,buck1";
                    regulator-min-microvolt = <300000>;
                    regulator-max-microvolt = <1300000>;
                    regulator-allowed-modes = <MT6360_OPMODE_NORMAL
                         MT6360_OPMODE_LP
                         MT6360_OPMODE_ULP>;
                };
                BUCK2: buck2 {
                    regulator-name = "mt6360,buck2";
                    regulator-min-microvolt = <300000>;
                    regulator-max-microvolt = <1300000>;
                    regulator-allowed-modes = <MT6360_OPMODE_NORMAL
                         MT6360_OPMODE_LP
                         MT6360_OPMODE_ULP>;
                };
                ldo6 {
                    regulator-name = "mt6360,ldo6";
                    regulator-min-microvolt = <500000>;
                    regulator-max-microvolt = <2100000>;
                    regulator-allowed-modes = <MT6360_OPMODE_NORMAL
                         MT6360_OPMODE_LP>;
                };
                ldo7 {
                    regulator-name = "mt6360,ldo7";
                    regulator-min-microvolt = <500000>;
                    regulator-max-microvolt = <2100000>;
                    regulator-allowed-modes = <MT6360_OPMODE_NORMAL
                         MT6360_OPMODE_LP>;
                };
                ldo1 {
                    regulator-name = "mt6360,ldo1";
                    regulator-min-microvolt = <1200000>;
                    regulator-max-microvolt = <3600000>;
                    regulator-allowed-modes = <MT6360_OPMODE_NORMAL
                         MT6360_OPMODE_LP>;
                };
                ldo2 {
                    regulator-name = "mt6360,ldo2";
                    regulator-min-microvolt = <1200000>;
                    regulator-max-microvolt = <3600000>;
                    regulator-allowed-modes = <MT6360_OPMODE_NORMAL
                         MT6360_OPMODE_LP>;
                };
                ldo3 {
                    regulator-name = "mt6360,ldo3";
                    regulator-min-microvolt = <1200000>;
                    regulator-max-microvolt = <3600000>;
                    regulator-allowed-modes = <MT6360_OPMODE_NORMAL
                         MT6360_OPMODE_LP>;
                };
                ldo5 {
                    regulator-name = "mt6360,ldo5";
                    regulator-min-microvolt = <2700000>;
                    regulator-max-microvolt = <3600000>;
                    regulator-allowed-modes = <MT6360_OPMODE_NORMAL
                         MT6360_OPMODE_LP>;
                };
            };

            tcpc {
                compatible = "mediatek,mt6360-tcpc";
                interrupts-extended = <&gpio26 3 IRQ_TYPE_LEVEL_LOW>;
                interrupt-names = "PD_IRQB";

                connector {
                    compatible = "usb-c-connector";
                    label = "USB-C";
                    data-role = "dual";
                    power-role = "dual";
                    try-power-role = "sink";
                    source-pdos = <PDO_FIXED(5000, 1000, PDO_FIXED_DUAL_ROLE | PDO_FIXED_DATA_SWAP)>;
                    sink-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_DUAL_ROLE | PDO_FIXED_DATA_SWAP)>;
                    op-sink-microwatt = <10000000>;

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

                        port@0 {
                            reg = <0>;
                            endpoint {
                                remote-endpoint = <&usb_hs>;
                            };
                        };
                        port@1 {
                            reg = <1>;
                            endpoint {
                                remote-endpoint = <&usb_ss>;
                          };
                        };
                        port@2 {
                            reg = <2>;
                            endpoint {
                                remote-endpoint = <&dp_aux>;
                            };
                        };
                    };
                };
            };
        };
    };


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

title: MediaTek MT6370 SubPMIC

maintainers:
  - ChiYuan Huang <cy_huang@richtek.com>

description: |
  MT6370 is a highly-integrated smart power management IC, which includes a
  single cell Li-Ion/Li-Polymer switching battery charger, a USB Type-C &
  Power Delivery (PD) controller, dual flash LED current sources, a RGB LED
  driver, a backlight WLED driver, a display bias driver and a general LDO for
  portable devices.

properties:
  compatible:
    const: mediatek,mt6370

  reg:
    maxItems: 1

  wakeup-source: true

  interrupts:
    maxItems: 1

  interrupt-controller: true

  "#interrupt-cells":
    const: 1

  adc:
    type: object
    description: |
      Provides 9 channels for system monitoring, including VBUSDIV5 (lower
      accuracy, higher measure range), VBUSDIV2 (higher accuracy, lower
      measure range), VBAT, VSYS, CHG_VDDP, TS_BAT, IBUS, IBAT, and TEMP_JC.

    properties:
      compatible:
        const: mediatek,mt6370-adc

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

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

  backlight:
    type: object
    $ref: /schemas/leds/backlight/mediatek,mt6370-backlight.yaml#

  charger:
    type: object
    $ref: /schemas/power/supply/mediatek,mt6370-charger.yaml#

  tcpc:
    type: object
    $ref: /schemas/usb/mediatek,mt6370-tcpc.yaml#

  indicator:
    type: object
    $ref: /schemas/leds/mediatek,mt6370-indicator.yaml#

  flashlight:
    type: object
    $ref: /schemas/leds/mediatek,mt6370-flashlight.yaml#

  regulators:
    type: object
    description: |
      List all supported regulators, which support the control for DisplayBias
      voltages and one general purpose LDO which commonly used to drive the
      vibrator.

    patternProperties:
      "^(dsvbst|vibldo)$":
        $ref: /schemas/regulator/regulator.yaml#
        type: object
        unevaluatedProperties: false

      "^(dsvpos|dsvneg)$":
        $ref: /schemas/regulator/regulator.yaml#
        type: object
        unevaluatedProperties: false

        properties:
          enable-gpios:
            maxItems: 1

required:
  - compatible
  - reg
  - interrupts
  - interrupt-controller
  - "#interrupt-cells"
  - regulators
  - adc
  - backlight
  - indicator
  - tcpc
  - charger
  - flashlight

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    #include <dt-bindings/leds/common.h>
    #include <dt-bindings/iio/adc/mediatek,mt6370_adc.h>
    #include <dt-bindings/usb/pd.h>
    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

      pmic@34 {
        compatible = "mediatek,mt6370";
        reg = <0x34>;
        wakeup-source;
        interrupts-extended = <&gpio26 3 IRQ_TYPE_LEVEL_LOW>;
        interrupt-controller;
        #interrupt-cells = <1>;

        mt6370_adc: adc {
          compatible = "mediatek,mt6370-adc";
          #io-channel-cells = <1>;
        };

        backlight {
          compatible = "mediatek,mt6370-backlight";
          mediatek,bled-channel-use = /bits/ 8 <15>;
        };

        charger {
          compatible = "mediatek,mt6370-charger";
          interrupts = <68>, <48>, <6>;
          interrupt-names = "uvp_d_evt", "attach_i", "mivr";
          io-channels = <&mt6370_adc MT6370_CHAN_IBUS>;

          mt6370_otg_vbus: usb-otg-vbus-regulator {
            regulator-name = "mt6370-usb-otg-vbus";
            regulator-min-microvolt = <4350000>;
            regulator-max-microvolt = <5800000>;
            regulator-min-microamp = <500000>;
            regulator-max-microamp = <3000000>;
          };
        };

        indicator {
          compatible = "mediatek,mt6370-indicator";
          #address-cells = <1>;
          #size-cells = <0>;

          multi-led@0 {
            reg = <0>;
            function = LED_FUNCTION_INDICATOR;
            color = <LED_COLOR_ID_RGB>;
            led-max-microamp = <24000>;
            #address-cells = <1>;
            #size-cells = <0>;
            led@0 {
              reg = <0>;
              color = <LED_COLOR_ID_RED>;
            };
            led@1 {
              reg = <1>;
              color = <LED_COLOR_ID_GREEN>;
            };
            led@2 {
              reg = <2>;
              color = <LED_COLOR_ID_BLUE>;
            };
          };
          led@3 {
            reg = <3>;
            function = LED_FUNCTION_INDICATOR;
            color = <LED_COLOR_ID_WHITE>;
            led-max-microamp = <6000>;
          };
        };

        flashlight {
          compatible = "mediatek,mt6370-flashlight";
          #address-cells = <1>;
          #size-cells = <0>;
          led@0 {
            reg = <0>;
            led-sources = <0>;
            function = LED_FUNCTION_FLASH;
            color = <LED_COLOR_ID_WHITE>;
            function-enumerator = <1>;
            led-max-microamp = <200000>;
            flash-max-microamp = <500000>;
            flash-max-timeout-us = <1248000>;
          };
          led@1 {
            reg = <1>;
            led-sources = <1>;
            function = LED_FUNCTION_FLASH;
            color = <LED_COLOR_ID_WHITE>;
            function-enumerator = <2>;
            led-max-microamp = <200000>;
            flash-max-microamp = <500000>;
            flash-max-timeout-us = <1248000>;
          };
        };

        tcpc {
          compatible = "mediatek,mt6370-tcpc";
          interrupts-extended = <&gpio26 4 IRQ_TYPE_LEVEL_LOW>;

          connector {
            compatible = "usb-c-connector";
            label = "USB-C";
            vbus-supply = <&mt6370_otg_vbus>;
            data-role = "dual";
            power-role = "dual";
            try-power-role = "sink";
            source-pdos = <PDO_FIXED(5000, 1000, PDO_FIXED_DUAL_ROLE | PDO_FIXED_DATA_SWAP)>;
            sink-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_DUAL_ROLE | PDO_FIXED_DATA_SWAP)>;
            op-sink-microwatt = <10000000>;

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

              port@0 {
                reg = <0>;
                endpoint {
                  remote-endpoint = <&usb_hs>;
                };
              };
              port@1 {
                reg = <1>;
                endpoint {
                  remote-endpoint = <&usb_ss>;
                };
              };
              port@2 {
                reg = <2>;
                endpoint {
                  remote-endpoint = <&dp_aux>;
                };
              };
            };
          };
        };

        regulators {
          dsvbst {
            regulator-name = "mt6370-dsv-vbst";
            regulator-min-microvolt = <4000000>;
            regulator-max-microvolt = <6200000>;
          };
          dsvpos {
            regulator-name = "mt6370-dsv-vpos";
            regulator-min-microvolt = <4000000>;
            regulator-max-microvolt = <6000000>;
            regulator-boot-on;
          };
          dsvneg {
            regulator-name = "mt6370-dsv-vneg";
            regulator-min-microvolt = <4000000>;
            regulator-max-microvolt = <6000000>;
            regulator-boot-on;
          };
          vibldo {
            regulator-name = "mt6370-vib-ldo";
            regulator-min-microvolt = <1600000>;
            regulator-max-microvolt = <4000000>;
          };
        };
      };
    };

repo_name: angery/linux


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

title: MediaTek System Control Processor System

maintainers:
  - MandyJH Liu <mandyjh.liu@mediatek.com>

description:
  MediaTek System Control Processor System (SCPSYS) has several
  power management tasks. The tasks include MTCMOS power
  domain control, thermal measurement, DVFS, etc.

properties:
  compatible:
    items:
      - enum:
          - mediatek,mt8167-scpsys
          - mediatek,mt8173-scpsys
          - mediatek,mt8183-scpsys
          - mediatek,mt8186-scpsys
          - mediatek,mt8192-scpsys
          - mediatek,mt8195-scpsys
      - const: syscon
      - const: simple-mfd

  reg:
    maxItems: 1

  power-controller:
    $ref: /schemas/power/mediatek,power-controller.yaml#

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    #include <dt-bindings/clock/mt8195-clk.h>
    #include <dt-bindings/power/mt8195-power.h>

    syscon@10006000 {
      compatible = "mediatek,mt8195-scpsys", "syscon", "simple-mfd";
      reg = <0x10006000 0x100>;

      spm: power-controller {
        compatible = "mediatek,mt8195-power-controller";
        #address-cells = <1>;
        #size-cells = <0>;
        #power-domain-cells = <1>;

        /* sample of power domain nodes */
        power-domain@MT8195_POWER_DOMAIN_PCIE_PHY {
          reg = <MT8195_POWER_DOMAIN_PCIE_PHY>;
          #power-domain-cells = <0>;
        };

        power-domain@MT8195_POWER_DOMAIN_SSUSB_PCIE_PHY {
          reg = <MT8195_POWER_DOMAIN_SSUSB_PCIE_PHY>;
          #power-domain-cells = <0>;
        };
      };
    };


code:
Multi-Function Devices (MFD)

These devices comprise a nexus for heterogeneous hardware blocks containing
more than one non-unique yet varying hardware functionality.

A typical MFD can be:

- A mixed signal ASIC on an external bus, sometimes a PMIC (Power Management
  Integrated Circuit) that is manufactured in a lower technology node (rough
  silicon) that handles analog drivers for things like audio amplifiers, LED
  drivers, level shifters, PHY (physical interfaces to things like USB or
  ethernet), regulators etc.

- A range of memory registers containing "miscellaneous system registers" also
  known as a system controller "syscon" or any other memory range containing a
  mix of unrelated hardware devices.

Optional properties:

- compatible : "simple-mfd" - this signifies that the operating system should
  consider all subnodes of the MFD device as separate devices akin to how
  "simple-bus" indicates when to see subnodes as children for a simple
  memory-mapped bus. For more complex devices, when the nexus driver has to
  probe registers to figure out what child devices exist etc, this should not
  be used. In the latter case the child devices will be determined by the
  operating system.

- ranges: Describes the address mapping relationship to the parent. Should set
  the child's base address to 0, the physical address within parent's address
  space, and the length of the address map.

- #address-cells: Specifies the number of cells used to represent physical base
  addresses. Must be present if ranges is used.

- #size-cells: Specifies the number of cells used to represent the size of an
  address. Must be present if ranges is used.

Example:

foo@1000 {
	compatible = "syscon", "simple-mfd";
	reg = <0x01000 0x1000>;

	led@8.0 {
		compatible = "register-bit-led";
		offset = <0x08>;
		mask = <0x01>;
		label = "myled";
		default-state = "on";
	};
};


code:
Motorola CPCAP PMIC device tree binding

Required properties:
- compatible		: One or both of "motorola,cpcap" or "ste,6556002"
- reg			: SPI chip select
- interrupts		: The interrupt line the device is connected to
- interrupt-controller	: Marks the device node as an interrupt controller
- #interrupt-cells	: The number of cells to describe an IRQ, should be 2
- #address-cells	: Child device offset number of cells, should be 1
- #size-cells		: Child device size number of cells, should be 0
- spi-max-frequency	: Typically set to 3000000
- spi-cs-high		: SPI chip select direction

Optional subnodes:

The sub-functions of CPCAP get their own node with their own compatible values,
which are described in the following files:

- Documentation/devicetree/bindings/power/supply/cpcap-battery.yaml
- Documentation/devicetree/bindings/power/supply/cpcap-charger.yaml
- Documentation/devicetree/bindings/regulator/cpcap-regulator.txt
- Documentation/devicetree/bindings/phy/phy-cpcap-usb.txt
- Documentation/devicetree/bindings/input/cpcap-pwrbutton.txt
- Documentation/devicetree/bindings/rtc/cpcap-rtc.txt
- Documentation/devicetree/bindings/leds/leds-cpcap.txt
- Documentation/devicetree/bindings/iio/adc/motorola,cpcap-adc.yaml

The only exception is the audio codec. Instead of a compatible value its
node must be named "audio-codec".

Required properties for the audio-codec subnode:

- #sound-dai-cells = <1>;

The audio-codec provides two DAIs. The first one is connected to the
Stereo HiFi DAC and the second one is connected to the Voice DAC.

Example:

&mcspi1 {
	cpcap: pmic@0 {
		compatible = "motorola,cpcap", "ste,6556002";
		reg = <0>;	/* cs0 */
		interrupt-parent = <&gpio1>;
		interrupts = <7 IRQ_TYPE_EDGE_RISING>;
		interrupt-controller;
		#interrupt-cells = <2>;
		#address-cells = <1>;
		#size-cells = <0>;
		spi-max-frequency = <3000000>;
		spi-cs-high;

		audio-codec {
			#sound-dai-cells = <1>;

			/* HiFi */
			port@0 {
				endpoint {
					remote-endpoint = <&cpu_dai1>;
				};
			};

			/* Voice */
			port@1 {
				endpoint {
					remote-endpoint = <&cpu_dai2>;
				};
			};
		};
	};
};


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

title: MP2629 Battery Charger PMIC from Monolithic Power System.

maintainers:
  - Saravanan Sekar <sravanhome@gmail.com>

description: |
  MP2629 is a PMIC providing battery charging and power supply for smartphones,
  wireless camera and portable devices. Chip is controlled over I2C.

  The battery charge management device handles battery charger controller and
  ADC IIO device for battery, system voltage

properties:
  compatible:
    enum:
      - mps,mp2629
      - mps,mp2733

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  interrupt-controller: true

  "#interrupt-cells":
    const: 2
    description:
      The first cell is the IRQ number, the second cell is the trigger type.

required:
  - compatible
  - reg
  - interrupts
  - interrupt-controller
  - "#interrupt-cells"

additionalProperties: false

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

        pmic@4b {
            compatible = "mps,mp2629";
            reg = <0x4b>;

            interrupt-controller;
            interrupt-parent = <&gpio2>;
            #interrupt-cells = <2>;
            interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
        };
    };


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

title: Ocelot Externally-Controlled Ethernet Switch

maintainers:
  - Colin Foster <colin.foster@in-advantage.com>

description: |
  The Ocelot ethernet switch family contains chips that have an internal CPU
  (VSC7513, VSC7514) and chips that don't (VSC7511, VSC7512). All switches have
  the option to be controlled externally, which is the purpose of this driver.

  The switch family is a multi-port networking switch that supports many
  interfaces. Additionally, the device can perform pin control, MDIO buses, and
  external GPIO expanders.

properties:
  compatible:
    enum:
      - mscc,vsc7512

  reg:
    maxItems: 1

  "#address-cells":
    const: 1

  "#size-cells":
    const: 1

  spi-max-frequency:
    maxItems: 1

patternProperties:
  "^pinctrl@[0-9a-f]+$":
    type: object
    $ref: /schemas/pinctrl/mscc,ocelot-pinctrl.yaml

  "^gpio@[0-9a-f]+$":
    type: object
    $ref: /schemas/pinctrl/microchip,sparx5-sgpio.yaml
    properties:
      compatible:
        enum:
          - mscc,ocelot-sgpio

  "^mdio@[0-9a-f]+$":
    type: object
    $ref: /schemas/net/mscc,miim.yaml
    properties:
      compatible:
        enum:
          - mscc,ocelot-miim

required:
  - compatible
  - reg
  - '#address-cells'
  - '#size-cells'
  - spi-max-frequency

additionalProperties: false

examples:
  - |
    ocelot_clock: ocelot-clock {
          compatible = "fixed-clock";
          #clock-cells = <0>;
          clock-frequency = <125000000>;
      };

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

        soc@0 {
            compatible = "mscc,vsc7512";
            spi-max-frequency = <2500000>;
            reg = <0>;
            #address-cells = <1>;
            #size-cells = <1>;

            mdio@7107009c {
                compatible = "mscc,ocelot-miim";
                #address-cells = <1>;
                #size-cells = <0>;
                reg = <0x7107009c 0x24>;

                sw_phy0: ethernet-phy@0 {
                    reg = <0x0>;
                };
            };

            mdio@710700c0 {
                compatible = "mscc,ocelot-miim";
                pinctrl-names = "default";
                pinctrl-0 = <&miim1_pins>;
                #address-cells = <1>;
                #size-cells = <0>;
                reg = <0x710700c0 0x24>;

                sw_phy4: ethernet-phy@4 {
                    reg = <0x4>;
                };
            };

            gpio: pinctrl@71070034 {
                compatible = "mscc,ocelot-pinctrl";
                gpio-controller;
                #gpio-cells = <2>;
                gpio-ranges = <&gpio 0 0 22>;
                reg = <0x71070034 0x6c>;

                sgpio_pins: sgpio-pins {
                    pins = "GPIO_0", "GPIO_1", "GPIO_2", "GPIO_3";
                    function = "sg0";
                };

                miim1_pins: miim1-pins {
                    pins = "GPIO_14", "GPIO_15";
                    function = "miim";
                };
            };

            gpio@710700f8 {
                compatible = "mscc,ocelot-sgpio";
                #address-cells = <1>;
                #size-cells = <0>;
                bus-frequency = <12500000>;
                clocks = <&ocelot_clock>;
                microchip,sgpio-port-ranges = <0 15>;
                pinctrl-names = "default";
                pinctrl-0 = <&sgpio_pins>;
                reg = <0x710700f8 0x100>;

                sgpio_in0: gpio@0 {
                    compatible = "microchip,sparx5-sgpio-bank";
                    reg = <0>;
                    gpio-controller;
                    #gpio-cells = <3>;
                    ngpios = <64>;
                };

                sgpio_out1: gpio@1 {
                    compatible = "microchip,sparx5-sgpio-bank";
                    reg = <1>;
                    gpio-controller;
                    #gpio-cells = <3>;
                    ngpios = <64>;
                };
            };
        };
    };

...


code:
MediaTek MT6397/MT6323 Multifunction Device Driver

MT6397/MT6323 is a multifunction device with the following sub modules:
- Regulator
- RTC
- Audio codec
- GPIO
- Clock
- LED
- Keys
- Power controller

It is interfaced to host controller using SPI interface by a proprietary hardware
called PMIC wrapper or pwrap. MT6397/MT6323 MFD is a child device of pwrap.
See the following for pwarp node definitions:
../soc/mediatek/pwrap.txt

This document describes the binding for MFD device and its sub module.

Required properties:
compatible:
	"mediatek,mt6323" for PMIC MT6323
	"mediatek,mt6331" for PMIC MT6331 and MT6332
	"mediatek,mt6358" for PMIC MT6358 and MT6366
	"mediatek,mt6359" for PMIC MT6359
	"mediatek,mt6397" for PMIC MT6397

Optional subnodes:

- rtc
	Required properties: Should be one of follows
		- compatible: "mediatek,mt6323-rtc"
		- compatible: "mediatek,mt6331-rtc"
		- compatible: "mediatek,mt6358-rtc"
		- compatible: "mediatek,mt6397-rtc"
	For details, see ../rtc/rtc-mt6397.txt
- regulators
	Required properties:
		- compatible: "mediatek,mt6323-regulator"
	see ../regulator/mt6323-regulator.txt
		- compatible: "mediatek,mt6358-regulator"
	see ../regulator/mt6358-regulator.txt
		- compatible: "mediatek,mt6397-regulator"
	see ../regulator/mt6397-regulator.txt
- codec
	Required properties:
		- compatible: "mediatek,mt6397-codec" or "mediatek,mt6358-sound"
- clk
	Required properties:
		- compatible: "mediatek,mt6397-clk"
- led
	Required properties:
		- compatible: "mediatek,mt6323-led"
	see ../leds/leds-mt6323.txt

- keys
	Required properties: Should be one of the following
		- compatible: "mediatek,mt6323-keys"
		- compatible: "mediatek,mt6331-keys"
		- compatible: "mediatek,mt6397-keys"
	see ../input/mtk-pmic-keys.txt

- power-controller
	Required properties:
		- compatible: "mediatek,mt6323-pwrc"
	For details, see ../power/reset/mt6323-poweroff.txt

- pin-controller
	Required properties:
		- compatible: "mediatek,mt6397-pinctrl"
	For details, see ../pinctrl/pinctrl-mt65xx.txt

Example:
	pwrap: pwrap@1000f000 {
		compatible = "mediatek,mt8135-pwrap";

		...

		pmic {
			compatible = "mediatek,mt6397";

			codec: mt6397codec {
				compatible = "mediatek,mt6397-codec";
			};

			regulators {
				compatible = "mediatek,mt6397-regulator";

				mt6397_vpca15_reg: buck_vpca15 {
					regulator-compatible = "buck_vpca15";
					regulator-name = "vpca15";
					regulator-min-microvolt = <850000>;
					regulator-max-microvolt = <1400000>;
					regulator-ramp-delay = <12500>;
					regulator-always-on;
				};

				mt6397_vgp4_reg: ldo_vgp4 {
					regulator-compatible = "ldo_vgp4";
					regulator-name = "vgp4";
					regulator-min-microvolt = <1200000>;
					regulator-max-microvolt = <3300000>;
					regulator-enable-ramp-delay = <218>;
				};
			};
		};
	};


code:
* Freescale MXS LRADC device driver

Required properties:
- compatible: Should be "fsl,imx23-lradc" for i.MX23 SoC and "fsl,imx28-lradc"
              for i.MX28 SoC
- reg: Address and length of the register set for the device
- interrupts: Should contain the LRADC interrupts

Optional properties:
- fsl,lradc-touchscreen-wires: Number of wires used to connect the touchscreen
                               to LRADC. Valid value is either 4 or 5. If this
                               property is not present, then the touchscreen is
                               disabled. 5 wires is valid for i.MX28 SoC only.
- fsl,ave-ctrl: number of samples per direction to calculate an average value.
                Allowed value is 1 ... 32, default is 4
- fsl,ave-delay: delay between consecutive samples. Allowed value is
                 2 ... 2048. It is used if 'fsl,ave-ctrl' > 1, counts at
                 2 kHz and its default is 2 (= 1 ms)
- fsl,settling: delay between plate switch to next sample. Allowed value is
                1 ... 2047. It counts at 2 kHz and its default is
                10 (= 5 ms)

Example for i.MX23 SoC:

	lradc@80050000 {
		compatible = "fsl,imx23-lradc";
		reg = <0x80050000 0x2000>;
		interrupts = <36 37 38 39 40 41 42 43 44>;
		fsl,lradc-touchscreen-wires = <4>;
		fsl,ave-ctrl = <4>;
		fsl,ave-delay = <2>;
		fsl,settling = <10>;
	};

Example for i.MX28 SoC:

	lradc@80050000 {
		compatible = "fsl,imx28-lradc";
		reg = <0x80050000 0x2000>;
		interrupts = <10 14 15 16 17 18 19 20 21 22 23 24 25>;
		fsl,lradc-touchscreen-wires = <5>;
		fsl,ave-ctrl = <4>;
		fsl,ave-delay = <2>;
		fsl,settling = <10>;
	};


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

title: Netronix Embedded Controller

maintainers:
  - Jonathan Neuschäfer <j.neuschaefer@gmx.net>

description: |
  This EC is found in e-book readers of multiple brands (e.g. Kobo, Tolino), and
  is typically implemented as a TI MSP430 microcontroller.

properties:
  compatible:
    const: netronix,ntxec

  reg:
    items:
      - description: The I2C address of the EC

  system-power-controller:
    type: boolean
    description: See Documentation/devicetree/bindings/power/power-controller.txt

  interrupts:
    minItems: 1
    description:
      The EC can signal interrupts via a GPIO line

  "#pwm-cells":
    const: 2
    description: |
      Number of cells in a PWM specifier.

      The following PWM channels are supported:
        - 0: The PWM channel controlled by registers 0xa1-0xa7

required:
  - compatible
  - reg

additionalProperties: false

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

            ec: embedded-controller@43 {
                    pinctrl-names = "default";
                    pinctrl-0 = <&pinctrl_ntxec>;

                    compatible = "netronix,ntxec";
                    reg = <0x43>;
                    system-power-controller;
                    interrupt-parent = <&gpio4>;
                    interrupts = <11 IRQ_TYPE_EDGE_FALLING>;
                    #pwm-cells = <2>;
            };
    };

    backlight {
            compatible = "pwm-backlight";
            pwms = <&ec 0 50000>;
            power-supply = <&backlight_regulator>;
    };

    backlight_regulator: regulator-dummy {
            compatible = "regulator-fixed";
            regulator-name = "backlight";
    };


code:
OMAP HS USB Host

Required properties:

- compatible: should be "ti,usbhs-host"
- reg: should contain one register range i.e. start and length
- ti,hwmods: must contain "usb_host_hs"

Optional properties:

- num-ports: number of USB ports. Usually this is automatically detected
  from the IP's revision register but can be overridden by specifying
  this property. A maximum of 3 ports are supported at the moment.

- portN-mode: String specifying the port mode for port N, where N can be
  from 1 to 3. If the port mode is not specified, that port is treated
  as unused. When specified, it must be one of the following.
	"ehci-phy",
        "ehci-tll",
        "ehci-hsic",
        "ohci-phy-6pin-datse0",
        "ohci-phy-6pin-dpdm",
        "ohci-phy-3pin-datse0",
        "ohci-phy-4pin-dpdm",
        "ohci-tll-6pin-datse0",
        "ohci-tll-6pin-dpdm",
        "ohci-tll-3pin-datse0",
        "ohci-tll-4pin-dpdm",
        "ohci-tll-2pin-datse0",
        "ohci-tll-2pin-dpdm",

- single-ulpi-bypass: Must be present if the controller contains a single
  ULPI bypass control bit. e.g. OMAP3 silicon <= ES2.1

- clocks: a list of phandles and clock-specifier pairs, one for each entry in
  clock-names.

- clock-names: should include:
  For OMAP3
  * "usbhost_120m_fck" - 120MHz Functional clock.

  For OMAP4+
  * "refclk_60m_int" - 60MHz internal reference clock for UTMI clock mux
  * "refclk_60m_ext_p1" - 60MHz external ref. clock for Port 1's UTMI clock mux.
  * "refclk_60m_ext_p2" - 60MHz external ref. clock for Port 2's UTMI clock mux
  * "utmi_p1_gfclk" - Port 1 UTMI clock mux.
  * "utmi_p2_gfclk" - Port 2 UTMI clock mux.
  * "usb_host_hs_utmi_p1_clk" - Port 1 UTMI clock gate.
  * "usb_host_hs_utmi_p2_clk" - Port 2 UTMI clock gate.
  * "usb_host_hs_utmi_p3_clk" - Port 3 UTMI clock gate.
  * "usb_host_hs_hsic480m_p1_clk" - Port 1 480MHz HSIC clock gate.
  * "usb_host_hs_hsic480m_p2_clk" - Port 2 480MHz HSIC clock gate.
  * "usb_host_hs_hsic480m_p3_clk" - Port 3 480MHz HSIC clock gate.
  * "usb_host_hs_hsic60m_p1_clk" - Port 1 60MHz HSIC clock gate.
  * "usb_host_hs_hsic60m_p2_clk" - Port 2 60MHz HSIC clock gate.
  * "usb_host_hs_hsic60m_p3_clk" - Port 3 60MHz HSIC clock gate.

Required properties if child node exists:

- #address-cells: Must be 1
- #size-cells: Must be 1
- ranges: must be present

Properties for children:

The OMAP HS USB Host subsystem contains EHCI and OHCI controllers.
See Documentation/devicetree/bindings/usb/ehci-omap.txt and
Documentation/devicetree/bindings/usb/ohci-omap3.txt.

Example for OMAP4:

usbhshost: usbhshost@4a064000 {
	compatible = "ti,usbhs-host";
	reg = <0x4a064000 0x800>;
	ti,hwmods = "usb_host_hs";
	#address-cells = <1>;
	#size-cells = <1>;
	ranges;

	usbhsohci: ohci@4a064800 {
		compatible = "ti,ohci-omap3", "usb-ohci";
		reg = <0x4a064800 0x400>;
		interrupt-parent = <&gic>;
		interrupts = <0 76 0x4>;
	};

	usbhsehci: ehci@4a064c00 {
		compatible = "ti,ehci-omap", "usb-ehci";
		reg = <0x4a064c00 0x400>;
		interrupt-parent = <&gic>;
		interrupts = <0 77 0x4>;
	};
};

&usbhshost {
	port1-mode = "ehci-phy";
	port2-mode = "ehci-tll";
	port3-mode = "ehci-phy";
};

&usbhsehci {
	phys = <&hsusb1_phy 0 &hsusb3_phy>;
};


code:
OMAP HS USB Host TLL (Transceiver-Less Interface)

Required properties:

- compatible : should be "ti,usbhs-tll"
- reg : should contain one register range i.e. start and length
- interrupts : should contain the TLL module's interrupt
- ti,hwmod : must contain "usb_tll_hs"

Optional properties:

- clocks: a list of phandles and clock-specifier pairs, one for each entry in
  clock-names.

- clock-names: should include:
  * "usb_tll_hs_usb_ch0_clk" - USB TLL channel 0 clock
  * "usb_tll_hs_usb_ch1_clk" - USB TLL channel 1 clock
  * "usb_tll_hs_usb_ch2_clk" - USB TLL channel 2 clock

Example:

	usbhstll: usbhstll@4a062000 {
		compatible = "ti,usbhs-tll";
		reg = <0x4a062000 0x1000>;
		interrupts = <78>;
		ti,hwmods = "usb_tll_hs";
	  };


code:
* palmas device tree bindings

The TI palmas family current members :-
twl6035 (palmas)
twl6037 (palmas)
tps65913 (palmas)
tps65914 (palmas)
tps659038
tps65917

Required properties:
- compatible : Should be from the list
  ti,twl6035
  ti,twl6036
  ti,twl6037
  ti,tps65913
  ti,tps65914
  ti,tps80036
  ti,tps659038
  ti,tps65917
and also the generic series names
  ti,palmas
- interrupt-controller : palmas has its own internal IRQs
- #interrupt-cells : should be set to 2 for IRQ number and flags
  The first cell is the IRQ number.
  The second cell is the flags, encoded as the trigger masks from
  Documentation/devicetree/bindings/interrupt-controller/interrupts.txt

Optional properties:
  ti,mux-padX : set the pad register X (1-2) to the correct muxing for the
		hardware, if not set will use muxing in OTP.

Example:

palmas {
	compatible = "ti,twl6035", "ti,palmas";
	reg = <0x48>
	interrupt-parent = <&intc>;
	interrupt-controller;
	#interrupt-cells = <2>;

	ti,mux-pad1 = <0>;
	ti,mux-pad2 = <0>;

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

	pmic {
		compatible = "ti,twl6035-pmic", "ti,palmas-pmic";
		....
	};
}


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

title: Qualcomm Technologies, Inc. PM8008 PMIC bindings

maintainers:
  - Guru Das Srinagesh <gurus@codeaurora.org>

description: |
  Qualcomm Technologies, Inc. PM8008 is a dedicated camera PMIC that integrates
  all the necessary power management, housekeeping, and interface support
  functions into a single IC.

properties:
  compatible:
    const: qcom,pm8008

  reg:
    description:
      I2C slave address.

    maxItems: 1

  interrupts:
    maxItems: 1

    description: Parent interrupt.

  "#interrupt-cells":
    const: 2

    description: |
      The first cell is the IRQ number, the second cell is the IRQ trigger
      flag. All interrupts are listed in include/dt-bindings/mfd/qcom-pm8008.h.

  interrupt-controller: true

  "#address-cells":
    const: 1

  "#size-cells":
    const: 0

patternProperties:
  "^gpio@[0-9a-f]+$":
    type: object

    description: |
      The GPIO peripheral. This node may be specified twice, one for each GPIO.

    properties:
      compatible:
        items:
          - const: qcom,pm8008-gpio
          - const: qcom,spmi-gpio

      reg:
        description: Peripheral address of one of the two GPIO peripherals.
        maxItems: 1

      gpio-controller: true

      gpio-ranges:
        maxItems: 1

      interrupt-controller: true

      "#interrupt-cells":
        const: 2

      "#gpio-cells":
        const: 2

    required:
      - compatible
      - reg
      - gpio-controller
      - interrupt-controller
      - "#gpio-cells"
      - gpio-ranges
      - "#interrupt-cells"

    additionalProperties: false

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

additionalProperties: false

examples:
  - |
    #include <dt-bindings/mfd/qcom-pm8008.h>
    #include <dt-bindings/interrupt-controller/irq.h>
    qupv3_se13_i2c {
      #address-cells = <1>;
      #size-cells = <0>;
      pm8008i@8 {
        compatible = "qcom,pm8008";
        reg = <0x8>;
        #address-cells = <1>;
        #size-cells = <0>;
        interrupt-controller;
        #interrupt-cells = <2>;

        interrupt-parent = <&tlmm>;
        interrupts = <32 IRQ_TYPE_EDGE_RISING>;

        pm8008_gpios: gpio@c000 {
          compatible = "qcom,pm8008-gpio", "qcom,spmi-gpio";
          reg = <0xc000>;
          gpio-controller;
          gpio-ranges = <&pm8008_gpios 0 0 2>;
          #gpio-cells = <2>;
          interrupt-controller;
          #interrupt-cells = <2>;
        };
      };
    };

...


code:
# SPDX-License-Identifier: GPL-2.0-only
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/qcom,spmi-pmic.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm SPMI PMICs multi-function device

description: |
  Some Qualcomm PMICs used with the Snapdragon series SoCs are interfaced
  to the chip via the SPMI (System Power Management Interface) bus.
  Support for multiple independent functions are implemented by splitting the
  16-bit SPMI peripheral address space into 256 smaller fixed-size regions, 256 bytes
  each. A function can consume one or more of these fixed-size register regions.

  The Qualcomm SPMI series includes the PM8941, PM8841, PMA8084, PM8998 and other
  PMICs.  These PMICs use a "QPNP" scheme through SPMI interface.
  QPNP is effectively a partitioning scheme for dividing the SPMI extended
  register space up into logical pieces, and set of fixed register
  locations/definitions within these regions, with some of these regions
  specifically used for interrupt handling.

maintainers:
  - Stephen Boyd <sboyd@kernel.org>

properties:
  $nodename:
    oneOf:
      - pattern: '^pmic@.*$'
      - pattern: '^pm(a|s)?[0-9]*@.*$'
        deprecated: true

  compatible:
    items:
      - enum:
          - qcom,pm6125
          - qcom,pm6150
          - qcom,pm6150l
          - qcom,pm6350
          - qcom,pm660
          - qcom,pm660l
          - qcom,pm7250b
          - qcom,pm7325
          - qcom,pm8004
          - qcom,pm8005
          - qcom,pm8009
          - qcom,pm8019
          - qcom,pm8028
          - qcom,pm8110
          - qcom,pm8150
          - qcom,pm8150b
          - qcom,pm8150c
          - qcom,pm8150l
          - qcom,pm8226
          - qcom,pm8350
          - qcom,pm8350b
          - qcom,pm8350c
          - qcom,pm8841
          - qcom,pm8909
          - qcom,pm8916
          - qcom,pm8941
          - qcom,pm8950
          - qcom,pm8953
          - qcom,pm8994
          - qcom,pm8998
          - qcom,pma8084
          - qcom,pmd9635
          - qcom,pmi8950
          - qcom,pmi8962
          - qcom,pmi8994
          - qcom,pmi8998
          - qcom,pmk8002
          - qcom,pmk8350
          - qcom,pmm8155au
          - qcom,pmp8074
          - qcom,pmr735a
          - qcom,pmr735b
          - qcom,pms405
          - qcom,pmx55
          - qcom,pmx65
          - qcom,smb2351
      - const: qcom,spmi-pmic

  reg:
    minItems: 1
    maxItems: 2

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

  labibb:
    type: object
    $ref: /schemas/regulator/qcom-labibb-regulator.yaml#

  regulators:
    type: object
    $ref: /schemas/regulator/qcom,spmi-regulator.yaml#

patternProperties:
  "^adc@[0-9a-f]+$":
    type: object
    $ref: /schemas/iio/adc/qcom,spmi-vadc.yaml#

  "^adc-tm@[0-9a-f]+$":
    type: object
    # ref depends on compatible, see allOf below

  "^audio-codec@[0-9a-f]+$":
    type: object
    additionalProperties: true # FIXME qcom,pm8916-wcd-analog-codec binding not converted yet

  "extcon@[0-9a-f]+$":
    type: object
    $ref: /schemas/extcon/qcom,pm8941-misc.yaml#

  "gpio(s)?@[0-9a-f]+$":
    type: object
    $ref: /schemas/pinctrl/qcom,pmic-gpio.yaml#

  "pon@[0-9a-f]+$":
    type: object
    $ref: /schemas/power/reset/qcom,pon.yaml#

  "pwm@[0-9a-f]+$":
    type: object
    $ref: /schemas/leds/leds-qcom-lpg.yaml#

  "^rtc@[0-9a-f]+$":
    type: object
    $ref: /schemas/rtc/qcom-pm8xxx-rtc.yaml#

  "^temp-alarm@[0-9a-f]+$":
    type: object
    $ref: /schemas/thermal/qcom,spmi-temp-alarm.yaml#

  "^vibrator@[0-9a-f]+$":
    type: object
    additionalProperties: true # FIXME qcom,pm8916-vib binding not converted yet

  "^mpps@[0-9a-f]+$":
    type: object
    $ref: /schemas/pinctrl/qcom,pmic-mpp.yaml#

  "(.*)?(wled|leds)@[0-9a-f]+$":
    type: object
    $ref: /schemas/leds/backlight/qcom-wled.yaml#
    unevaluatedProperties: false

required:
  - compatible
  - reg

allOf:
  - if:
      properties:
        compatible:
          contains:
            enum:
              - qcom,pm8998
    then:
      patternProperties:
        "^adc-tm@[0-9a-f]+$":
          $ref: /schemas/thermal/qcom-spmi-adc-tm-hc.yaml#
    else:
      patternProperties:
        "^adc-tm@[0-9a-f]+$":
          $ref: /schemas/thermal/qcom-spmi-adc-tm5.yaml#

additionalProperties: false

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

    spmi@c440000 {
        compatible = "qcom,spmi-pmic-arb";
        reg = <0x0c440000 0x1100>,
              <0x0c600000 0x2000000>,
              <0x0e600000 0x100000>,
              <0x0e700000 0xa0000>,
              <0x0c40a000 0x26000>;
        reg-names = "core", "chnls", "obsrvr", "intr", "cnfg";
        interrupt-names = "periph_irq";
        interrupts = <GIC_SPI 481 IRQ_TYPE_LEVEL_HIGH>;
        qcom,ee = <0>;
        qcom,channel = <0>;
        #address-cells = <2>;
        #size-cells = <0>;
        interrupt-controller;
        #interrupt-cells = <4>;

        pmi8998_lsid0: pmic@2 {
            compatible = "qcom,pmi8998", "qcom,spmi-pmic";
            reg = <0x2 SPMI_USID>;
            #address-cells = <1>;
            #size-cells = <0>;

            pmi8998_gpio: gpios@c000 {
                compatible = "qcom,pmi8998-gpio", "qcom,spmi-gpio";
                reg = <0xc000>;
                gpio-controller;
                gpio-ranges = <&pmi8998_gpio 0 0 14>;
                #gpio-cells = <2>;
                interrupt-controller;
                #interrupt-cells = <2>;
            };
        };
    };

  - |
    #include <dt-bindings/input/input.h>
    #include <dt-bindings/interrupt-controller/irq.h>
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/iio/qcom,spmi-vadc.h>
    #include <dt-bindings/spmi/spmi.h>

    pmic@0 {
        compatible = "qcom,pm6150", "qcom,spmi-pmic";
        reg = <0x0 SPMI_USID>;
        #address-cells = <1>;
        #size-cells = <0>;

        pon@800 {
            compatible = "qcom,pm8998-pon";
            reg = <0x800>;
            mode-bootloader = <0x2>;
            mode-recovery = <0x1>;

            pwrkey {
                compatible = "qcom,pm8941-pwrkey";
                interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
                debounce = <15625>;
                bias-pull-up;
                linux,code = <KEY_POWER>;
            };
        };

        temp-alarm@2400 {
            compatible = "qcom,spmi-temp-alarm";
            reg = <0x2400>;
            interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_RISING>;
            io-channels = <&pm6150_adc ADC5_DIE_TEMP>;
            io-channel-names = "thermal";
            #thermal-sensor-cells = <0>;
        };

        pm6150_adc: adc@3100 {
            compatible = "qcom,spmi-adc5";
            reg = <0x3100>;
            interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
            #address-cells = <1>;
            #size-cells = <0>;
            #io-channel-cells = <1>;

            adc-chan@6 {
                reg = <ADC5_DIE_TEMP>;
                label = "die_temp";
            };

            adc-chan@4f {
                reg = <ADC5_AMUX_THM3_100K_PU>;
                qcom,ratiometric;
                qcom,hw-settle-time = <200>;
            };
        };

        adc-tm@3500 {
            compatible = "qcom,spmi-adc-tm5";
            reg = <0x3500>;
            interrupts = <0x0 0x35 0x0 IRQ_TYPE_EDGE_RISING>;
            #thermal-sensor-cells = <1>;
            #address-cells = <1>;
            #size-cells = <0>;

            charger-thermistor@0 {
                reg = <0>;
                io-channels = <&pm6150_adc ADC5_AMUX_THM3_100K_PU>;
                qcom,ratiometric;
                qcom,hw-settle-time-us = <200>;
            };
        };

        pm6150_gpio: gpios@c000 {
            compatible = "qcom,pm6150-gpio", "qcom,spmi-gpio";
            reg = <0xc000>;
            gpio-controller;
            gpio-ranges = <&pm6150_gpio 0 0 10>;
            #gpio-cells = <2>;
            interrupt-controller;
            #interrupt-cells = <2>;
        };
    };


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

title: Qualcomm Top Control and Status Register

maintainers:
  - Bjorn Andersson <bjorn.andersson@linaro.org>

description:
  Qualcomm devices have a set of registers that provide various control and
  status functions for their peripherals.

properties:
  compatible:
    items:
      - enum:
          - qcom,msm8998-tcsr
          - qcom,qcs404-tcsr
          - qcom,sc7180-tcsr
          - qcom,sc7280-tcsr
          - qcom,sdm630-tcsr
          - qcom,sdm845-tcsr
          - qcom,sm8150-tcsr
          - qcom,tcsr-apq8064
          - qcom,tcsr-apq8084
          - qcom,tcsr-ipq6018
          - qcom,tcsr-ipq8064
          - qcom,tcsr-mdm9615
          - qcom,tcsr-msm8660
          - qcom,tcsr-msm8916
          - qcom,tcsr-msm8953
          - qcom,tcsr-msm8960
          - qcom,tcsr-msm8974
          - qcom,tcsr-msm8996
      - const: syscon

  reg:
    maxItems: 1

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    syscon@1a400000 {
        compatible = "qcom,tcsr-msm8960", "syscon";
        reg = <0x1a400000 0x100>;
    };


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

title: Qualcomm PM8xxx PMIC multi-function devices

maintainers:
  - Satya Priya <quic_c_skakit@quicinc.com>

description: |
  The PM8xxx family of Power Management ICs are used to provide regulated
  voltages and other various functionality to Qualcomm SoCs.

properties:
  compatible:
    enum:
      - qcom,pm8018
      - qcom,pm8058
      - qcom,pm8821
      - qcom,pm8921

  reg:
    maxItems: 1

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

  interrupts:
    maxItems: 1

  '#interrupt-cells':
    const: 2

  interrupt-controller: true

patternProperties:
  "led@[0-9a-f]+$":
    type: object
    $ref: /schemas/leds/qcom,pm8058-led.yaml#

  "rtc@[0-9a-f]+$":
    type: object
    $ref: "../rtc/qcom-pm8xxx-rtc.yaml"

required:
  - compatible
  - '#address-cells'
  - '#size-cells'
  - interrupts
  - '#interrupt-cells'
  - interrupt-controller

additionalProperties: false
...


code:
Qualcomm Resource Power Manager (RPM)

This driver is used to interface with the Resource Power Manager (RPM) found in
various Qualcomm platforms. The RPM allows each component in the system to vote
for state of the system resources, such as clocks, regulators and bus
frequencies.

- compatible:
	Usage: required
	Value type: <string>
	Definition: must be one of:
		    "qcom,rpm-apq8064"
		    "qcom,rpm-msm8660"
		    "qcom,rpm-msm8960"
		    "qcom,rpm-ipq8064"
		    "qcom,rpm-mdm9615"

- reg:
	Usage: required
	Value type: <prop-encoded-array>
	Definition: base address and size of the RPM's message ram

- interrupts:
	Usage: required
	Value type: <prop-encoded-array>
	Definition: three entries specifying the RPM's:
		    1. acknowledgement interrupt
		    2. error interrupt
		    3. wakeup interrupt

- interrupt-names:
	Usage: required
	Value type: <string-array>
	Definition: must be the three strings "ack", "err" and "wakeup", in order

- qcom,ipc:
	Usage: required
	Value type: <prop-encoded-array>

	Definition: three entries specifying the outgoing ipc bit used for
		    signaling the RPM:
		    - phandle to a syscon node representing the apcs registers
		    - u32 representing offset to the register within the syscon
		    - u32 representing the ipc bit within the register

= SUBNODES

The RPM exposes resources to its subnodes. The below bindings specify the set
of valid subnodes that can operate on these resources.

== Regulators

Regulator nodes are identified by their compatible:

- compatible:
	Usage: required
	Value type: <string>
	Definition: must be one of:
		    "qcom,rpm-pm8058-regulators"
		    "qcom,rpm-pm8901-regulators"
		    "qcom,rpm-pm8921-regulators"
		    "qcom,rpm-pm8018-regulators"
		    "qcom,rpm-smb208-regulators"

- vdd_l0_l1_lvs-supply:
- vdd_l2_l11_l12-supply:
- vdd_l3_l4_l5-supply:
- vdd_l6_l7-supply:
- vdd_l8-supply:
- vdd_l9-supply:
- vdd_l10-supply:
- vdd_l13_l16-supply:
- vdd_l14_l15-supply:
- vdd_l17_l18-supply:
- vdd_l19_l20-supply:
- vdd_l21-supply:
- vdd_l22-supply:
- vdd_l23_l24_l25-supply:
- vdd_ncp-supply:
- vdd_s0-supply:
- vdd_s1-supply:
- vdd_s2-supply:
- vdd_s3-supply:
- vdd_s4-supply:
	Usage: optional (pm8058 only)
	Value type: <phandle>
	Definition: reference to regulator supplying the input pin, as
		    described in the data sheet

- lvs0_in-supply:
- lvs1_in-supply:
- lvs2_in-supply:
- lvs3_in-supply:
- mvs_in-supply:
- vdd_l0-supply:
- vdd_l1-supply:
- vdd_l2-supply:
- vdd_l3-supply:
- vdd_l4-supply:
- vdd_l5-supply:
- vdd_l6-supply:
- vdd_s0-supply:
- vdd_s1-supply:
- vdd_s2-supply:
- vdd_s3-supply:
- vdd_s4-supply:
	Usage: optional (pm8901 only)
	Value type: <phandle>
	Definition: reference to regulator supplying the input pin, as
		    described in the data sheet

- vdd_l1_l2_l12_l18-supply:
- vdd_l3_l15_l17-supply:
- vdd_l4_l14-supply:
- vdd_l5_l8_l16-supply:
- vdd_l6_l7-supply:
- vdd_l9_l11-supply:
- vdd_l10_l22-supply:
- vdd_l21_l23_l29-supply:
- vdd_l24-supply:
- vdd_l25-supply:
- vdd_l26-supply:
- vdd_l27-supply:
- vdd_l28-supply:
- vdd_ncp-supply:
- vdd_s1-supply:
- vdd_s2-supply:
- vdd_s4-supply:
- vdd_s5-supply:
- vdd_s6-supply:
- vdd_s7-supply:
- vdd_s8-supply:
- vin_5vs-supply:
- vin_lvs1_3_6-supply:
- vin_lvs2-supply:
- vin_lvs4_5_7-supply:
	Usage: optional (pm8921 only)
	Value type: <phandle>
	Definition: reference to regulator supplying the input pin, as
		    described in the data sheet

- vin_lvs1-supply:
- vdd_l7-supply:
- vdd_l8-supply:
- vdd_l9_l10_l11_l12-supply:
	Usage: optional (pm8018 only)
	Value type: <phandle>
	Definition: reference to regulator supplying the input pin, as
		    described in the data sheet

The regulator node houses sub-nodes for each regulator within the device. Each
sub-node is identified using the node's name, with valid values listed for each
of the pmics below.

pm8058:
	l0, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14, l15,
	l16, l17, l18, l19, l20, l21, l22, l23, l24, l25, s0, s1, s2, s3, s4,
	lvs0, lvs1, ncp

pm8901:
	l0, l1, l2, l3, l4, l5, l6, s0, s1, s2, s3, s4, lvs0, lvs1, lvs2, lvs3,
	mvs

pm8921:
	s1, s2, s3, s4, s7, s8, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11,
	l12, l14, l15, l16, l17, l18, l21, l22, l23, l24, l25, l26, l27, l28,
	l29, lvs1, lvs2, lvs3, lvs4, lvs5, lvs6, lvs7, usb-switch, hdmi-switch,
	ncp

pm8018:
	s1, s2, s3, s4, s5, , l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11,
	l12, l14, lvs1

smb208:
	s1a, s1b, s2a, s2b

The content of each sub-node is defined by the standard binding for regulators -
see regulator.txt - with additional custom properties described below:

=== Switch-mode Power Supply regulator custom properties

- bias-pull-down:
	Usage: optional
	Value type: <empty>
	Definition: enable pull down of the regulator when inactive

- qcom,switch-mode-frequency:
	Usage: required
	Value type: <u32>
	Definition: Frequency (Hz) of the switch-mode power supply;
		    must be one of:
		    19200000, 9600000, 6400000, 4800000, 3840000, 3200000,
		    2740000, 2400000, 2130000, 1920000, 1750000, 1600000,
		    1480000, 1370000, 1280000, 1200000

- qcom,force-mode:
	Usage: optional (default if no other qcom,force-mode is specified)
	Value type: <u32>
	Definition: indicates that the regulator should be forced to a
		   particular mode, valid values are:
		   QCOM_RPM_FORCE_MODE_NONE - do not force any mode
		   QCOM_RPM_FORCE_MODE_LPM - force into low power mode
		   QCOM_RPM_FORCE_MODE_HPM - force into high power mode
		   QCOM_RPM_FORCE_MODE_AUTO - allow regulator to automatically
					      select its own mode based on
					      realtime current draw, only for:
					      pm8921 smps and ftsmps

- qcom,power-mode-hysteretic:
	Usage: optional
	Value type: <empty>
	Definition: select that the power supply should operate in hysteretic
		    mode, instead of the default pwm mode

=== Low-dropout regulator custom properties

- bias-pull-down:
	Usage: optional
	Value type: <empty>
	Definition: enable pull down of the regulator when inactive

- qcom,force-mode:
	Usage: optional
	Value type: <u32>
	Definition: indicates that the regulator should not be forced to any
		   particular mode, valid values are:
		   QCOM_RPM_FORCE_MODE_NONE - do not force any mode
		   QCOM_RPM_FORCE_MODE_LPM - force into low power mode
		   QCOM_RPM_FORCE_MODE_HPM - force into high power mode
		   QCOM_RPM_FORCE_MODE_BYPASS - set regulator to use bypass
						mode, i.e.  to act as a switch
						and not regulate, only for:
						pm8921 pldo, nldo and nldo1200

=== Negative Charge Pump custom properties

- qcom,switch-mode-frequency:
	Usage: required
	Value type: <u32>
	Definition: Frequency (Hz) of the switch mode power supply;
		    must be one of:
		    19200000, 9600000, 6400000, 4800000, 3840000, 3200000,
		    2740000, 2400000, 2130000, 1920000, 1750000, 1600000,
		    1480000, 1370000, 1280000, 1200000

= EXAMPLE

	#include <dt-bindings/mfd/qcom-rpm.h>

	rpm@108000 {
		compatible = "qcom,rpm-msm8960";
		reg = <0x108000 0x1000>;
		qcom,ipc = <&apcs 0x8 2>;

		interrupts = <0 19 0>, <0 21 0>, <0 22 0>;
		interrupt-names = "ack", "err", "wakeup";

		regulators {
			compatible = "qcom,rpm-pm8921-regulators";
			vdd_l1_l2_l12_l18-supply = <&pm8921_s4>;

			s1 {
				regulator-min-microvolt = <1225000>;
				regulator-max-microvolt = <1225000>;

				bias-pull-down;

				qcom,switch-mode-frequency = <3200000>;
			};

			pm8921_s4: s4 {
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;

				qcom,switch-mode-frequency = <1600000>;
				bias-pull-down;

				qcom,force-mode = <QCOM_RPM_FORCE_MODE_AUTO>;
			};
		};
	};


code:
KEYMILE qrio Board Control CPLD

The qrio is a multifunction device that controls the KEYMILE boards based on
the kmp204x design.
It is consists of a reset controller, watchdog timer, LEDs, and 2 IRQ capable
GPIO blocks.

Required properties:
- compatible: "keymile,qriox"
- reg: access on the parent local bus (chip select, offset in chip select, size)

Example:

	board-control@1,0 {
		compatible = "keymile,qriox";
		reg = <1 0 0x80>;
	};


code:
* Device tree bindings for Nokia Retu and Tahvo multi-function device

Retu and Tahvo are a multi-function devices found on Nokia Internet
Tablets (770, N800 and N810). The Retu chip provides watchdog timer
and power button control functionalities while Tahvo chip provides
USB transceiver functionality.

Required properties:
- compatible:		"nokia,retu" or "nokia,tahvo"
- reg:			Specifies the CBUS slave address of the ASIC chip
- interrupts: 		The interrupt line the device is connected to

Example:

cbus0 {
	compatible = "i2c-cbus-gpio";
	...
	retu: retu@1 {
		compatible = "nokia,retu";
		interrupt-parent = <&gpio4>;
		interrupts = <12 IRQ_TYPE_EDGE_RISING>;
		reg = <0x1>;
	};
};


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

title: Richtek RT4831 DSV and Backlight Integrated IC

maintainers:
  - ChiYuan Huang <cy_huang@richtek.com>

description: |
  RT4831 is a multifunctional device that can provide power to the LCD display
  and LCD backlight.

  For Display Bias Voltage DSVP and DSVN, the output range is about 4V to 6.5V.
  It's sufficient to meet the current LCD power requirement.

  For the LCD backlight, it can provide four channel WLED driving capability.
  Each channel driving current is up to 30mA

  Datasheet is available at
  https://www.richtek.com/assets/product_file/RT4831A/DS4831A-05.pdf

properties:
  compatible:
    const: richtek,rt4831

  reg:
    description: I2C device address.
    maxItems: 1

  enable-gpios:
    description: |
      GPIO to enable/disable the chip. It is optional.
      Some usage directly tied this pin to follow VIO 1.8V power on sequence.
    maxItems: 1

  regulators:
    $ref: ../regulator/richtek,rt4831-regulator.yaml

  backlight:
    $ref: ../leds/backlight/richtek,rt4831-backlight.yaml

required:
  - compatible
  - reg

additionalProperties: false

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

      rt4831@11 {
        compatible = "richtek,rt4831";
        reg = <0x11>;

        regulators {
          DSVLCM {
            regulator-min-microvolt = <4000000>;
            regulator-max-microvolt = <7150000>;
            regulator-allow-bypass;
          };
          DSVP {
            regulator-name = "rt4831-dsvp";
            regulator-min-microvolt = <4000000>;
            regulator-max-microvolt = <6500000>;
            regulator-boot-on;
          };
          DSVN {
            regulator-name = "rt4831-dsvn";
            regulator-min-microvolt = <4000000>;
            regulator-max-microvolt = <6500000>;
            regulator-boot-on;
          };
        };

        backlight {
          compatible = "richtek,rt4831-backlight";
          default-brightness = <1024>;
          max-brightness = <2048>;
          richtek,bled-ovp-sel = /bits/ 8 <RT4831_BLOVPLVL_21V>;
          richtek,channel-use = /bits/ 8 <RT4831_BLED_ALLCHEN>;
        };
      };
    };


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

title: Richtek RT5120 PMIC

maintainers:
  - ChiYuan Huang <cy_huang@richtek.com>

description: |
  The RT5120 provides four high-efficiency buck converters and one LDO voltage
  regulator. The device is targeted at providingthe processor voltage, memory,
  I/O, and peripheral rails in home entertainment devices. The I2C interface is
  used for dynamic voltage scaling of the processor voltage, power rails on/off
  sequence control, operation mode selection.

properties:
  compatible:
    enum:
      - richtek,rt5120

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  interrupt-controller: true

  "#interrupt-cells":
    const: 1

  wakeup-source: true

  richtek,enable-undervolt-hiccup:
    type: boolean
    description: |
      If used, under voltage protection trigger hiccup behavior, else latchup as
      default

  richtek,enable-overvolt-hiccup:
    type: boolean
    description:
      Like as 'enable-uv-hiccup', it configures over voltage protection to
      hiccup, else latchup as default

  vin1-supply:
    description: phandle for buck1 input power source

  vin2-supply:
    description: phandle for buck2 input power source

  vin3-supply:
    description: phandle for buck3 input power source

  vin4-supply:
    description: phandle for buck4 input power source

  vinldo-supply:
    description: phandle for ldo input power source

  regulators:
    type: object

    patternProperties:
      "^buck[1-4]$":
        type: object
        $ref: /schemas/regulator/regulator.yaml#
        unevaluatedProperties: false

        properties:
          regulator-allowed-modes:
            description: |
              Used to specify the allowed buck converter operating mode
              mode mapping:
                0: auto mode
                1: force pwm mode
            items:
              enum: [0, 1]

      "^(ldo|exten)$":
        type: object
        $ref: /schemas/regulator/regulator.yaml#
        unevaluatedProperties: false

    additionalProperties: false

  powerkey:
    type: object
    description:
      PON key that connected to RT5120 PMIC.

    properties:
      compatible:
        enum:
          - richtek,rt5120-pwrkey

    required:
      - compatible

    additionalProperties: false

required:
  - compatible
  - reg
  - interrupts
  - '#interrupt-cells'
  - interrupt-controller
  - regulators
  - powerkey

additionalProperties: false

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

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

      pmic@62 {
        compatible = "richtek,rt5120";
        reg = <0x62>;
        interrupts-extended = <&gpio_intc 32 IRQ_TYPE_LEVEL_LOW>;
        interrupt-controller;
        #interrupt-cells = <1>;
        wakeup-source;

        regulators {
          buck1 {
            regulator-name = "rt5120-buck1";
            regulator-min-microvolt = <600000>;
            regulator-max-microvolt = <1393750>;
            regulator-allowed-modes = <0 1>;
            regulator-boot-on;
          };
          buck2 {
            regulator-name = "rt5120-buck2";
            regulator-min-microvolt = <1100000>;
            regulator-max-microvolt = <1100000>;
            regulator-allowed-modes = <0 1>;
            regulator-always-on;
          };
          buck3 {
            regulator-name = "rt5120-buck3";
            regulator-min-microvolt = <1800000>;
            regulator-max-microvolt = <1800000>;
            regulator-allowed-modes = <0 1>;
            regulator-always-on;
          };
          buck4 {
            regulator-name = "rt5120-buck4";
            regulator-min-microvolt = <3300000>;
            regulator-max-microvolt = <3300000>;
            regulator-allowed-modes = <0 1>;
            regulator-always-on;
          };
          ldo {
            regulator-name = "rt5120-ldo";
            regulator-min-microvolt = <1800000>;
            regulator-max-microvolt = <1800000>;
            regulator-always-on;
          };
          exten {
            regulator-name = "rt5120-exten";
            regulator-min-microvolt = <3000000>;
            regulator-max-microvolt = <3000000>;
            regulator-always-on;
          };
        };
        powerkey {
          compatible = "richtek,rt5120-pwrkey";
        };
      };
    };


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

title: Ricoh RN5T567/RN5T618/RC5T619 PMIC

maintainers:
  - Andreas Kemnade <andreas@kemnade.info>

description: |
  Ricoh RN5T567/RN5T618/RC5T619 is a power management IC family which
  integrates 3 to 5 step-down DCDC converters, 7 to 10 low-dropout regulators,
  GPIOs, and a watchdog timer. It can be controlled through an I2C interface.
  The RN5T618/RC5T619 provides additionally a Li-ion battery charger,
  fuel gauge, and an ADC.
  The RC5T619 additionally includes USB charger detection and an RTC.

allOf:
  - if:
      properties:
        compatible:
          contains:
            const: ricoh,rn5t567
    then:
      properties:
        regulators:
          patternProperties:
            "^(DCDC[1-4]|LDO[1-5]|LDORTC[12])$":
              $ref: ../regulator/regulator.yaml
          additionalProperties: false
  - if:
      properties:
        compatible:
          contains:
            const: ricoh,rn5t618
    then:
      properties:
        regulators:
          patternProperties:
            "^(DCDC[1-3]|LDO[1-5]|LDORTC[12])$":
              $ref: ../regulator/regulator.yaml
          additionalProperties: false
  - if:
      properties:
        compatible:
          contains:
            const: ricoh,rc5t619
    then:
      properties:
        regulators:
          patternProperties:
            "^(DCDC[1-5]|LDO[1-9]|LDO10|LDORTC[12])$":
              $ref: ../regulator/regulator.yaml
          additionalProperties: false

properties:
  compatible:
    enum:
      - ricoh,rn5t567
      - ricoh,rn5t618
      - ricoh,rc5t619

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  system-power-controller:
    type: boolean
    description: |
      See Documentation/devicetree/bindings/power/power-controller.txt

  regulators:
    type: object

additionalProperties: false

required:
  - compatible
  - reg

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

      pmic@32 {
        compatible = "ricoh,rn5t618";
        reg = <0x32>;
        interrupt-parent = <&gpio5>;
        interrupts = <11 IRQ_TYPE_EDGE_FALLING>;
        system-power-controller;

        regulators {
          DCDC1 {
            regulator-min-microvolt = <1050000>;
            regulator-max-microvolt = <1050000>;
          };

          DCDC2 {
            regulator-min-microvolt = <1175000>;
            regulator-max-microvolt = <1175000>;
          };
        };
      };
    };


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

title: RK805 Power Management Integrated Circuit

maintainers:
  - Chris Zhong <zyw@rock-chips.com>
  - Zhang Qing <zhangqing@rock-chips.com>

description: |
  Rockchip RK805 series PMIC. This device consists of an i2c controlled MFD
  that includes multiple switchable regulators.

properties:
  compatible:
    enum:
      - rockchip,rk805

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  '#clock-cells':
    description:
      See <dt-bindings/clock/rockchip,rk808.h> for clock IDs.
    minimum: 0
    maximum: 1

  clock-output-names:
    description:
      From common clock binding to override the default output clock name.

  gpio-controller: true

  '#gpio-cells':
    const: 2

  rockchip,system-power-controller:
    type: boolean
    description:
      Telling whether or not this PMIC is controlling the system power.

  wakeup-source:
    type: boolean
    description:
      Device can be used as a wakeup source.

  vcc1-supply:
    description:
      The input supply for DCDC_REG1.

  vcc2-supply:
    description:
      The input supply for DCDC_REG2.

  vcc3-supply:
    description:
      The input supply for DCDC_REG3.

  vcc4-supply:
    description:
      The input supply for DCDC_REG4.

  vcc5-supply:
    description:
      The input supply for LDO_REG1 and LDO_REG2.

  vcc6-supply:
    description:
      The input supply for LDO_REG3.

  regulators:
    type: object
    patternProperties:
      "^(DCDC_REG[1-4]|LDO_REG[1-3])$":
        type: object
        $ref: ../regulator/regulator.yaml#
    unevaluatedProperties: false

allOf:
  - if:
      properties:
        '#clock-cells':
          const: 0

    then:
      properties:
        clock-output-names:
          maxItems: 1

    else:
      properties:
        clock-output-names:
          maxItems: 2

required:
  - compatible
  - reg
  - interrupts
  - "#clock-cells"

additionalProperties: false

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

        pmic@18 {
            compatible = "rockchip,rk805";
            reg = <0x18>;
            interrupt-parent = <&gpio2>;
            interrupts = <RK_PA6 IRQ_TYPE_LEVEL_LOW>;
            pinctrl-names = "default";
            pinctrl-0 = <&pmic_int_l>;
            rockchip,system-power-controller;
            wakeup-source;
            #clock-cells = <0>;

            vcc1-supply = <&vcc_sys>;
            vcc2-supply = <&vcc_sys>;
            vcc3-supply = <&vcc_sys>;
            vcc4-supply = <&vcc_sys>;
            vcc5-supply = <&vcc_io>;
            vcc6-supply = <&vcc_io>;

            regulators {
                vdd_logic: DCDC_REG1 {
                    regulator-name = "vdd_logic";
                    regulator-min-microvolt = <700000>;
                    regulator-max-microvolt = <1350000>;
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-state-mem {
                        regulator-on-in-suspend;
                        regulator-suspend-microvolt = <1000000>;
                    };
                };

                vdd_arm: DCDC_REG2 {
                    regulator-name = "vdd_arm";
                    regulator-min-microvolt = <700000>;
                    regulator-max-microvolt = <1350000>;
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-state-mem {
                        regulator-on-in-suspend;
                        regulator-suspend-microvolt = <950000>;
                    };
                };

                vcc_ddr: DCDC_REG3 {
                    regulator-name = "vcc_ddr";
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-state-mem {
                        regulator-on-in-suspend;
                    };
                };

                vcc_io: DCDC_REG4 {
                    regulator-name = "vcc_io";
                    regulator-min-microvolt = <3300000>;
                    regulator-max-microvolt = <3300000>;
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-state-mem {
                        regulator-on-in-suspend;
                        regulator-suspend-microvolt = <3300000>;
                    };
                };

                vdd_18: LDO_REG1 {
                    regulator-name = "vdd_18";
                    regulator-min-microvolt = <1800000>;
                    regulator-max-microvolt = <1800000>;
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-state-mem {
                        regulator-on-in-suspend;
                        regulator-suspend-microvolt = <1800000>;
                    };
                };

                vcc18_emmc: LDO_REG2 {
                    regulator-name = "vcc_18emmc";
                    regulator-min-microvolt = <1800000>;
                    regulator-max-microvolt = <1800000>;
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-state-mem {
                        regulator-on-in-suspend;
                        regulator-suspend-microvolt = <1800000>;
                    };
                };

                vdd_11: LDO_REG3 {
                    regulator-name = "vdd_11";
                    regulator-min-microvolt = <1100000>;
                    regulator-max-microvolt = <1100000>;
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-state-mem {
                        regulator-on-in-suspend;
                        regulator-suspend-microvolt = <1100000>;
                    };
                };
            };
        };
    };


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

title: RK808 Power Management Integrated Circuit

maintainers:
  - Chris Zhong <zyw@rock-chips.com>
  - Zhang Qing <zhangqing@rock-chips.com>

description: |
  Rockchip RK808 series PMIC. This device consists of an i2c controlled MFD
  that includes regulators, an RTC, and a power button.

properties:
  compatible:
    enum:
      - rockchip,rk808

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  '#clock-cells':
    description:
      See <dt-bindings/clock/rockchip,rk808.h> for clock IDs.
    const: 1

  clock-output-names:
    description:
      From common clock binding to override the default output clock name.
    maxItems: 2

  rockchip,system-power-controller:
    type: boolean
    description:
      Telling whether or not this PMIC is controlling the system power.

  wakeup-source:
    type: boolean
    description:
      Device can be used as a wakeup source.

  vcc1-supply:
    description:
      The input supply for DCDC_REG1.

  vcc2-supply:
    description:
      The input supply for DCDC_REG2.

  vcc3-supply:
    description:
      The input supply for DCDC_REG3.

  vcc4-supply:
    description:
      The input supply for DCDC_REG4.

  vcc6-supply:
    description:
      The input supply for LDO_REG1 and LDO_REG2.

  vcc7-supply:
    description:
      The input supply for LDO_REG3 and LDO_REG7.

  vcc8-supply:
    description:
      The input supply for SWITCH_REG1.

  vcc9-supply:
    description:
      The input supply for LDO_REG4 and LDO_REG5.

  vcc10-supply:
    description:
      The input supply for LDO_REG6.

  vcc11-supply:
    description:
      The input supply for LDO_REG8.

  vcc12-supply:
    description:
      The input supply for SWITCH_REG2.

  vddio-supply:
    description:
      The input supply for digital IO.

  dvs-gpios:
    description: |
      buck1/2 can be controlled by gpio dvs, this is GPIO specifiers for
      2 host gpio's used for dvs. The format of the gpio specifier
      depends in the gpio controller. If DVS GPIOs aren't present,
      voltage changes will happen very quickly with no slow ramp time.
    maxItems: 2

  regulators:
    type: object
    patternProperties:
      "^(DCDC_REG[1-4]|LDO_REG[1-8]|SWITCH_REG[1-2])$":
        type: object
        $ref: ../regulator/regulator.yaml#
    unevaluatedProperties: false

required:
  - compatible
  - reg
  - interrupts
  - "#clock-cells"

additionalProperties: false

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

        rk808: pmic@1b {
            compatible = "rockchip,rk808";
            clock-output-names = "xin32k", "rk808-clkout2";
            interrupt-parent = <&gpio0>;
            interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
            pinctrl-names = "default";
            pinctrl-0 = <&pmic_int &dvs_1 &dvs_2>;
            dvs-gpios = <&gpio7 11 GPIO_ACTIVE_HIGH>,
                <&gpio7 15 GPIO_ACTIVE_HIGH>;
            reg = <0x1b>;
            rockchip,system-power-controller;
            wakeup-source;
            #clock-cells = <1>;

            vcc8-supply = <&vcc_18>;
            vcc9-supply = <&vcc_io>;
            vcc10-supply = <&vcc_io>;
            vcc12-supply = <&vcc_io>;
            vddio-supply = <&vccio_pmu>;

            regulators {
                vdd_cpu: DCDC_REG1 {
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-min-microvolt = <750000>;
                    regulator-max-microvolt = <1300000>;
                    regulator-name = "vdd_arm";
                };

                vdd_gpu: DCDC_REG2 {
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-min-microvolt = <850000>;
                    regulator-max-microvolt = <1250000>;
                    regulator-name = "vdd_gpu";
                };

                vcc_ddr: DCDC_REG3 {
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-name = "vcc_ddr";
                };

                vcc_io: DCDC_REG4 {
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-min-microvolt = <3300000>;
                    regulator-max-microvolt = <3300000>;
                    regulator-name = "vcc_io";
                };

                vccio_pmu: LDO_REG1 {
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-min-microvolt = <3300000>;
                    regulator-max-microvolt = <3300000>;
                    regulator-name = "vccio_pmu";
                };

                vcc_tp: LDO_REG2 {
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-min-microvolt = <3300000>;
                    regulator-max-microvolt = <3300000>;
                    regulator-name = "vcc_tp";
                };

                vdd_10: LDO_REG3 {
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-min-microvolt = <1000000>;
                    regulator-max-microvolt = <1000000>;
                    regulator-name = "vdd_10";
                };

                vcc18_lcd: LDO_REG4 {
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-min-microvolt = <1800000>;
                    regulator-max-microvolt = <1800000>;
                    regulator-name = "vcc18_lcd";
                };

                vccio_sd: LDO_REG5 {
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-min-microvolt = <1800000>;
                    regulator-max-microvolt = <3300000>;
                    regulator-name = "vccio_sd";
                };

                vdd10_lcd: LDO_REG6 {
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-min-microvolt = <1000000>;
                    regulator-max-microvolt = <1000000>;
                    regulator-name = "vdd10_lcd";
                };

                vcc_18: LDO_REG7 {
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-min-microvolt = <1800000>;
                    regulator-max-microvolt = <1800000>;
                    regulator-name = "vcc_18";
                };

                vcca_codec: LDO_REG8 {
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-min-microvolt = <3300000>;
                    regulator-max-microvolt = <3300000>;
                    regulator-name = "vcca_codec";
                };

                vcc_wl: SWITCH_REG1 {
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-name = "vcc_wl";
                };

                vcc_lcd: SWITCH_REG2 {
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-name = "vcc_lcd";
                };
            };
        };
    };


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

title: RK809 Power Management Integrated Circuit

maintainers:
  - Chris Zhong <zyw@rock-chips.com>
  - Zhang Qing <zhangqing@rock-chips.com>

description: |
  Rockchip RK809 series PMIC. This device consists of an i2c controlled MFD
  that includes regulators, an RTC, and power button.

properties:
  compatible:
    enum:
      - rockchip,rk809

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  '#clock-cells':
    description: |
      See <dt-bindings/clock/rockchip,rk808.h> for clock IDs.
    minimum: 0
    maximum: 1

  clock-output-names:
    description:
      From common clock binding to override the default output clock name.

  rockchip,system-power-controller:
    type: boolean
    description:
      Telling whether or not this PMIC is controlling the system power.

  wakeup-source:
    type: boolean
    description:
      Device can be used as a wakeup source.

  vcc1-supply:
    description:
      The input supply for DCDC_REG1.

  vcc2-supply:
    description:
      The input supply for DCDC_REG2.

  vcc3-supply:
    description:
      The input supply for DCDC_REG3.

  vcc4-supply:
    description:
      The input supply for DCDC_REG4.

  vcc5-supply:
    description:
      The input supply for LDO_REG1, LDO_REG2, and LDO_REG3.

  vcc6-supply:
    description:
      The input supply for LDO_REG4, LDO_REG5, and LDO_REG6.

  vcc7-supply:
    description:
      The input supply for LDO_REG7, LDO_REG8, and LDO_REG9.

  vcc8-supply:
    description:
      The input supply for SWITCH_REG1.

  vcc9-supply:
    description:
      The input supply for DCDC_REG5 and SWITCH_REG2.

  regulators:
    type: object
    patternProperties:
      "^(LDO_REG[1-9]|DCDC_REG[1-5]|SWITCH_REG[1-2])$":
        type: object
        $ref: ../regulator/regulator.yaml#
    unevaluatedProperties: false

allOf:
  - if:
      properties:
        '#clock-cells':
          const: 0

    then:
      properties:
        clock-output-names:
          maxItems: 1

    else:
      properties:
        clock-output-names:
          maxItems: 2

required:
  - compatible
  - reg
  - interrupts
  - "#clock-cells"

additionalProperties: false

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

        rk808: pmic@1b {
            compatible = "rockchip,rk808";
            reg = <0x1b>;
            #clock-cells = <1>;
            clock-output-names = "xin32k", "rk808-clkout2";
            interrupt-parent = <&gpio3>;
            interrupts = <10 IRQ_TYPE_LEVEL_LOW>;
            pinctrl-names = "default";
            pinctrl-0 = <&pmic_int_l_pin>;
            rockchip,system-power-controller;
            wakeup-source;

            vcc1-supply = <&vcc_sysin>;
            vcc2-supply = <&vcc_sysin>;
            vcc3-supply = <&vcc_sysin>;
            vcc4-supply = <&vcc_sysin>;
            vcc6-supply = <&vcc_sysin>;
            vcc7-supply = <&vcc_sysin>;
            vcc8-supply = <&vcc3v3_sys>;
            vcc9-supply = <&vcc_sysin>;
            vcc10-supply = <&vcc_sysin>;
            vcc11-supply = <&vcc_sysin>;
            vcc12-supply = <&vcc3v3_sys>;

            regulators {
                vdd_center: DCDC_REG1 {
                    regulator-name = "vdd_center";
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-min-microvolt = <750000>;
                    regulator-max-microvolt = <1350000>;
                    regulator-ramp-delay = <6001>;
                    regulator-state-mem {
                        regulator-off-in-suspend;
                    };
                };

                vdd_cpu_l: DCDC_REG2 {
                    regulator-name = "vdd_cpu_l";
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-min-microvolt = <750000>;
                    regulator-max-microvolt = <1350000>;
                    regulator-ramp-delay = <6001>;
                    regulator-state-mem {
                        regulator-off-in-suspend;
                    };
                };

                vcc_ddr: DCDC_REG3 {
                    regulator-name = "vcc_ddr";
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-state-mem {
                        regulator-on-in-suspend;
                    };
                };

                vcc_1v8: vcc_wl: DCDC_REG4 {
                    regulator-name = "vcc_1v8";
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-min-microvolt = <1800000>;
                    regulator-max-microvolt = <1800000>;
                    regulator-state-mem {
                        regulator-on-in-suspend;
                        regulator-suspend-microvolt = <1800000>;
                    };
                };

                vcc1v8_pmupll: LDO_REG3 {
                    regulator-name = "vcc1v8_pmupll";
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-min-microvolt = <1800000>;
                    regulator-max-microvolt = <1800000>;
                    regulator-state-mem {
                        regulator-on-in-suspend;
                        regulator-suspend-microvolt = <1800000>;
                    };
                };

                vcc_sdio: LDO_REG4 {
                    regulator-name = "vcc_sdio";
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-min-microvolt = <1800000>;
                    regulator-max-microvolt = <3000000>;
                    regulator-state-mem {
                        regulator-on-in-suspend;
                        regulator-suspend-microvolt = <3000000>;
                    };
                };

                vcca3v0_codec: LDO_REG5 {
                    regulator-name = "vcca3v0_codec";
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-min-microvolt = <3000000>;
                    regulator-max-microvolt = <3000000>;
                    regulator-state-mem {
                        regulator-off-in-suspend;
                    };
                };

                vcc_1v5: LDO_REG6 {
                    regulator-name = "vcc_1v5";
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-min-microvolt = <1500000>;
                    regulator-max-microvolt = <1500000>;
                    regulator-state-mem {
                        regulator-on-in-suspend;
                        regulator-suspend-microvolt = <1500000>;
                    };
                };

                vcca1v8_codec: LDO_REG7 {
                    regulator-name = "vcca1v8_codec";
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-min-microvolt = <1800000>;
                    regulator-max-microvolt = <1800000>;
                    regulator-state-mem {
                        regulator-off-in-suspend;
                    };
                };

                vcc_3v0: LDO_REG8 {
                    regulator-name = "vcc_3v0";
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-min-microvolt = <3000000>;
                    regulator-max-microvolt = <3000000>;
                    regulator-state-mem {
                        regulator-on-in-suspend;
                        regulator-suspend-microvolt = <3000000>;
                    };
                };

                vcc3v3_s3: SWITCH_REG1 {
                    regulator-name = "vcc3v3_s3";
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-state-mem {
                        regulator-off-in-suspend;
                    };
                };

                vcc3v3_s0: SWITCH_REG2 {
                    regulator-name = "vcc3v3_s0";
                    regulator-always-on;
                    regulator-boot-on;
                    regulator-state-mem {
                        regulator-off-in-suspend;
                    };
                };
            };
        };
    };