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

title: Mediatek Power Domains Controller

maintainers:
  - MandyJH Liu <mandyjh.liu@mediatek.com>
  - Matthias Brugger <mbrugger@suse.com>

description: |
  Mediatek processors include support for multiple power domains which can be
  powered up/down by software based on different application scenes to save power.

  IP cores belonging to a power domain should contain a 'power-domains'
  property that is a phandle for SCPSYS node representing the domain.

properties:
  $nodename:
    pattern: '^power-controller(@[0-9a-f]+)?$'

  compatible:
    enum:
      - mediatek,mt6795-power-controller
      - mediatek,mt8167-power-controller
      - mediatek,mt8173-power-controller
      - mediatek,mt8183-power-controller
      - mediatek,mt8186-power-controller
      - mediatek,mt8192-power-controller
      - mediatek,mt8195-power-controller

  '#power-domain-cells':
    const: 1

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

patternProperties:
  "^power-domain@[0-9a-f]+$":
    $ref: "#/$defs/power-domain-node"
    patternProperties:
      "^power-domain@[0-9a-f]+$":
        $ref: "#/$defs/power-domain-node"
        patternProperties:
          "^power-domain@[0-9a-f]+$":
            $ref: "#/$defs/power-domain-node"
            patternProperties:
              "^power-domain@[0-9a-f]+$":
                $ref: "#/$defs/power-domain-node"
                unevaluatedProperties: false
            unevaluatedProperties: false
        unevaluatedProperties: false
    unevaluatedProperties: false

$defs:
  power-domain-node:
    type: object
    description: |
      Represents the power domains within the power controller node as documented
      in Documentation/devicetree/bindings/power/power-domain.yaml.

    properties:

      '#power-domain-cells':
        description:
          Must be 0 for nodes representing a single PM domain and 1 for nodes
          providing multiple PM domains.

      '#address-cells':
        const: 1

      '#size-cells':
        const: 0

      reg:
        description: |
          Power domain index. Valid values are defined in:
              "include/dt-bindings/power/mt6795-power.h" - for MT8167 type power domain.
              "include/dt-bindings/power/mt8167-power.h" - for MT8167 type power domain.
              "include/dt-bindings/power/mt8173-power.h" - for MT8173 type power domain.
              "include/dt-bindings/power/mt8183-power.h" - for MT8183 type power domain.
              "include/dt-bindings/power/mt8192-power.h" - for MT8192 type power domain.
              "include/dt-bindings/power/mt8195-power.h" - for MT8195 type power domain.
        maxItems: 1

      clocks:
        description: |
          A number of phandles to clocks that need to be enabled during domain
          power-up sequencing.

      clock-names:
        description: |
          List of names of clocks, in order to match the power-up sequencing
          for each power domain we need to group the clocks by name. BASIC
          clocks need to be enabled before enabling the corresponding power
          domain, and should not have a '-' in their name (i.e mm, mfg, venc).
          SUSBYS clocks need to be enabled before releasing the bus protection,
          and should contain a '-' in their name (i.e mm-0, isp-0, cam-0).

          In order to follow properly the power-up sequencing, the clocks must
          be specified by order, adding first the BASIC clocks followed by the
          SUSBSYS clocks.

      domain-supply:
        description: domain regulator supply.

      mediatek,infracfg:
        $ref: /schemas/types.yaml#/definitions/phandle
        description: phandle to the device containing the INFRACFG register range.

      mediatek,smi:
        $ref: /schemas/types.yaml#/definitions/phandle
        description: phandle to the device containing the SMI register range.

    required:
      - reg

required:
  - compatible

additionalProperties: false

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

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

        scpsys: syscon@10006000 {
            compatible = "mediatek,mt8173-scpsys", "syscon", "simple-mfd";
            reg = <0 0x10006000 0 0x1000>;

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

                /* power domains of the SoC */
                power-domain@MT8173_POWER_DOMAIN_VDEC {
                    reg = <MT8173_POWER_DOMAIN_VDEC>;
                    clocks = <&topckgen CLK_TOP_MM_SEL>;
                    clock-names = "mm";
                    #power-domain-cells = <0>;
                };
                power-domain@MT8173_POWER_DOMAIN_VENC {
                    reg = <MT8173_POWER_DOMAIN_VENC>;
                    clocks = <&topckgen CLK_TOP_MM_SEL>,
                             <&topckgen CLK_TOP_VENC_SEL>;
                    clock-names = "mm", "venc";
                    #power-domain-cells = <0>;
                };
                power-domain@MT8173_POWER_DOMAIN_ISP {
                    reg = <MT8173_POWER_DOMAIN_ISP>;
                    clocks = <&topckgen CLK_TOP_MM_SEL>;
                    clock-names = "mm";
                    #power-domain-cells = <0>;
                };
                power-domain@MT8173_POWER_DOMAIN_MM {
                    reg = <MT8173_POWER_DOMAIN_MM>;
                    clocks = <&topckgen CLK_TOP_MM_SEL>;
                    clock-names = "mm";
                    #power-domain-cells = <0>;
                    mediatek,infracfg = <&infracfg>;
                };
                power-domain@MT8173_POWER_DOMAIN_VENC_LT {
                    reg = <MT8173_POWER_DOMAIN_VENC_LT>;
                    clocks = <&topckgen CLK_TOP_MM_SEL>,
                             <&topckgen CLK_TOP_VENC_LT_SEL>;
                    clock-names = "mm", "venclt";
                    #power-domain-cells = <0>;
                };
                power-domain@MT8173_POWER_DOMAIN_AUDIO {
                    reg = <MT8173_POWER_DOMAIN_AUDIO>;
                    #power-domain-cells = <0>;
                };
                power-domain@MT8173_POWER_DOMAIN_USB {
                    reg = <MT8173_POWER_DOMAIN_USB>;
                    #power-domain-cells = <0>;
                };
                power-domain@MT8173_POWER_DOMAIN_MFG_ASYNC {
                    reg = <MT8173_POWER_DOMAIN_MFG_ASYNC>;
                    clocks = <&clk26m>;
                    clock-names = "mfg";
                    #address-cells = <1>;
                    #size-cells = <0>;
                    #power-domain-cells = <1>;

                    power-domain@MT8173_POWER_DOMAIN_MFG_2D {
                        reg = <MT8173_POWER_DOMAIN_MFG_2D>;
                        #address-cells = <1>;
                        #size-cells = <0>;
                        #power-domain-cells = <1>;

                        power-domain@MT8173_POWER_DOMAIN_MFG {
                            reg = <MT8173_POWER_DOMAIN_MFG>;
                            #power-domain-cells = <0>;
                            mediatek,infracfg = <&infracfg>;
                        };
                    };
                };
            };
        };
    };


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

title: MIPS Cluster Power Controller

description: |
  Defines a location of the MIPS Cluster Power Controller registers.

maintainers:
  - Paul Burton <paulburton@kernel.org>

properties:
  compatible:
    const: mti,mips-cpc

  reg:
    description: |
      Base address and size of an unoccupied memory region, which will be
      used to map the MIPS CPC registers block.
    maxItems: 1

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    cpc@1bde0000 {
      compatible = "mti,mips-cpc";
      reg = <0x1bde0000 0x8000>;
    };
...

repo_name: angery/linux


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

title: Samsung Exynos SoC Power Domains

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

description: |+
  Exynos processors include support for multiple power domains which are used
  to gate power to one or more peripherals on the processor.

allOf:
  - $ref: power-domain.yaml#

properties:
  compatible:
    enum:
      - samsung,exynos4210-pd
      - samsung,exynos5433-pd

  reg:
    maxItems: 1

  clocks:
    deprecated: true
    maxItems: 1

  clock-names:
    deprecated: true
    maxItems: 1

  label:
    description:
      Human readable string with domain name. Will be visible in userspace
      to let user to distinguish between multiple domains in SoC.

  "#power-domain-cells":
    const: 0

  power-domains:
    maxItems: 1

required:
  - compatible
  - "#power-domain-cells"
  - reg

unevaluatedProperties: false

examples:
  - |
    lcd0_pd: power-domain@10023c80 {
        compatible = "samsung,exynos4210-pd";
        reg = <0x10023c80 0x20>;
        #power-domain-cells = <0>;
        label = "LCD0";
    };

    mfc_pd: power-domain@10044060 {
        compatible = "samsung,exynos4210-pd";
        reg = <0x10044060 0x20>;
        #power-domain-cells = <0>;
        label = "MFC";
    };


code:
* Generic system power control capability

Power-management integrated circuits or miscellaneous hardware components are
sometimes able to control the system power. The device driver associated with these
components might need to define this capability, which tells the kernel that
it can be used to switch off the system. The corresponding device must have the
standard property "system-power-controller" in its device node. This property
marks the device as able to control the system power. In order to test if this
property is found programmatically, use the helper function
"of_device_is_system_power_controller" from of.h .

Example:

act8846: act8846@5 {
	 compatible = "active-semi,act8846";
	 system-power-controller;
}


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

title: Generic PM domains

maintainers:
  - Rafael J. Wysocki <rjw@rjwysocki.net>
  - Kevin Hilman <khilman@kernel.org>
  - Ulf Hansson <ulf.hansson@linaro.org>

description: |+
  System on chip designs are often divided into multiple PM domains that can be
  used for power gating of selected IP blocks for power saving by reduced leakage
  current.

  This device tree binding can be used to bind PM domain consumer devices with
  their PM domains provided by PM domain providers. A PM domain provider can be
  represented by any node in the device tree and can provide one or more PM
  domains. A consumer node can refer to the provider by a phandle and a set of
  phandle arguments (so called PM domain specifiers) of length specified by the
  \#power-domain-cells property in the PM domain provider node.

properties:
  $nodename:
    pattern: "^(power-controller|power-domain)([@-].*)?$"

  domain-idle-states:
    $ref: /schemas/types.yaml#/definitions/phandle-array
    items:
      maxItems: 1
    description: |
      Phandles of idle states that defines the available states for the
      power-domain provider. The idle state definitions are compatible with the
      domain-idle-state bindings, specified in ./domain-idle-state.yaml.

      Note that, the domain-idle-state property reflects the idle states of this
      PM domain and not the idle states of the devices or sub-domains in the PM
      domain. Devices and sub-domains have their own idle states independent of
      the parent domain's idle states. In the absence of this property, the
      domain would be considered as capable of being powered-on or powered-off.

  operating-points-v2:
    $ref: /schemas/types.yaml#/definitions/phandle-array
    items:
      maxItems: 1
    description:
      Phandles to the OPP tables of power domains provided by a power domain
      provider. If the provider provides a single power domain only or all
      the power domains provided by the provider have identical OPP tables,
      then this shall contain a single phandle. Refer to ../opp/opp-v2-base.yaml
      for more information.

  "#power-domain-cells":
    description:
      Number of cells in a PM domain specifier. Typically 0 for nodes
      representing a single PM domain and 1 for nodes providing multiple PM
      domains (e.g. power controllers), but can be any value as specified
      by device tree binding documentation of particular provider.

  power-domains:
    description:
      A phandle and PM domain specifier as defined by bindings of the power
      controller specified by phandle. Some power domains might be powered
      from another power domain (or have other hardware specific
      dependencies). For representing such dependency a standard PM domain
      consumer binding is used. When provided, all domains created
      by the given provider should be subdomains of the domain specified
      by this binding.

required:
  - "#power-domain-cells"

additionalProperties: true

examples:
  - |
    power: power-controller@12340000 {
        compatible = "foo,power-controller";
        reg = <0x12340000 0x1000>;
        #power-domain-cells = <1>;
    };

    // The node above defines a power controller that is a PM domain provider and
    // expects one cell as its phandle argument.

  - |
    parent2: power-controller@12340000 {
        compatible = "foo,power-controller";
        reg = <0x12340000 0x1000>;
        #power-domain-cells = <1>;
    };

    child2: power-controller@12341000 {
        compatible = "foo,power-controller";
        reg = <0x12341000 0x1000>;
        power-domains = <&parent2 0>;
        #power-domain-cells = <1>;
    };

    // The nodes above define two power controllers: 'parent' and 'child'.
    // Domains created by the 'child' power controller are subdomains of '0' power
    // domain provided by the 'parent' power controller.

  - |
    parent3: power-controller@12340000 {
        compatible = "foo,power-controller";
        reg = <0x12340000 0x1000>;
        #power-domain-cells = <0>;
        domain-idle-states = <&DOMAIN_RET>, <&DOMAIN_PWR_DN>;
    };

    child3: power-controller@12341000 {
        compatible = "foo,power-controller";
        reg = <0x12341000 0x1000>;
        power-domains = <&parent3>;
        #power-domain-cells = <0>;
        domain-idle-states = <&DOMAIN_PWR_DN>;
    };

    domain-idle-states {
        DOMAIN_RET: domain-retention {
            compatible = "domain-idle-state";
            entry-latency-us = <1000>;
            exit-latency-us = <2000>;
            min-residency-us = <10000>;
        };

        DOMAIN_PWR_DN: domain-pwr-dn {
            compatible = "domain-idle-state";
            entry-latency-us = <5000>;
            exit-latency-us = <8000>;
            min-residency-us = <7000>;
        };
    };


code:
* Generic PM domains

System on chip designs are often divided into multiple PM domains that can be
used for power gating of selected IP blocks for power saving by reduced leakage
current.

This device tree binding can be used to bind PM domain consumer devices with
their PM domains provided by PM domain providers. A PM domain provider can be
represented by any node in the device tree and can provide one or more PM
domains. A consumer node can refer to the provider by a phandle and a set of
phandle arguments (so called PM domain specifiers) of length specified by the
#power-domain-cells property in the PM domain provider node.

==PM domain providers==

See power-domain.yaml.

==PM domain consumers==

Required properties:
 - power-domains : A list of PM domain specifiers, as defined by bindings of
		the power controller that is the PM domain provider.

Optional properties:
 - power-domain-names : A list of power domain name strings sorted in the same
		order as the power-domains property. Consumers drivers will use
		power-domain-names to match power domains with power-domains
		specifiers.

Example:

	leaky-device@12350000 {
		compatible = "foo,i-leak-current";
		reg = <0x12350000 0x1000>;
		power-domains = <&power 0>;
		power-domain-names = "io";
	};

	leaky-device@12351000 {
		compatible = "foo,i-leak-current";
		reg = <0x12351000 0x1000>;
		power-domains = <&power 0>, <&power 1> ;
		power-domain-names = "io", "clk";
	};

The first example above defines a typical PM domain consumer device, which is
located inside a PM domain with index 0 of a power controller represented by a
node with the label "power".
In the second example the consumer device are partitioned across two PM domains,
the first with index 0 and the second with index 1, of a power controller that
is represented by a node with the label "power".

Optional properties:
- required-opps: This contains phandle to an OPP node in another device's OPP
  table. It may contain an array of phandles, where each phandle points to an
  OPP of a different device. It should not contain multiple phandles to the OPP
  nodes in the same OPP table. This specifies the minimum required OPP of the
  device(s), whose OPP's phandle is present in this property, for the
  functioning of the current device at the current OPP (where this property is
  present).

Example:
- OPP table for domain provider that provides two domains.

	domain0_opp_table: opp-table0 {
		compatible = "operating-points-v2";

		domain0_opp_0: opp-1000000000 {
			opp-hz = /bits/ 64 <1000000000>;
			opp-microvolt = <975000 970000 985000>;
		};
		domain0_opp_1: opp-1100000000 {
			opp-hz = /bits/ 64 <1100000000>;
			opp-microvolt = <1000000 980000 1010000>;
		};
	};

	domain1_opp_table: opp-table1 {
		compatible = "operating-points-v2";

		domain1_opp_0: opp-1200000000 {
			opp-hz = /bits/ 64 <1200000000>;
			opp-microvolt = <975000 970000 985000>;
		};
		domain1_opp_1: opp-1300000000 {
			opp-hz = /bits/ 64 <1300000000>;
			opp-microvolt = <1000000 980000 1010000>;
		};
	};

	power: power-controller@12340000 {
		compatible = "foo,power-controller";
		reg = <0x12340000 0x1000>;
		#power-domain-cells = <1>;
		operating-points-v2 = <&domain0_opp_table>, <&domain1_opp_table>;
	};

	leaky-device0@12350000 {
		compatible = "foo,i-leak-current";
		reg = <0x12350000 0x1000>;
		power-domains = <&power 0>;
		required-opps = <&domain0_opp_0>;
	};

	leaky-device1@12350000 {
		compatible = "foo,i-leak-current";
		reg = <0x12350000 0x1000>;
		power-domains = <&power 1>;
		required-opps = <&domain1_opp_1>;
	};

[1]. Documentation/devicetree/bindings/power/domain-idle-state.yaml


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

title: Qualcomm RPM/RPMh Power domains

maintainers:
  - Bjorn Andersson <andersson@kernel.org>

description:
  For RPM/RPMh Power domains, we communicate a performance state to RPM/RPMh
  which then translates it into a corresponding voltage on a rail.

properties:
  compatible:
    enum:
      - qcom,mdm9607-rpmpd
      - qcom,msm8226-rpmpd
      - qcom,msm8909-rpmpd
      - qcom,msm8916-rpmpd
      - qcom,msm8939-rpmpd
      - qcom,msm8953-rpmpd
      - qcom,msm8976-rpmpd
      - qcom,msm8994-rpmpd
      - qcom,msm8996-rpmpd
      - qcom,msm8998-rpmpd
      - qcom,qcm2290-rpmpd
      - qcom,qcs404-rpmpd
      - qcom,qdu1000-rpmhpd
      - qcom,sa8540p-rpmhpd
      - qcom,sdm660-rpmpd
      - qcom,sc7180-rpmhpd
      - qcom,sc7280-rpmhpd
      - qcom,sc8180x-rpmhpd
      - qcom,sc8280xp-rpmhpd
      - qcom,sdm670-rpmhpd
      - qcom,sdm845-rpmhpd
      - qcom,sdx55-rpmhpd
      - qcom,sdx65-rpmhpd
      - qcom,sm4250-rpmpd
      - qcom,sm6115-rpmpd
      - qcom,sm6125-rpmpd
      - qcom,sm6350-rpmhpd
      - qcom,sm6375-rpmpd
      - qcom,sm8150-rpmhpd
      - qcom,sm8250-rpmhpd
      - qcom,sm8350-rpmhpd
      - qcom,sm8450-rpmhpd
      - qcom,sm8550-rpmhpd

  '#power-domain-cells':
    const: 1

  operating-points-v2: true

  opp-table:
    type: object

required:
  - compatible
  - '#power-domain-cells'
  - operating-points-v2

additionalProperties: false

examples:
  - |

    // Example 1 (rpmh power domain controller and OPP table):

    #include <dt-bindings/power/qcom-rpmpd.h>

    rpmhpd: power-controller {
      compatible = "qcom,sdm845-rpmhpd";
      #power-domain-cells = <1>;
      operating-points-v2 = <&rpmhpd_opp_table>;

      rpmhpd_opp_table: opp-table {
        compatible = "operating-points-v2";

        rpmhpd_opp_ret: opp1 {
          opp-level = <RPMH_REGULATOR_LEVEL_RETENTION>;
        };

        rpmhpd_opp_min_svs: opp2 {
          opp-level = <RPMH_REGULATOR_LEVEL_MIN_SVS>;
        };

        rpmhpd_opp_low_svs: opp3 {
          opp-level = <RPMH_REGULATOR_LEVEL_LOW_SVS>;
        };

        rpmhpd_opp_svs: opp4 {
          opp-level = <RPMH_REGULATOR_LEVEL_SVS>;
        };

        rpmhpd_opp_svs_l1: opp5 {
          opp-level = <RPMH_REGULATOR_LEVEL_SVS_L1>;
        };

        rpmhpd_opp_nom: opp6 {
          opp-level = <RPMH_REGULATOR_LEVEL_NOM>;
        };

        rpmhpd_opp_nom_l1: opp7 {
          opp-level = <RPMH_REGULATOR_LEVEL_NOM_L1>;
        };

        rpmhpd_opp_nom_l2: opp8 {
          opp-level = <RPMH_REGULATOR_LEVEL_NOM_L2>;
        };

        rpmhpd_opp_turbo: opp9 {
          opp-level = <RPMH_REGULATOR_LEVEL_TURBO>;
        };

        rpmhpd_opp_turbo_l1: opp10 {
          opp-level = <RPMH_REGULATOR_LEVEL_TURBO_L1>;
        };
      };
    };

  - |

    // Example 2 (rpm power domain controller and OPP table):

    rpmpd: power-controller {
      compatible = "qcom,msm8996-rpmpd";
      #power-domain-cells = <1>;
      operating-points-v2 = <&rpmpd_opp_table>;

      rpmpd_opp_table: opp-table {
        compatible = "operating-points-v2";

        rpmpd_opp_low: opp1 {
          opp-level = <1>;
        };

        rpmpd_opp_ret: opp2 {
          opp-level = <2>;
        };

        rpmpd_opp_svs: opp3 {
          opp-level = <3>;
        };

        rpmpd_opp_normal: opp4 {
          opp-level = <4>;
        };

        rpmpd_opp_high: opp5 {
          opp-level = <5>;
        };

        rpmpd_opp_turbo: opp6 {
          opp-level = <6>;
        };
      };
    };

  - |

    // Example 3 (Client/Consumer device using OPP table):

    leaky-device0@12350000 {
      compatible = "foo,i-leak-current";
      reg = <0x12350000 0x1000>;
      power-domains = <&rpmhpd 0>;
      operating-points-v2 = <&leaky_opp_table>;
    };

    leaky_opp_table: opp-table {
      compatible = "operating-points-v2";
      opp1 {
        opp-hz = /bits/ 64 <144000>;
        required-opps = <&rpmhpd_opp_low>;
      };

      opp2 {
        opp-hz = /bits/ 64 <400000>;
        required-opps = <&rpmhpd_opp_ret>;
      };

      opp3 {
        opp-hz = /bits/ 64 <20000000>;
        required-opps = <&rpmpd_opp_svs>;
      };

      opp4 {
        opp-hz = /bits/ 64 <25000000>;
        required-opps = <&rpmpd_opp_normal>;
      };
    };
...


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

title: Renesas Advanced Power Management Unit

maintainers:
  - Geert Uytterhoeven <geert+renesas@glider.be>
  - Magnus Damm <magnus.damm@gmail.com>

description:
  Renesas R-Car Gen2 and RZ/G1 SoCs utilize one or more APMU hardware units for
  CPU core power domain control including SMP boot and CPU Hotplug.

properties:
  compatible:
    items:
      - enum:
          - renesas,r8a7742-apmu  # RZ/G1H
          - renesas,r8a7743-apmu  # RZ/G1M
          - renesas,r8a7744-apmu  # RZ/G1N
          - renesas,r8a7745-apmu  # RZ/G1E
          - renesas,r8a77470-apmu # RZ/G1C
          - renesas,r8a7790-apmu  # R-Car H2
          - renesas,r8a7791-apmu  # R-Car M2-W
          - renesas,r8a7792-apmu  # R-Car V2H
          - renesas,r8a7793-apmu  # R-Car M2-N
          - renesas,r8a7794-apmu  # R-Car E2
      - const: renesas,apmu

  reg:
    maxItems: 1

  cpus:
    minItems: 1
    maxItems: 4
    description: |
      Array of phandles pointing to CPU cores, which should match the order of
      CPU cores used by the WUPCR and PSTR registers in the Advanced Power
      Management Unit section of the device's datasheet.

required:
  - compatible
  - reg
  - cpus

additionalProperties: false

examples:
  - |
    apmu@e6152000 {
            compatible = "renesas,r8a7791-apmu", "renesas,apmu";
            reg = <0xe6152000 0x188>;
            cpus = <&cpu0>, <&cpu1>;
    };


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

title: Renesas R-Car and RZ/G System Controller

maintainers:
  - Geert Uytterhoeven <geert+renesas@glider.be>
  - Magnus Damm <magnus.damm@gmail.com>

description: |
  The R-Car (RZ/G) System Controller provides power management for the CPU
  cores and various coprocessors.
  The power domain IDs for consumers are defined in header files::
  include/dt-bindings/power/r8*-sysc.h

properties:
  compatible:
    enum:
      - renesas,r8a7742-sysc  # RZ/G1H
      - renesas,r8a7743-sysc  # RZ/G1M
      - renesas,r8a7744-sysc  # RZ/G1N
      - renesas,r8a7745-sysc  # RZ/G1E
      - renesas,r8a77470-sysc # RZ/G1C
      - renesas,r8a774a1-sysc # RZ/G2M
      - renesas,r8a774b1-sysc # RZ/G2N
      - renesas,r8a774c0-sysc # RZ/G2E
      - renesas,r8a774e1-sysc # RZ/G2H
      - renesas,r8a7779-sysc  # R-Car H1
      - renesas,r8a7790-sysc  # R-Car H2
      - renesas,r8a7791-sysc  # R-Car M2-W
      - renesas,r8a7792-sysc  # R-Car V2H
      - renesas,r8a7793-sysc  # R-Car M2-N
      - renesas,r8a7794-sysc  # R-Car E2
      - renesas,r8a7795-sysc  # R-Car H3
      - renesas,r8a77961-sysc # R-Car M3-W+
      - renesas,r8a77965-sysc # R-Car M3-N
      - renesas,r8a7796-sysc  # R-Car M3-W
      - renesas,r8a77970-sysc # R-Car V3M
      - renesas,r8a77980-sysc # R-Car V3H
      - renesas,r8a77990-sysc # R-Car E3
      - renesas,r8a77995-sysc # R-Car D3
      - renesas,r8a779a0-sysc # R-Car V3U
      - renesas,r8a779f0-sysc # R-Car S4-8
      - renesas,r8a779g0-sysc # R-Car V4H

  reg:
    maxItems: 1

  '#power-domain-cells':
    const: 1

required:
  - compatible
  - reg
  - '#power-domain-cells'

additionalProperties: false

examples:
  - |
    // System Controller node
    sysc: system-controller@e6180000 {
            compatible = "renesas,r8a7791-sysc";
            reg = <0xe6180000 0x0200>;
            #power-domain-cells = <1>;
    };


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

title: Renesas R-Mobile System Controller

maintainers:
  - Geert Uytterhoeven <geert+renesas@glider.be>
  - Magnus Damm <magnus.damm@gmail.com>

description: |
  The R-Mobile System Controller provides the following functions:
    - Boot mode management,
    - Reset generation,
    - Power management.

properties:
  compatible:
    items:
      - enum:
          - renesas,sysc-r8a73a4    # R-Mobile APE6
          - renesas,sysc-r8a7740    # R-Mobile A1
          - renesas,sysc-sh73a0     # SH-Mobile AG5
      - const: renesas,sysc-rmobile # Generic SH/R-Mobile

  reg:
    items:
      - description: Normally accessible register block
      - description: Register block protected by the HPB semaphore

  pm-domains:
    type: object
    description: |
      This node contains a hierarchy of PM domain nodes, which should match the
      Power Area Hierarchy in the Power Domain Specifications section of the
      device's datasheet.

    properties:
      '#address-cells':
        const: 1

      '#size-cells':
        const: 0

    additionalProperties:
      $ref: "#/$defs/pd-node"

required:
  - compatible
  - reg
  - pm-domains

additionalProperties: false

$defs:
  pd-node:
    type: object
    description:
      PM domain node representing a PM domain.  This node hould be named by
      the real power area name, and thus its name should be unique.

    properties:
      reg:
        maxItems: 1
        description:
          If the PM domain is not always-on, this property must contain the
          bit index number for the corresponding power area in the various
          Power Control and Status Registers.
          If the PM domain is always-on, this property must be omitted.

      '#address-cells':
        const: 1

      '#size-cells':
        const: 0

      '#power-domain-cells':
        const: 0

    required:
      - '#power-domain-cells'

    additionalProperties:
      $ref: "#/$defs/pd-node"

examples:
  - |
    // This shows a subset of the r8a7740 PM domain hierarchy, containing the
    // C5 "always-on" domain, 2 of its subdomains (A4S and A4SU), and the A3SP
    // domain, which is a subdomain of A4S.
    sysc: system-controller@e6180000 {
            compatible = "renesas,sysc-r8a7740", "renesas,sysc-rmobile";
            reg = <0xe6180000 0x8000>, <0xe6188000 0x8000>;

            pm-domains {
                    pd_c5: c5 {
                            #address-cells = <1>;
                            #size-cells = <0>;
                            #power-domain-cells = <0>;

                            pd_a4s: a4s@10 {
                                    reg = <10>;
                                    #address-cells = <1>;
                                    #size-cells = <0>;
                                    #power-domain-cells = <0>;

                                    pd_a3sp: a3sp@11 {
                                            reg = <11>;
                                            #power-domain-cells = <0>;
                                    };
                            };

                            pd_a4su: a4su@20 {
                                    reg = <20>;
                                    #power-domain-cells = <0>;
                            };
                    };
            };
    };


code:
Axxia Restart Driver

This driver can do reset of the Axxia SoC. It uses the registers in the syscon
block to initiate a chip reset.

Required Properties:
  -compatible: "lsi,axm55xx-reset"
  -syscon: phandle to the syscon node.

Example:

	syscon: syscon@2010030000 {
		compatible = "lsi,axxia-syscon", "syscon";
		reg = <0x20 0x10030000 0 0x2000>;
	};

	reset: reset@2010031000 {
		compatible = "lsi,axm55xx-reset";
		syscon = <&syscon>;
	};


code:
Broadcom Kona Family Reset Manager
----------------------------------

The reset manager is used on the Broadcom BCM21664 SoC.

Required properties:
  - compatible: brcm,bcm21664-resetmgr
  - reg: memory address & range

Example:
	brcm,resetmgr@35001f00 {
		compatible = "brcm,bcm21664-resetmgr";
		reg = <0x35001f00 0x24>;
	};


code:
* Device-Tree bindings for Cortina Systems Gemini Poweroff

This is a special IP block in the Cortina Gemini SoC that only
deals with different ways to power the system down.

Required properties:
- compatible: should be "cortina,gemini-power-controller"
- reg: should contain the physical memory base and size
- interrupts: should contain the power management interrupt

Example:

power-controller@4b000000 {
	compatible = "cortina,gemini-power-controller";
	reg = <0x4b000000 0x100>;
	interrupts = <26 IRQ_TYPE_EDGE_FALLING>;
};


code:
# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/reset/gpio-poweroff.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: GPIO controlled power off

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

description: >
  System power off support via a GPIO line. When a shutdown is
  executed the operating system is expected to switch the GPIO
  from inactive to active. After a delay (active-delay-ms) it
  is expected to be switched back to inactive. After another
  delay (inactive-delay-ms) it is configured as active again.
  Finally the operating system assumes the power off failed if
  the system is still running after waiting some time (timeout-ms).

properties:
  compatible:
    const: gpio-poweroff

  gpios:
    maxItems: 1

  input:
    type: boolean
    description: >
      Initially configure the GPIO line as an input. Only reconfigure
      it to an output when the power-off sequence is initiated. If this optional
      property is not specified, the GPIO is initialized as an output in its inactive state.

  active-delay-ms:
    default: 100
    description: Delay to wait after driving gpio active

  inactive-delay-ms:
    default: 100
    description: Delay to wait after driving gpio inactive

  timeout-ms:
    default: 3000
    description: Time to wait before assuming the power off sequence failed.

required:
  - compatible
  - gpios

additionalProperties: false

examples:
  - |
    gpio-poweroff {
        compatible = "gpio-poweroff";
        gpios = <&gpio 4 0>;
        timeout-ms = <3000>;
    };


code:
# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/reset/gpio-restart.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: GPIO controlled reset

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

description: >
  Drive a GPIO line that can be used to restart the system from a restart handler.

  This binding supports level and edge triggered reset.  At driver load time, the driver will
  request the given gpio line and install a restart handler. If the optional properties
  'open-source' is not found, the GPIO line will be driven in the inactive state.  Otherwise its
  not driven until the restart is initiated.

  When the system is restarted, the restart handler will be invoked in priority order.  The GPIO
  is configured as an output, and driven active, triggering a level triggered reset condition.
  This will also cause an inactive->active edge condition, triggering positive edge triggered
  reset. After a delay specified by active-delay, the GPIO is set to inactive, thus causing an
  active->inactive edge, triggering negative edge triggered reset. After a delay specified by
  inactive-delay, the GPIO is driven active again.  After a delay specified by wait-delay, the
  restart handler completes allowing other restart handlers to be attempted.

allOf:
  - $ref: restart-handler.yaml#

properties:
  compatible:
    const: gpio-restart

  gpios:
    description: The GPIO to set high/low, see "gpios property" in
      Documentation/devicetree/bindings/gpio/gpio.txt. If the pin should be low to reset the board
      set it to "Active Low", otherwise set GPIO to "Active High".

  open-source:
    $ref: /schemas/types.yaml#/definitions/flag
    description: Treat the GPIO as being open source and defer driving it to when the restart is
      initiated.  If this optional property is not specified, the GPIO is initialized as an output
      in its inactive state.

  priority:
    default: 129

  active-delay:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Delay (default 100) to wait after driving gpio active [ms]
    default: 100

  inactive-delay:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Delay (default 100) to wait after driving gpio inactive [ms]
    default: 100

  wait-delay:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Delay (default 3000) to wait after completing restart sequence [ms]
    default: 100

additionalProperties: false

required:
  - compatible
  - gpios

examples:
  - |
    gpio-restart {
      compatible = "gpio-restart";
      gpios = <&gpio 4 0>;
      priority = <128>;
      active-delay = <100>;
      inactive-delay = <100>;
      wait-delay = <3000>;
    };


code:
* Device tree bindings for Texas Instruments keystone reset

This node is intended to allow SoC reset in case of software reset
of selected watchdogs.

The Keystone SoCs can contain up to 4 watchdog timers to reset
SoC. Each watchdog timer event input is connected to the Reset Mux
block. The Reset Mux block can be configured to cause reset or not.

Additionally soft or hard reset can be configured.

Required properties:

- compatible:		ti,keystone-reset

- ti,syscon-pll:	phandle/offset pair. The phandle to syscon used to
			access pll controller registers and the offset to use
			reset control registers.

- ti,syscon-dev:	phandle/offset pair. The phandle to syscon used to
			access device state control registers and the offset
			in order to use mux block registers for all watchdogs.

Optional properties:

- ti,soft-reset:	Boolean option indicating soft reset.
			By default hard reset is used.

- ti,wdt-list:		WDT list that can cause SoC reset. It's not related
			to WDT driver, it's just needed to enable a SoC related
			reset that's triggered by one of WDTs. The list is
			in format: <0>, <2>; It can be in random order and
			begins from 0 to 3, as keystone can contain up to 4 SoC
			reset watchdogs and can be in random order.

Example 1:
Setup keystone reset so that in case software reset or
WDT0 is triggered it issues hard reset for SoC.

pllctrl: pll-controller@2310000 {
	compatible = "ti,keystone-pllctrl", "syscon";
	reg = <0x02310000 0x200>;
};

devctrl: device-state-control@2620000 {
	compatible = "ti,keystone-devctrl", "syscon";
	reg = <0x02620000 0x1000>;
};

rstctrl: reset-controller {
	compatible = "ti,keystone-reset";
	ti,syscon-pll = <&pllctrl 0xe4>;
	ti,syscon-dev = <&devctrl 0x328>;
	ti,wdt-list = <0>;
};

Example 2:
Setup keystone reset so that in case of software reset or
WDT0 or WDT2 is triggered it issues soft reset for SoC.

rstctrl: reset-controller {
	compatible = "ti,keystone-reset";
	ti,syscon-pll = <&pllctrl 0xe4>;
	ti,syscon-dev = <&devctrl 0x328>;
	ti,wdt-list = <0>, <2>;
	ti,soft-reset;
};


code:
Binding for the LTC2952 PowerPath controller

This chip is used to externally trigger a system shut down. Once the trigger has
been sent, the chip's watchdog has to be reset to gracefully shut down.
A full powerdown can be triggered via the kill signal.

Required properties:

- compatible:		Must contain: "lltc,ltc2952"
- watchdog-gpios:	phandle + gpio-specifier for the GPIO connected to the
			chip's watchdog line
- kill-gpios:		phandle + gpio-specifier for the GPIO connected to the
			chip's kill line

Optional properties:
- trigger-gpios:	phandle + gpio-specifier for the GPIO connected to the
			chip's trigger line. If this property is not set, the
			trigger function is ignored and the chip is kept alive
			until an explicit kill signal is received
- trigger-delay-ms	The number of milliseconds to wait after trigger line
			assertion before executing shut down procedure.
			The default is 2500ms.

Example:

ltc2952 {
	compatible = "lltc,ltc2952";

	trigger-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
	trigger-delay-ms = <2000>;
	watchdog-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
	kill-gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
};


code:
Device Tree Bindings for Power Controller on MediaTek PMIC

The power controller which could be found on PMIC is responsible for externally
powering off or on the remote MediaTek SoC through the circuit BBPU.

Required properties:
- compatible: Should be one of follows
       "mediatek,mt6323-pwrc": for MT6323 PMIC

Example:

       pmic {
               compatible = "mediatek,mt6323";

               ...

               power-controller {
                       compatible = "mediatek,mt6323-pwrc";
               };
       }


code:
NVMEM reboot mode driver

This driver gets reboot mode magic value from reboot-mode driver
and stores it in a NVMEM cell named "reboot-mode". Then the bootloader
can read it and take different action according to the magic
value stored.

Required properties:
- compatible: should be "nvmem-reboot-mode".
- nvmem-cells: A phandle to the reboot mode provided by a nvmem device.
- nvmem-cell-names: Should be "reboot-mode".

The rest of the properties should follow the generic reboot-mode description
found in reboot-mode.txt

Example:
	reboot-mode {
		compatible = "nvmem-reboot-mode";
		nvmem-cells = <&reboot_mode>;
		nvmem-cell-names = "reboot-mode";

		mode-normal     = <0xAAAA5501>;
		mode-bootloader = <0xBBBB5500>;
		mode-recovery   = <0xCCCC5502>;
		mode-test       = <0xDDDD5503>;
	};


code:
Microsemi Ocelot reset controller

The DEVCPU_GCB:CHIP_REGS have a SOFT_RST register that can be used to reset the
SoC core.

The reset registers are both present in the MSCC vcoreiii MIPS and
microchip Sparx5 armv8 SoC's.

Required Properties:

 - compatible: "mscc,ocelot-chip-reset", "mscc,luton-chip-reset",
   "mscc,jaguar2-chip-reset" or "microchip,sparx5-chip-reset"

Example:
	reset@1070008 {
		compatible = "mscc,ocelot-chip-reset";
		reg = <0x1070008 0x4>;
	};


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

title: Qualcomm PON Device

maintainers:
  - Vinod Koul <vkoul@kernel.org>

description: |
  The Power On device for Qualcomm PM8xxx is MFD supporting pwrkey
  and resin along with the Android reboot-mode.

  This DT node has pwrkey and resin as sub nodes.

properties:
  compatible:
    enum:
      - qcom,pm8916-pon
      - qcom,pms405-pon
      - qcom,pm8998-pon
      - qcom,pmk8350-pon

  reg:
    description: |
      Specifies the SPMI base address for the PON (power-on) peripheral.  For
      PMICs that have the PON peripheral (GEN3) split into PON_HLOS and PON_PBS
      (e.g. PMK8350), this can hold addresses of both PON_HLOS and PON_PBS
      peripherals.  In that case, the PON_PBS address needs to be specified to
      facilitate software debouncing on some PMIC.
    minItems: 1
    maxItems: 2

  reg-names:
    minItems: 1
    maxItems: 2

  pwrkey:
    type: object
    $ref: /schemas/input/qcom,pm8941-pwrkey.yaml#

  resin:
    type: object
    $ref: /schemas/input/qcom,pm8941-pwrkey.yaml#

  watchdog:
    type: object
    $ref: /schemas/watchdog/qcom,pm8916-wdt.yaml

required:
  - compatible
  - reg

unevaluatedProperties: false

allOf:
  - $ref: reboot-mode.yaml#
  - if:
      properties:
        compatible:
          contains:
            enum:
              - qcom,pm8916-pon
              - qcom,pms405-pon
              - qcom,pm8998-pon
    then:
      properties:
        reg:
          maxItems: 1
        reg-names:
          items:
            - const: pon
  - if:
      properties:
        compatible:
          contains:
            const: qcom,pmk8350-pon
    then:
      properties:
        reg:
          minItems: 1
          maxItems: 2
        reg-names:
          minItems: 1
          items:
            - const: hlos
            - const: pbs

examples:
  - |
   #include <dt-bindings/interrupt-controller/irq.h>
   #include <dt-bindings/input/linux-event-codes.h>
   #include <dt-bindings/spmi/spmi.h>
   spmi_bus: spmi@c440000 {
     reg = <0x0c440000 0x1100>;
     #address-cells = <2>;
     #size-cells = <0>;
     pmk8350: pmic@0 {
       reg = <0x0 SPMI_USID>;
       #address-cells = <1>;
       #size-cells = <0>;
       pmk8350_pon: pon_hlos@1300 {
         reg = <0x1300>;
         compatible = "qcom,pm8998-pon";

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

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


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

title: Qualcomm SoC restart and power off

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

description:
  A power supply hold (ps-hold) bit is set to power the Qualcomm chipsets.
  Clearing that bit allows us to restart/power off. The difference between
  power off and restart is determined by unique power manager IC settings.

properties:
  compatible:
    const: qcom,pshold

  reg:
    maxItems: 1

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    reset-controller@fc4ab000 {
        compatible = "qcom,pshold";
        reg = <0xfc4ab000 0x4>;
    };


code:
* QNAP Power Off

QNAP NAS devices have a microcontroller controlling the main power
supply. This microcontroller is connected to UART1 of the Kirkwood and
Orion5x SoCs. Sending the character 'A', at 19200 baud, tells the
microcontroller to turn the power off.

Synology NAS devices use a similar scheme, but a different baud rate,
9600, and a different character, '1'.

Required Properties:
- compatible: Should be "qnap,power-off" or "synology,power-off"

- reg: Address and length of the register set for UART1
- clocks: tclk clock


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

title: Generic reboot mode core map

maintainers:
  - Andy Yan <andy.yan@rock-chips.com>

description: |
  This driver get reboot mode arguments and call the write
  interface to store the magic value in special register
  or ram. Then the bootloader can read it and take different
  action according to the argument stored.

  All mode properties are vendor specific, it is a indication to tell
  the bootloader what to do when the system reboots, and should be named
  as mode-xxx = <magic> (xxx is mode name, magic should be a non-zero value).

  For example, modes common Android platform are:
    - normal: Normal reboot mode, system reboot with command "reboot".
    - recovery: Android Recovery mode, it is a mode to format the device or update a new image.
    - bootloader: Android fastboot mode, it's a mode to re-flash partitions on the Android based device.
    - loader: A bootloader mode, it's a mode used to download image on Rockchip platform,
              usually used in development.

properties:
  mode-normal:
    $ref: /schemas/types.yaml#/definitions/uint32
    description:
      Default value to set on a reboot if no command was provided.

patternProperties:
  "^mode-.*$":
    $ref: /schemas/types.yaml#/definitions/uint32

additionalProperties: true

examples:
  - |
    reboot-mode {
      mode-normal = <0>;
      mode-recovery = <1>;
      mode-bootloader = <2>;
      mode-loader = <3>;
    };
...


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

title: Force-disable power regulator to turn the power off.

maintainers:
  - Michael Klein <michael@fossekall.de>

description: |
  When the power-off handler is called, a power regulator is disabled by
  calling regulator_force_disable(). If the power is still on and the
  CPU still running after a 3000ms delay, a warning is emitted.

properties:
  compatible:
    const: regulator-poweroff

  cpu-supply:
    description:
      regulator to disable on power-down

required:
  - compatible
  - cpu-supply

additionalProperties: false

examples:
  - |
    regulator-poweroff {
        compatible = "regulator-poweroff";
        cpu-supply = <&reg_vcc1v2>;
    };
...


code:
# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/reset/restart-handler.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Restart and shutdown handler generic binding

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

description:
  Restart and shutdown handler device is responsible for powering off the
  system, e.g. my cutting off the power.  System might have several restart
  handlers, which usually are tried from most precise to last resort.

properties:
  priority:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      A priority ranging from 0 to 255 according to the following guidelines::
        0::   Restart handler of last resort, with limited restart capabilities.
        128:: Typical, default restart handler; use if no other restart handler
              is expected to be available, and/or if restart functionality is
              sufficient to restart the entire system.
        255:: Highest priority restart handler, will preempt all other restart handlers.
    minimum: 0
    maximum: 255

additionalProperties: true


code:
* Restart Power Off

Buffalo Linkstation LS-XHL and LS-CHLv2, and other devices power off
by restarting and letting u-boot keep hold of the machine until the
user presses a button.

Required Properties:
- compatible: Should be "restart-poweroff"


code:
*Device-Tree bindings for ST SW reset functionality

Required properties:
- compatible: should be "stih407-restart".
- st,syscfg: should be a phandle of the syscfg node.

Example node:
	restart {
		compatible = "st,stih407-restart";
		st,syscfg = <&syscfg_sbc_reg>;
	};


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

title: Generic SYSCON mapped register poweroff driver

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

description: |+
  This is a generic poweroff driver using syscon to map the poweroff register.
  The poweroff is generally performed with a write to the poweroff register
  defined by the register map pointed by syscon reference plus the offset
  with the value and mask defined in the poweroff node.
  Default will be little endian mode, 32 bit access only.

properties:
  compatible:
    const: syscon-poweroff

  mask:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Update only the register bits defined by the mask (32 bit).

  offset:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Offset in the register map for the poweroff register (in bytes).

  regmap:
    $ref: /schemas/types.yaml#/definitions/phandle
    description: Phandle to the register map node.

  value:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: The poweroff value written to the poweroff register (32 bit access).

required:
  - compatible
  - regmap
  - offset

additionalProperties: false

allOf:
  - if:
      not:
        required:
          - mask
    then:
      required:
        - value

examples:
  - |
    poweroff {
        compatible = "syscon-poweroff";
        regmap = <&regmapnode>;
        offset = <0x0>;
        mask = <0x7a>;
    };


code:
# SPDX-License-Identifier: GPL-2.0-only
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/reset/syscon-reboot-mode.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Generic SYSCON reboot mode driver

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

description: |
  This driver gets reboot mode magic value from reboot-mode driver
  and stores it in a SYSCON mapped register. Then the bootloader
  can read it and take different action according to the magic
  value stored. The SYSCON mapped register is retrieved from the
  parental dt-node plus the offset. So the SYSCON reboot-mode node
  should be represented as a sub-node of a "syscon", "simple-mfd" node.

properties:
  compatible:
    const: syscon-reboot-mode

  mask:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Update only the register bits defined by the mask (32 bit)

  offset:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Offset in the register map for the mode register (in bytes)

patternProperties:
  "^mode-.+":
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Vendor-specific mode value written to the mode register

additionalProperties: false

required:
  - compatible
  - offset

examples:
  - |
    #include <dt-bindings/soc/rockchip,boot-mode.h>

    reboot-mode {
      compatible = "syscon-reboot-mode";
      offset = <0x40>;
      mode-normal = <BOOT_NORMAL>;
      mode-recovery = <BOOT_RECOVERY>;
      mode-bootloader = <BOOT_FASTBOOT>;
      mode-loader = <BOOT_BL_DOWNLOAD>;
    };
...


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

title: Generic SYSCON mapped register reset driver

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

description: |+
  This is a generic reset driver using syscon to map the reset register.
  The reset is generally performed with a write to the reset register
  defined by the SYSCON register map base plus the offset with the value and
  mask defined in the reboot node. Default will be little endian mode, 32 bit
  access only. The SYSCON registers map is normally retrieved from the
  parental dt-node. So the SYSCON reboot node should be represented as a
  sub-node of a "syscon", "simple-mfd" node. Though the regmap property
  pointing to the system controller node is also supported.

properties:
  compatible:
    const: syscon-reboot

  mask:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Update only the register bits defined by the mask (32 bit).

  offset:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: Offset in the register map for the reboot register (in bytes).

  regmap:
    $ref: /schemas/types.yaml#/definitions/phandle
    deprecated: true
    description: |
      Phandle to the register map node. This property is deprecated in favor of
      the syscon-reboot node been a child of a system controller node.

  value:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: The reset value written to the reboot register (32 bit access).

required:
  - compatible
  - offset

additionalProperties: false

allOf:
  - if:
      not:
        required:
          - mask
    then:
      required:
        - value

examples:
  - |
    reboot {
        compatible = "syscon-reboot";
        regmap = <&regmapnode>;
        offset = <0x0>;
        mask = <0x1>;
    };


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

title: Xilinx Zynq MPSoC Power Management Device Tree Bindings

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

description: |
  The zynqmp-power node describes the power management configurations.
  It will control remote suspend/shutdown interfaces.

properties:
  compatible:
    const: xlnx,zynqmp-power

  interrupts:
    maxItems: 1

  mboxes:
    description: |
      Standard property to specify a Mailbox. Each value of
      the mboxes property should contain a phandle to the
      mailbox controller device node and an args specifier
      that will be the phandle to the intended sub-mailbox
      child node to be used for communication. See
      Documentation/devicetree/bindings/mailbox/mailbox.txt
      for more details about the generic mailbox controller
      and client driver bindings. Also see
      Documentation/devicetree/bindings/mailbox/ \
      xlnx,zynqmp-ipi-mailbox.txt for typical controller that
      is used to communicate with this System controllers.
    items:
      - description: tx channel
      - description: rx channel

  mbox-names:
    description:
      Name given to channels seen in the 'mboxes' property.
    items:
      - const: tx
      - const: rx

required:
  - compatible
  - interrupts

additionalProperties: false

examples:
  - |+

    // Example with interrupt method:

    firmware {
      zynqmp-firmware {
        zynqmp-power {
          compatible = "xlnx,zynqmp-power";
          interrupts = <0 35 4>;
        };
      };
    };

  - |+

    // Example with IPI mailbox method:

    firmware {
      zynqmp-firmware {
        zynqmp-power {
          compatible = "xlnx,zynqmp-power";
          interrupt-parent = <&gic>;
          interrupts = <0 35 4>;
          mboxes = <&ipi_mailbox_pmu1 0>,
                   <&ipi_mailbox_pmu1 1>;
          mbox-names = "tx", "rx";
        };
      };
    };
...


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

title: Rockchip Power Domains

maintainers:
  - Elaine Zhang <zhangqing@rock-chips.com>
  - Heiko Stuebner <heiko@sntech.de>

description: |
  Rockchip processors include support for multiple power domains
  which can be powered up/down by software based on different
  application scenarios to save power.

  Power domains contained within power-controller node are
  generic power domain providers documented in
  Documentation/devicetree/bindings/power/power-domain.yaml.

  IP cores belonging to a power domain should contain a
  "power-domains" property that is a phandle for the
  power domain node representing the domain.

properties:
  $nodename:
    const: power-controller

  compatible:
    enum:
      - rockchip,px30-power-controller
      - rockchip,rk3036-power-controller
      - rockchip,rk3066-power-controller
      - rockchip,rk3128-power-controller
      - rockchip,rk3188-power-controller
      - rockchip,rk3228-power-controller
      - rockchip,rk3288-power-controller
      - rockchip,rk3328-power-controller
      - rockchip,rk3366-power-controller
      - rockchip,rk3368-power-controller
      - rockchip,rk3399-power-controller
      - rockchip,rk3568-power-controller
      - rockchip,rk3588-power-controller
      - rockchip,rv1126-power-controller

  "#power-domain-cells":
    const: 1

  "#address-cells":
    const: 1

  "#size-cells":
    const: 0

required:
  - compatible
  - "#power-domain-cells"

additionalProperties: false

patternProperties:
  "^power-domain@[0-9a-f]+$":

    $ref: "#/$defs/pd-node"

    unevaluatedProperties: false

    properties:
      "#address-cells":
        const: 1

      "#size-cells":
        const: 0

    patternProperties:
      "^power-domain@[0-9a-f]+$":

        $ref: "#/$defs/pd-node"

        unevaluatedProperties: false

        properties:
          "#address-cells":
            const: 1

          "#size-cells":
            const: 0

        patternProperties:
          "^power-domain@[0-9a-f]+$":

            $ref: "#/$defs/pd-node"

            unevaluatedProperties: false

            properties:
              "#power-domain-cells":
                const: 0

$defs:
  pd-node:
    type: object
    description: |
      Represents the power domains within the power controller node.

    properties:
      reg:
        maxItems: 1
        description: |
          Power domain index. Valid values are defined in
          "include/dt-bindings/power/px30-power.h"
          "include/dt-bindings/power/rk3036-power.h"
          "include/dt-bindings/power/rk3066-power.h"
          "include/dt-bindings/power/rk3128-power.h"
          "include/dt-bindings/power/rk3188-power.h"
          "include/dt-bindings/power/rk3228-power.h"
          "include/dt-bindings/power/rk3288-power.h"
          "include/dt-bindings/power/rk3328-power.h"
          "include/dt-bindings/power/rk3366-power.h"
          "include/dt-bindings/power/rk3368-power.h"
          "include/dt-bindings/power/rk3399-power.h"
          "include/dt-bindings/power/rk3568-power.h"
          "include/dt-bindings/power/rk3588-power.h"
          "include/dt-bindings/power/rockchip,rv1126-power.h"

      clocks:
        minItems: 1
        maxItems: 30
        description: |
          A number of phandles to clocks that need to be enabled
          while power domain switches state.

      pm_qos:
        $ref: /schemas/types.yaml#/definitions/phandle-array
        items:
          maxItems: 1
        description: |
          A number of phandles to qos blocks which need to be saved and restored
          while power domain switches state.

      "#power-domain-cells":
        enum: [0, 1]
        description:
          Must be 0 for nodes representing a single PM domain and 1 for nodes
          providing multiple PM domains.

    required:
      - reg
      - "#power-domain-cells"

examples:
  - |
    #include <dt-bindings/clock/rk3399-cru.h>
    #include <dt-bindings/power/rk3399-power.h>

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

        qos_hdcp: qos@ffa90000 {
            compatible = "rockchip,rk3399-qos", "syscon";
            reg = <0x0 0xffa90000 0x0 0x20>;
        };

        qos_iep: qos@ffa98000 {
            compatible = "rockchip,rk3399-qos", "syscon";
            reg = <0x0 0xffa98000 0x0 0x20>;
        };

        qos_rga_r: qos@ffab0000 {
            compatible = "rockchip,rk3399-qos", "syscon";
            reg = <0x0 0xffab0000 0x0 0x20>;
        };

        qos_rga_w: qos@ffab0080 {
            compatible = "rockchip,rk3399-qos", "syscon";
            reg = <0x0 0xffab0080 0x0 0x20>;
        };

        qos_video_m0: qos@ffab8000 {
            compatible = "rockchip,rk3399-qos", "syscon";
            reg = <0x0 0xffab8000 0x0 0x20>;
        };

        qos_video_m1_r: qos@ffac0000 {
            compatible = "rockchip,rk3399-qos", "syscon";
            reg = <0x0 0xffac0000 0x0 0x20>;
        };

        qos_video_m1_w: qos@ffac0080 {
            compatible = "rockchip,rk3399-qos", "syscon";
            reg = <0x0 0xffac0080 0x0 0x20>;
        };

        power-management@ff310000 {
            compatible = "rockchip,rk3399-pmu", "syscon", "simple-mfd";
            reg = <0x0 0xff310000 0x0 0x1000>;

            power-controller {
                compatible = "rockchip,rk3399-power-controller";
                #power-domain-cells = <1>;
                #address-cells = <1>;
                #size-cells = <0>;

                /* These power domains are grouped by VD_CENTER */
                power-domain@RK3399_PD_IEP {
                    reg = <RK3399_PD_IEP>;
                    clocks = <&cru ACLK_IEP>,
                             <&cru HCLK_IEP>;
                    pm_qos = <&qos_iep>;
                    #power-domain-cells = <0>;
                };
                power-domain@RK3399_PD_RGA {
                    reg = <RK3399_PD_RGA>;
                    clocks = <&cru ACLK_RGA>,
                             <&cru HCLK_RGA>;
                    pm_qos = <&qos_rga_r>,
                             <&qos_rga_w>;
                    #power-domain-cells = <0>;
                };
                power-domain@RK3399_PD_VCODEC {
                    reg = <RK3399_PD_VCODEC>;
                    clocks = <&cru ACLK_VCODEC>,
                             <&cru HCLK_VCODEC>;
                    pm_qos = <&qos_video_m0>;
                    #power-domain-cells = <0>;
                };
                power-domain@RK3399_PD_VDU {
                    reg = <RK3399_PD_VDU>;
                    clocks = <&cru ACLK_VDU>,
                             <&cru HCLK_VDU>;
                    pm_qos = <&qos_video_m1_r>,
                             <&qos_video_m1_w>;
                    #power-domain-cells = <0>;
                };
                power-domain@RK3399_PD_VIO {
                    reg = <RK3399_PD_VIO>;
                    #power-domain-cells = <1>;
                    #address-cells = <1>;
                    #size-cells = <0>;

                    power-domain@RK3399_PD_HDCP {
                        reg = <RK3399_PD_HDCP>;
                        clocks = <&cru ACLK_HDCP>,
                                 <&cru HCLK_HDCP>,
                                 <&cru PCLK_HDCP>;
                        pm_qos = <&qos_hdcp>;
                        #power-domain-cells = <0>;
                    };
                };
            };
        };
    };


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

title: Rockchip SRAM for IO Voltage Domains

maintainers:
  - Heiko Stuebner <heiko@sntech.de>

description: |
  IO domain voltages on some Rockchip SoCs are variable but need to be
  kept in sync between the regulators and the SoC using a special
  register.

  A specific example using rk3288
    If the regulator hooked up to a pin like SDMMC0_VDD is 3.3V then
    bit 7 of GRF_IO_VSEL needs to be 0. If the regulator hooked up to
    that same pin is 1.8V then bit 7 of GRF_IO_VSEL needs to be 1.

  Said another way, this driver simply handles keeping bits in the SoCs
  General Register File (GRF) in sync with the actual value of a voltage
  hooked up to the pins.

  Note that this driver specifically does not include
    any logic for deciding what voltage we should set regulators to
    any logic for deciding whether regulators (or internal SoC blocks)
    should have power or not have power

  If there were some other software that had the smarts of making
  decisions about regulators, it would work in conjunction with this
  driver. When that other software adjusted a regulators voltage then
  this driver would handle telling the SoC about it. A good example is
  vqmmc for SD. In that case the dw_mmc driver simply is told about a
  regulator. It changes the regulator between 3.3V and 1.8V at the
  right time. This driver notices the change and makes sure that the
  SoC is on the same page.

  You specify supplies using the standard regulator bindings by including
  a phandle the relevant regulator. All specified supplies must be able
  to report their voltage. The IO Voltage Domain for any non-specified
  supplies will be not be touched.

properties:
  compatible:
    enum:
      - rockchip,px30-io-voltage-domain
      - rockchip,px30-pmu-io-voltage-domain
      - rockchip,rk3188-io-voltage-domain
      - rockchip,rk3228-io-voltage-domain
      - rockchip,rk3288-io-voltage-domain
      - rockchip,rk3328-io-voltage-domain
      - rockchip,rk3368-io-voltage-domain
      - rockchip,rk3368-pmu-io-voltage-domain
      - rockchip,rk3399-io-voltage-domain
      - rockchip,rk3399-pmu-io-voltage-domain
      - rockchip,rk3568-pmu-io-voltage-domain
      - rockchip,rv1108-io-voltage-domain
      - rockchip,rv1108-pmu-io-voltage-domain
      - rockchip,rv1126-pmu-io-voltage-domain

required:
  - compatible

unevaluatedProperties: false

allOf:
  - $ref: "#/$defs/px30"
  - $ref: "#/$defs/px30-pmu"
  - $ref: "#/$defs/rk3188"
  - $ref: "#/$defs/rk3228"
  - $ref: "#/$defs/rk3288"
  - $ref: "#/$defs/rk3328"
  - $ref: "#/$defs/rk3368"
  - $ref: "#/$defs/rk3368-pmu"
  - $ref: "#/$defs/rk3399"
  - $ref: "#/$defs/rk3399-pmu"
  - $ref: "#/$defs/rk3568-pmu"
  - $ref: "#/$defs/rv1108"
  - $ref: "#/$defs/rv1108-pmu"
  - $ref: "#/$defs/rv1126-pmu"

$defs:
  px30:
    if:
      properties:
        compatible:
          contains:
            const: rockchip,px30-io-voltage-domain

    then:
      properties:
        vccio1-supply:
          description: The supply connected to VCCIO1.
        vccio2-supply:
          description: The supply connected to VCCIO2.
        vccio3-supply:
          description: The supply connected to VCCIO3.
        vccio4-supply:
          description: The supply connected to VCCIO4.
        vccio5-supply:
          description: The supply connected to VCCIO5.
        vccio6-supply:
          description: The supply connected to VCCIO6.
        vccio-oscgpi-supply:
          description: The supply connected to VCCIO_OSCGPI.

  px30-pmu:
    if:
      properties:
        compatible:
          contains:
            const: rockchip,px30-pmu-io-voltage-domain

    then:
      properties:
        pmuio1-supply:
          description: The supply connected to PMUIO1.
        pmuio2-supply:
          description: The supply connected to PMUIO2.

  rk3188:
    if:
      properties:
        compatible:
          contains:
            const: rockchip,rk3188-io-voltage-domain

    then:
      properties:
        ap0-supply:
          description: The supply connected to AP0_VCC.
        ap1-supply:
          description: The supply connected to AP1_VCC.
        cif-supply:
          description: The supply connected to CIF_VCC.
        flash-supply:
          description: The supply connected to FLASH_VCC.
        lcdc0-supply:
          description: The supply connected to LCD0_VCC.
        lcdc1-supply:
          description: The supply connected to LCD1_VCC.
        vccio0-supply:
          description: The supply connected to VCCIO0.
        vccio1-supply:
          description: The supply connected to VCCIO1. Also labeled as VCCIO2.

  rk3228:
    if:
      properties:
        compatible:
          contains:
            const: rockchip,rk3228-io-voltage-domain

    then:
      properties:
        vccio1-supply:
          description: The supply connected to VCCIO1.
        vccio2-supply:
          description: The supply connected to VCCIO2.
        vccio3-supply:
          description: The supply connected to VCCIO3.
        vccio4-supply:
          description: The supply connected to VCCIO4.

  rk3288:
    if:
      properties:
        compatible:
          contains:
            const: rockchip,rk3288-io-voltage-domain

    then:
      properties:
        audio-supply:
          description: The supply connected to APIO4_VDD.
        bb-supply:
          description: The supply connected to APIO5_VDD.
        dvp-supply:
          description: The supply connected to DVPIO_VDD.
        flash0-supply:
          description: The supply connected to FLASH0_VDD. Typically for eMMC.
        flash1-supply:
          description: The supply connected to FLASH1_VDD. Also known as SDIO1.
        gpio30-supply:
          description: The supply connected to APIO1_VDD.
        gpio1830-supply:
          description: The supply connected to APIO2_VDD.
        lcdc-supply:
          description: The supply connected to LCDC_VDD.
        sdcard-supply:
          description: The supply connected to SDMMC0_VDD.
        wifi-supply:
          description: The supply connected to APIO3_VDD. Also known as SDIO0.

  rk3328:
    if:
      properties:
        compatible:
          contains:
            const: rockchip,rk3328-io-voltage-domain

    then:
      properties:
        vccio1-supply:
          description: The supply connected to VCCIO1.
        vccio2-supply:
          description: The supply connected to VCCIO2.
        vccio3-supply:
          description: The supply connected to VCCIO3.
        vccio4-supply:
          description: The supply connected to VCCIO4.
        vccio5-supply:
          description: The supply connected to VCCIO5.
        vccio6-supply:
          description: The supply connected to VCCIO6.
        pmuio-supply:
          description: The supply connected to VCCIO_PMU.

  rk3368:
    if:
      properties:
        compatible:
          contains:
            const: rockchip,rk3368-io-voltage-domain

    then:
      properties:
        audio-supply:
          description: The supply connected to APIO3_VDD.
        dvp-supply:
          description: The supply connected to DVPIO_VDD.
        flash0-supply:
          description: The supply connected to FLASH0_VDD. Typically for eMMC.
        gpio30-supply:
          description: The supply connected to APIO1_VDD.
        gpio1830-supply:
          description: The supply connected to APIO4_VDD.
        sdcard-supply:
          description: The supply connected to SDMMC0_VDD.
        wifi-supply:
          description: The supply connected to APIO2_VDD. Also known as SDIO0.

  rk3368-pmu:
    if:
      properties:
        compatible:
          contains:
            const: rockchip,rk3368-pmu-io-voltage-domain

    then:
      properties:
        pmu-supply:
          description: The supply connected to PMUIO_VDD.
        vop-supply:
          description: The supply connected to LCDC_VDD.

  rk3399:
    if:
      properties:
        compatible:
          contains:
            const: rockchip,rk3399-io-voltage-domain

    then:
      properties:
        audio-supply:
          description: The supply connected to APIO5_VDD.
        bt656-supply:
          description: The supply connected to APIO2_VDD.
        gpio1830-supply:
          description: The supply connected to APIO4_VDD.
        sdmmc-supply:
          description: The supply connected to SDMMC0_VDD.

  rk3399-pmu:
    if:
      properties:
        compatible:
          contains:
            const: rockchip,rk3399-pmu-io-voltage-domain

    then:
      properties:
        pmu1830-supply:
          description: The supply connected to PMUIO2_VDD.

  rk3568-pmu:
    if:
      properties:
        compatible:
          contains:
            const: rockchip,rk3568-pmu-io-voltage-domain

    then:
      properties:
        pmuio1-supply:
          description: The supply connected to PMUIO1.
        pmuio2-supply:
          description: The supply connected to PMUIO2.
        vccio1-supply:
          description: The supply connected to VCCIO1.
        vccio2-supply:
          description: The supply connected to VCCIO2.
        vccio3-supply:
          description: The supply connected to VCCIO3.
        vccio4-supply:
          description: The supply connected to VCCIO4.
        vccio5-supply:
          description: The supply connected to VCCIO5.
        vccio6-supply:
          description: The supply connected to VCCIO6.
        vccio7-supply:
          description: The supply connected to VCCIO7.

  rv1108:
    if:
      properties:
        compatible:
          contains:
            const: rockchip,rv1108-io-voltage-domain

    then:
      properties:
        vccio1-supply:
          description: The supply connected to APIO1_VDD.
        vccio2-supply:
          description: The supply connected to APIO2_VDD.
        vccio3-supply:
          description: The supply connected to APIO3_VDD.
        vccio5-supply:
          description: The supply connected to APIO5_VDD.
        vccio6-supply:
          description: The supply connected to APIO6_VDD.

  rv1108-pmu:
    if:
      properties:
        compatible:
          contains:
            const: rockchip,rv1108-pmu-io-voltage-domain

    then:
      properties:
        pmu-supply:
          description: The supply connected to PMUIO_VDD.

  rv1126-pmu:
    if:
      properties:
        compatible:
          contains:
            const: rockchip,rv1126-pmu-io-voltage-domain

    then:
      properties:
        vccio1-supply:
          description: The supply connected to VCCIO1.
        vccio2-supply:
          description: The supply connected to VCCIO2.
        vccio3-supply:
          description: The supply connected to VCCIO3.
        vccio4-supply:
          description: The supply connected to VCCIO4.
        vccio5-supply:
          description: The supply connected to VCCIO5.
        vccio6-supply:
          description: The supply connected to VCCIO6.
        vccio7-supply:
          description: The supply connected to VCCIO7.
        pmuio0-supply:
          description: The supply connected to PMUIO0.
        pmuio1-supply:
          description: The supply connected to PMUIO1.

examples:
  - |
    io-domains {
      compatible = "rockchip,rk3288-io-voltage-domain";
      audio-supply = <&vcc18_codec>;
      bb-supply = <&vcc33_io>;
      dvp-supply = <&vcc_18>;
      flash0-supply = <&vcc18_flashio>;
      gpio1830-supply = <&vcc33_io>;
      gpio30-supply = <&vcc33_pmuio>;
      lcdc-supply = <&vcc33_lcd>;
      sdcard-supply = <&vccio_sd>;
      wifi-supply = <&vcc18_wl>;
    };


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/active-semi,act8945a-charger.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Active-semi ACT8945A Charger Function

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

allOf:
  - $ref: power-supply.yaml#

properties:
  compatible:
    const: active-semi,act8945a-charger

  interrupts:
    maxItems: 1

  active-semi,chglev-gpios:
    maxItems: 1
    description: charge current level GPIO

  active-semi,lbo-gpios:
    maxItems: 1
    description: low battery voltage detect GPIO

  active-semi,input-voltage-threshold-microvolt:
    description: |
      Specifies the charger's input over-voltage threshold value.
      Despite the name, specified values are in millivolt (mV).
      Defaults to 6.6 V
    enum: [ 6600, 7000, 7500, 8000 ]

  active-semi,precondition-timeout:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      Specifies the charger's PRECONDITION safety timer setting value in minutes.
      If 0, it means to disable this timer.
      Defaults to 40 minutes.
    enum: [ 0, 40, 60, 80 ]

  active-semi,total-timeout:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      Specifies the charger's total safety timer setting value in hours;
      If 0, it means to disable this timer;
      Defaults to 3 hours.
    enum: [ 0, 3, 4, 5 ]

required:
  - compatible
  - interrupts
  - active-semi,chglev-gpios
  - active-semi,lbo-gpios

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>
    pmic {
      charger {
        compatible = "active-semi,act8945a-charger";
        interrupt-parent = <&pioA>;
        interrupts = <45 IRQ_TYPE_LEVEL_LOW>;
        active-semi,chglev-gpios = <&pioA 12 GPIO_ACTIVE_HIGH>;
        active-semi,lbo-gpios = <&pioA 72 GPIO_ACTIVE_LOW>;
        active-semi,input-voltage-threshold-microvolt = <6600>;
        active-semi,precondition-timeout = <40>;
        active-semi,total-timeout = <3>;
      };
    };


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

title: Battery Characteristics

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

description: |
  The devicetree battery node provides static battery characteristics.
  In smart batteries, these are typically stored in non-volatile memory
  on a fuel gauge chip. The battery node should be used where there is
  no appropriate non-volatile memory, or it is unprogrammed/incorrect.

  Upstream dts files should not include battery nodes, unless the battery
  represented cannot easily be replaced in the system by one of a
  different type. This prevents unpredictable, potentially harmful,
  behavior should a replacement that changes the battery type occur
  without a corresponding update to the dtb.

  Battery properties are named, where possible, for the corresponding elements
  in enum power_supply_property, defined in include/linux/power_supply.h

  Batteries must be referenced by chargers and/or fuel-gauges using a phandle.
  The phandle's property should be named "monitored-battery".

properties:
  compatible:
    const: simple-battery

  device-chemistry:
    description: This describes the chemical technology of the battery.
    oneOf:
      - const: nickel-cadmium
      - const: nickel-metal-hydride
      - const: lithium-ion
        description: This is a blanket type for all lithium-ion batteries,
          including those below. If possible, a precise compatible string
          from below should be used, but sometimes it is unknown which specific
          lithium ion battery is employed and this wide compatible can be used.
      - const: lithium-ion-polymer
      - const: lithium-ion-iron-phosphate
      - const: lithium-ion-manganese-oxide

  over-voltage-threshold-microvolt:
    description: battery over-voltage limit

  re-charge-voltage-microvolt:
    description: limit to automatically start charging again

  voltage-min-design-microvolt:
    description: drained battery voltage

  voltage-max-design-microvolt:
    description: fully charged battery voltage

  energy-full-design-microwatt-hours:
    description: battery design energy

  charge-full-design-microamp-hours:
    description: battery design capacity

  trickle-charge-current-microamp:
    description: current for trickle-charge phase

  precharge-current-microamp:
    description: current for pre-charge phase

  precharge-upper-limit-microvolt:
    description: limit when to change to constant charging

  charge-term-current-microamp:
    description: current for charge termination phase

  constant-charge-current-max-microamp:
    description: maximum constant input current

  constant-charge-voltage-max-microvolt:
    description: maximum constant input voltage

  factory-internal-resistance-micro-ohms:
    description: battery factory internal resistance

  resistance-temp-table:
    $ref: /schemas/types.yaml#/definitions/uint32-matrix
    items:
      items:
        - description: the temperature in degree Celsius
        - description: battery internal resistance percent
    description: |
      A table providing the temperature in degree Celsius
      and corresponding battery internal resistance percent, which is used to
      look up the resistance percent according to current temperature to get an
      accurate batterty internal resistance in different temperatures.

  ocv-capacity-celsius:
    description: |
      An array containing the temperature in degree Celsius,
      for each of the battery capacity lookup table.

  operating-range-celsius:
    description: operating temperature range of a battery
    items:
      - description: minimum temperature at which battery can operate
      - description: maximum temperature at which battery can operate

  ambient-celsius:
    description: safe range of ambient temperature
    items:
      - description: alert when ambient temperature is lower than this value
      - description: alert when ambient temperature is higher than this value

  alert-celsius:
    description: safe range of battery temperature
    items:
      - description: alert when battery temperature is lower than this value
      - description: alert when battery temperature is higher than this value

required:
  - compatible

patternProperties:
  '^ocv-capacity-table-[0-9]+$':
    $ref: /schemas/types.yaml#/definitions/uint32-matrix
    description: |
      An array providing the open circuit voltage (OCV)
      of the battery and corresponding battery capacity percent, which is used
      to look up battery capacity according to current OCV value. And the open
      circuit voltage unit is microvolt.
    maxItems: 100
    items:
      items:
        - description: open circuit voltage (OCV) in microvolts
        - description: battery capacity percent
          maximum: 100

additionalProperties: false

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

      battery: battery {
        compatible = "simple-battery";
        over-voltage-threshold-microvolt = <4500000>;
        re-charge-voltage-microvolt = <250000>;
        voltage-min-design-microvolt = <3200000>;
        voltage-max-design-microvolt = <4200000>;
        energy-full-design-microwatt-hours = <5290000>;
        charge-full-design-microamp-hours = <1430000>;
        precharge-current-microamp = <256000>;
        precharge-upper-limit-microvolt = <2500000>;
        charge-term-current-microamp = <128000>;
        constant-charge-current-max-microamp = <900000>;
        constant-charge-voltage-max-microvolt = <4200000>;
        factory-internal-resistance-micro-ohms = <250000>;
        ocv-capacity-celsius = <(-10) 0 10>;
        /* table for -10 degree Celsius */
        ocv-capacity-table-0 = <4185000 100>, <4113000 95>, <4066000 90>;
        /* table for 0 degree Celsius */
        ocv-capacity-table-1 = <4200000 100>, <4185000 95>, <4113000 90>;
        /* table for 10 degree Celsius */
        ocv-capacity-table-2 = <4250000 100>, <4200000 95>, <4185000 90>;
        resistance-temp-table = <20 100>, <10 90>, <0 80>, <(-10) 60>;
        operating-range-celsius = <(-30) 50>;
        ambient-celsius = <(-5) 50>;
        alert-celsius = <0 40>;
      };

      charger@11 {
        reg = <0x11>;
        monitored-battery = <&battery>;
      };

      fuel-gauge@22 {
        reg = <0x22>;
        monitored-battery = <&battery>;
      };
    };


code:
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2021 Sebastian Reichel
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/bq2415x.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Binding for TI bq2415x Li-Ion Charger

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

allOf:
  - $ref: power-supply.yaml#

properties:
  compatible:
    enum:
      - ti,bq24150
      - ti,bq24150a
      - ti,bq24151
      - ti,bq24151a
      - ti,bq24152
      - ti,bq24153
      - ti,bq24153a
      - ti,bq24155
      - ti,bq24156
      - ti,bq24156a
      - ti,bq24158

  reg:
    maxItems: 1

  ti,current-limit:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: initial maximum current charger can pull from power supply in mA.

  ti,weak-battery-voltage:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      weak battery voltage threshold in mV.
      The chip will use slow precharge if battery voltage is below this value.

  ti,battery-regulation-voltage:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: maximum charging voltage in mV.

  ti,charge-current:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: maximum charging current in mA.

  ti,termination-current:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      charge will be terminated when current in constant-voltage phase drops
      below this value (in mA).

  ti,resistor-sense:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: value of sensing resistor in milliohm.

  ti,usb-charger-detection:
    $ref: /schemas/types.yaml#/definitions/phandle
    description: phandle to usb charger detection device (required for auto mode)

required:
  - compatible
  - reg
  - ti,current-limit
  - ti,weak-battery-voltage
  - ti,battery-regulation-voltage
  - ti,charge-current
  - ti,termination-current
  - ti,resistor-sense

additionalProperties: false

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

      charger@6b {
        compatible = "ti,bq24150a";
        reg = <0x6b>;

        ti,current-limit = <100>;
        ti,weak-battery-voltage = <3400>;
        ti,battery-regulation-voltage = <4200>;
        ti,charge-current = <650>;
        ti,termination-current = <100>;
        ti,resistor-sense = <68>;

        ti,usb-charger-detection = <&isp1704>;
      };
    };


code:
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2021 Sebastian Reichel
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/bq24190.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Binding for TI BQ2419x Li-Ion Battery Charger

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

allOf:
  - $ref: power-supply.yaml#

properties:
  compatible:
    enum:
      - ti,bq24190
      - ti,bq24192
      - ti,bq24192i
      - ti,bq24196

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  usb-otg-vbus:
    $ref: /schemas/regulator/regulator.yaml#
    description: |
      Regulator that is used to control the VBUS voltage direction for
      either USB host mode or for charging on the OTG port

  ti,system-minimum-microvolt:
    description: |
      when power is connected and the battery is below minimum system voltage,
      the system will be regulated above this setting.

  omit-battery-class:
    type: boolean
    description: |
      If this property is set, the operating system does not try to create a
      battery device.

  monitored-battery:
    $ref: /schemas/types.yaml#/definitions/phandle
    description: |
      phandle to a "simple-battery" compatible node.

      This property must be a phandle to a node using the format described
      in battery.yaml, with the following properties being required:
      - precharge-current-microamp: maximum charge current during precharge phase
                                    (typically 20% of battery capacity).
      - charge-term-current-microamp: a charge cycle terminates when the battery voltage is
                                      above recharge threshold, and the current is below this
                                      setting (typically 10% of battery capacity).

required:
  - compatible
  - reg
  - interrupts

additionalProperties: false

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

    bat: battery {
      compatible = "simple-battery";
      precharge-current-microamp = <256000>;
      charge-term-current-microamp = <128000>;
    };

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

      charger@6a {
        compatible = "ti,bq24190";
        reg = <0x6a>;
        interrupt-parent = <&gpiochip>;
        interrupts = <10 IRQ_TYPE_EDGE_FALLING>;
        monitored-battery = <&bat>;
        ti,system-minimum-microvolt = <3200000>;

        usb_otg_vbus: usb-otg-vbus { };
      };
    };


code:
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2021 Sebastian Reichel
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/bq24257.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Binding for bq24250, bq24251 and bq24257 Li-Ion Charger

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

allOf:
  - $ref: power-supply.yaml#

properties:
  compatible:
    enum:
      - ti,bq24250
      - ti,bq24251
      - ti,bq24257

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  ti,battery-regulation-voltage:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: maximum charging voltage in uV

  ti,charge-current:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: maximum charging current in uA

  ti,termination-current:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      charge will be terminated when current in constant-voltage phase
      drops below this value (in uA)

  pg-gpios:
    description: |
      GPIO used for connecting the bq2425x device PG (Power Good) pin.
      This pin is not available on all devices however it should be used if
      possible as this is the recommended way to obtain the charger's input PG
      state. If this pin is not specified a software-based approach for PG
      detection is used.
    maxItems: 1

  ti,current-limit:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      The maximum current to be drawn from the charger's input (in uA).
      If this property is not specified, the input limit current is set
      automatically using USB D+/D- signal based charger type detection.
      If the hardware does not support the D+/D- based detection, a default
      of 500,000 is used (=500mA) instead.

  ti,ovp-voltage:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      Configures the over voltage protection voltage (in uV).
      If not specified a default of 6,5000,000 (=6.5V) is used.

  ti,in-dpm-voltage:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      Configures the threshold input voltage for the dynamic power path management (in uV).
      If not specified a default of 4,360,000 (=4.36V) is used.

required:
  - compatible
  - reg
  - interrupts
  - ti,battery-regulation-voltage
  - ti,charge-current
  - ti,termination-current

additionalProperties: false

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

      charger@6a {
        compatible = "ti,bq24257";
        reg = <0x6a>;
        interrupt-parent = <&gpio1>;
        interrupts = <16 IRQ_TYPE_EDGE_BOTH>;

        pg-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;

        ti,battery-regulation-voltage = <4200000>;
        ti,charge-current = <1000000>;
        ti,termination-current = <50000>;
      };
    };
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>
    i2c0 {
      #address-cells = <1>;
      #size-cells = <0>;

      charger@6a {
        compatible = "ti,bq24250";
        reg = <0x6a>;
        interrupt-parent = <&gpio1>;
        interrupts = <16 IRQ_TYPE_EDGE_BOTH>;

        ti,battery-regulation-voltage = <4200000>;
        ti,charge-current = <500000>;
        ti,termination-current = <50000>;
        ti,current-limit = <900000>;
        ti,ovp-voltage = <9500000>;
        ti,in-dpm-voltage = <4440000>;
      };
    };


code:
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2021 Sebastian Reichel
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/bq24735.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Binding for TI BQ24735 Li-Ion Battery Charger

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

allOf:
  - $ref: power-supply.yaml#

properties:
  compatible:
    const: ti,bq24735

  reg:
    maxItems: 1

  interrupts:
    description: AC adapter plug event interrupt
    maxItems: 1

  ti,ac-detect-gpios:
    maxItems: 1
    description: |
      This GPIO is optionally used to read the AC adapter status. This is a Host GPIO
      that is configured as an input and connected to the ACOK pin on the bq24735.
      Note: for backwards compatibility reasons, the GPIO must be active on AC adapter
      absence despite ACOK being active (high) on AC adapter presence.

  ti,charge-current:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      Used to control and set the charging current.
      This value must be between 128mA and 8.128A with a 64mA step resolution.
      The POR value is 0x0000h. This number is in mA (e.g. 8192).
      See spec for more information about the ChargeCurrent (0x14h) register.

  ti,charge-voltage:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      Used to control and set the charging voltage.
      This value must be between 1.024V and 19.2V with a 16mV step resolution.
      The POR value is 0x0000h. This number is in mV (e.g. 19200).
      See spec for more information about the ChargeVoltage (0x15h) register.

  ti,input-current:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      Used to control and set the charger input current.
      This value must be between 128mA and 8.064A with a 128mA step resolution.
      The POR value is 0x1000h. This number is in mA (e.g. 8064).
      See the spec for more information about the InputCurrent (0x3fh) register.

  ti,external-control:
    type: boolean
    description: |
      Indicates that the charger is configured externally and that the host should not
      attempt to enable/disable charging or set the charge voltage/current.

  poll-interval:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      If 'interrupts' is not specified, poll AC adapter presence with this interval (milliseconds).

required:
  - compatible
  - reg

additionalProperties: false

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

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

      charger@9 {
        compatible = "ti,bq24735";
        reg = <0x9>;
        ti,ac-detect-gpios = <&gpio 72 0x1>;
      };
    };


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
# Copyright (C) 2020 Texas Instruments Incorporated
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/supply/bq2515x.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: TI bq2515x 500-mA Linear charger family

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

description: |
  The BQ2515x family is a highly integrated battery charge management IC that
  integrates the most common functions for wearable devices, namely a charger,
  an output voltage rail, ADC for battery and system monitoring, and
  push-button controller.

  Specifications about the charger can be found at:
    http://www.ti.com/lit/ds/symlink/bq25150.pdf
    http://www.ti.com/lit/ds/symlink/bq25155.pdf

properties:
  compatible:
    enum:
      - ti,bq25150
      - ti,bq25155

  reg:
    maxItems: 1
    description: I2C address of the charger.

  ac-detect-gpios:
    description: |
       GPIO used for connecting the bq2515x device PG (AC Detect)
       pin.
    maxItems: 1

  reset-gpios:
    description: GPIO used for hardware reset.
    maxItems: 1

  powerdown-gpios:
    description: GPIO used for low power mode of IC.
    maxItems: 1

  charge-enable-gpios:
    description: GPIO used to turn on and off charging.
    maxItems: 1

  input-current-limit-microamp:
    description: Maximum input current in micro Amps.
    minimum: 50000
    maximum: 500000

  monitored-battery:
    $ref: /schemas/types.yaml#/definitions/phandle
    description: phandle to the battery node being monitored

required:
  - compatible
  - reg
  - monitored-battery

additionalProperties: false

examples:
  - |
    bat: battery {
      compatible = "simple-battery";
      constant-charge-current-max-microamp = <50000>;
      precharge-current-microamp = <2500>;
      constant-charge-voltage-max-microvolt = <4000000>;
    };
    #include <dt-bindings/gpio/gpio.h>
    i2c0 {
      #address-cells = <1>;
      #size-cells = <0>;

      bq25150: charger@6b {
        compatible = "ti,bq25150";
        reg = <0x6b>;
        monitored-battery = <&bat>;
        input-current-limit-microamp = <100000>;

        ac-detect-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
        reset-gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
        powerdown-gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
        charge-enable-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
      };
    };