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

title: Texas Instruments TPS65023 Regulator

maintainers:
  - Eduard Bostina <egbostina@gmail.com>

properties:
  compatible:
    enum:
      - ti,tps65020
      - ti,tps65021
      - ti,tps65023

  reg:
    maxItems: 1

  regulators:
    type: object
    description: >
      List of child nodes that specify the regulator initialization data.
      Must be named after their hardware counterparts: VDCDC[1-3] and LDO[1-2].

    patternProperties:
      "^(VDCDC[1-3]|LDO[1-2])$":
        type: object
        $ref: regulator.yaml#
        unevaluatedProperties: false

    additionalProperties: false

required:
  - compatible
  - reg
  - regulators

additionalProperties: false

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

        tps65023@48 {
            compatible = "ti,tps65023";
            reg = <0x48>;

            regulators {
                VDCDC1 {
                    regulator-name = "vdd_mpu";
                    regulator-always-on;
                    regulator-min-microvolt = <1200000>;
                    regulator-max-microvolt = <1200000>;
                };

                VDCDC2 {
                    regulator-name = "vdd_core";
                    regulator-always-on;
                    regulator-min-microvolt = <3300000>;
                    regulator-max-microvolt = <3300000>;
                };

                VDCDC3 {
                    regulator-name = "vdd_io";
                    regulator-always-on;
                    regulator-min-microvolt = <1800000>;
                    regulator-max-microvolt = <1800000>;
                };

                LDO1 {
                    regulator-name = "vdd_usb18";
                    regulator-always-on;
                    regulator-min-microvolt = <1800000>;
                    regulator-max-microvolt = <1800000>;
                };

                LDO2 {
                    regulator-name = "vdd_usb33";
                    regulator-always-on;
                    regulator-min-microvolt = <3300000>;
                    regulator-max-microvolt = <3300000>;
                };
            };
        };
    };