[PATCH v5 3/8] dt-bindings: regulator: Document MediaTek MT6363 PMIC Regulators

AngeloGioacchino Del Regno posted 8 patches 2 months, 3 weeks ago
There is a newer version of this series
[PATCH v5 3/8] dt-bindings: regulator: Document MediaTek MT6363 PMIC Regulators
Posted by AngeloGioacchino Del Regno 2 months, 3 weeks ago
Add bindings for the regulators found in the MediaTek MT6363 PMIC,
usually found in board designs using the MT6991 Dimensity 9400 and
on MT8196 Kompanio SoC for Chromebooks, along with the MT6316 and
MT6373 PMICs.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 .../regulator/mediatek,mt6363-regulator.yaml  | 193 ++++++++++++++++++
 1 file changed, 193 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/mediatek,mt6363-regulator.yaml

diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6363-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6363-regulator.yaml
new file mode 100644
index 000000000000..ea1f6c92cffc
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6363-regulator.yaml
@@ -0,0 +1,193 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/mediatek,mt6363-regulator.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek MT6363 PMIC Regulators
+
+maintainers:
+  - AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
+
+description:
+  The MT6363 SPMI PMIC provides 10 BUCK and 25 LDO (Low DropOut) regulators
+  and can optionally provide overcurrent warnings with one ocp interrupt
+  for each voltage regulator.
+
+properties:
+  compatible:
+    const: mediatek,mt6363-regulator
+
+  reg:
+    maxItems: 1
+
+  vsys-vbuck1-supply:
+    description: Input supply for vbuck1
+  vsys-vbuck2-supply:
+    description: Input supply for vbuck2
+  vsys-vbuck3-supply:
+    description: Input supply for vbuck3
+  vsys-vbuck4-supply:
+    description: Input supply for vbuck4
+  vsys-vbuck5-supply:
+    description: Input supply for vbuck5
+  vsys-vbuck6-supply:
+    description: Input supply for vbuck6
+  vsys-vbuck7-supply:
+    description: Input supply for vbuck7
+  vsys-vs1-supply:
+    description: Input supply for vs1
+  vsys-vs2-supply:
+    description: Input supply for vs2
+  vsys-vs3-supply:
+    description: Input supply for vs3
+  vs1-ldo1-supply:
+    description: Input supply for va15, vio0p75, vm18, vrf18, vrf-io18
+  vs1-ldo2-supply:
+    description: Input supply for vcn15, vio18, vufs18
+  vs2-ldo1-supply:
+    description: Input supply for vsram-cpub, vsram-cpum, vrf12, vrf13, vufs12
+  vs2-ldo2-supply:
+    description: Input supply for va12-1, va12-2, vcn13, vsram-cpul
+  vs3-ldo1-supply:
+    description: Input supply for vsram-apu, vsram-digrf, vsram-mdfe
+  vs3-ldo2-supply:
+    description: Input supply for vsram-modem, vrf0p9
+  vsys-ldo1-supply:
+    description: Input supply for vaux18, vemc, vtref18
+
+patternProperties:
+  "^v(buck[1-7]|s[1-3])$":
+    description: Buck regulators
+    type: object
+    $ref: regulator.yaml#
+    properties:
+      regulator-allowed-modes:
+        description: |
+          Allowed Buck regulator operating modes allowed. Valid values below.
+            0 - Normal mode with automatic power saving, reducing the switching
+                frequency when light load conditions are detected
+            1 - Forced Continuous Conduction mode (FCCM) for improved voltage
+                regulation accuracy with constant switching frequency but lower
+                regulator efficiency
+            2 - Forced Low Power mode for improved regulator efficiency, used
+                when no heavy load is expected, does not limit the maximum out
+                current but unless only a light load is applied, there will be
+                regulation accuracy and efficiency losses.
+            3 - Forced Ultra Low Power mode for ultra low load, this greatly
+                reduces the maximum output power, makes the regulator to be
+                efficient only for ultra light load, and greatly reduces the
+                quiescent current (Iq) of the buck.
+        maxItems: 3
+        items:
+          enum: [ 0, 1, 2, 3 ]
+    unevaluatedProperties: false
+
+  "^va(12-1|12-2|15)$":
+    type: object
+    $ref: regulator.yaml#
+    properties:
+      regulator-allowed-modes:
+        description: |
+          Allowed LDO regulator operating modes allowed. Valid values below.
+            0 - Normal mode with automatic power saving, reducing the switching
+                frequency when light load conditions are detected
+            2 - Forced Low Power mode for improved regulator efficiency, used
+                when no heavy load is expected, does not limit the maximum out
+                current but unless only a light load is applied, there will be
+                regulation accuracy and efficiency losses.
+        maxItems: 2
+        items:
+          enum: [ 0, 2 ]
+    unevaluatedProperties: false
+
+  "^v(aux|m|rf-io|tref)18$":
+    type: object
+    $ref: regulator.yaml#
+    properties:
+      regulator-allowed-modes:
+        maxItems: 2
+        items:
+          enum: [ 0, 2 ]
+    unevaluatedProperties: false
+
+  "^v(cn13|cn15|emc)$":
+    type: object
+    $ref: regulator.yaml#
+    properties:
+      regulator-allowed-modes:
+        maxItems: 2
+        items:
+          enum: [ 0, 2 ]
+    unevaluatedProperties: false
+
+  "^vio(0p75|18)$":
+    type: object
+    $ref: regulator.yaml#
+    properties:
+      regulator-allowed-modes:
+        maxItems: 2
+        items:
+          enum: [ 0, 2 ]
+    unevaluatedProperties: false
+
+  "^vrf(0p9|12|13|18)$":
+    type: object
+    $ref: regulator.yaml#
+    properties:
+      regulator-allowed-modes:
+        maxItems: 2
+        items:
+          enum: [ 0, 2 ]
+    unevaluatedProperties: false
+
+  "^vsram-(apu|cpub|cpum|cpul|digrf|mdfe|modem)$":
+    type: object
+    $ref: regulator.yaml#
+    properties:
+      regulator-allowed-modes:
+        maxItems: 2
+        items:
+          enum: [ 0, 2 ]
+    unevaluatedProperties: false
+
+  "^vufs(12|18)$":
+    type: object
+    $ref: regulator.yaml#
+    properties:
+      regulator-allowed-modes:
+        maxItems: 2
+        items:
+          enum: [ 0, 2 ]
+    unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    pmic {
+      interrupt-controller;
+      #address-cells = <1>;
+      #interrupt-cells = <3>;
+
+      regulators@30 {
+        compatible = "mediatek,mt6363-regulator";
+        reg = <0x
+
+        vio18 {
+          regulator-name = "pp1800-vio18-s3";
+          regulator-min-microvolt = <1800000>;
+          regulator-max-microvolt = <1800000>;
+          regulator-allowed-modes = <0 2>;
+          regulator-allow-set-load;
+          regulator-over-current-protection;
+        };
+      };
+    };
+...
-- 
2.50.1
Re: [PATCH v5 3/8] dt-bindings: regulator: Document MediaTek MT6363 PMIC Regulators
Posted by Rob Herring 2 months, 3 weeks ago
On Tue, Jul 15, 2025 at 04:02:19PM +0200, AngeloGioacchino Del Regno wrote:
> Add bindings for the regulators found in the MediaTek MT6363 PMIC,
> usually found in board designs using the MT6991 Dimensity 9400 and
> on MT8196 Kompanio SoC for Chromebooks, along with the MT6316 and
> MT6373 PMICs.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  .../regulator/mediatek,mt6363-regulator.yaml  | 193 ++++++++++++++++++
>  1 file changed, 193 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/regulator/mediatek,mt6363-regulator.yaml
> 
> diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6363-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6363-regulator.yaml
> new file mode 100644
> index 000000000000..ea1f6c92cffc
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6363-regulator.yaml
> @@ -0,0 +1,193 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/regulator/mediatek,mt6363-regulator.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: MediaTek MT6363 PMIC Regulators
> +
> +maintainers:
> +  - AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> +
> +description:
> +  The MT6363 SPMI PMIC provides 10 BUCK and 25 LDO (Low DropOut) regulators
> +  and can optionally provide overcurrent warnings with one ocp interrupt
> +  for each voltage regulator.
> +
> +properties:
> +  compatible:
> +    const: mediatek,mt6363-regulator
> +
> +  reg:
> +    maxItems: 1
> +
> +  vsys-vbuck1-supply:
> +    description: Input supply for vbuck1

blank line

> +  vsys-vbuck2-supply:
> +    description: Input supply for vbuck2

blank line, and so on...

> +  vsys-vbuck3-supply:
> +    description: Input supply for vbuck3
> +  vsys-vbuck4-supply:
> +    description: Input supply for vbuck4
> +  vsys-vbuck5-supply:
> +    description: Input supply for vbuck5
> +  vsys-vbuck6-supply:
> +    description: Input supply for vbuck6
> +  vsys-vbuck7-supply:
> +    description: Input supply for vbuck7
> +  vsys-vs1-supply:
> +    description: Input supply for vs1
> +  vsys-vs2-supply:
> +    description: Input supply for vs2
> +  vsys-vs3-supply:
> +    description: Input supply for vs3
> +  vs1-ldo1-supply:
> +    description: Input supply for va15, vio0p75, vm18, vrf18, vrf-io18
> +  vs1-ldo2-supply:
> +    description: Input supply for vcn15, vio18, vufs18
> +  vs2-ldo1-supply:
> +    description: Input supply for vsram-cpub, vsram-cpum, vrf12, vrf13, vufs12
> +  vs2-ldo2-supply:
> +    description: Input supply for va12-1, va12-2, vcn13, vsram-cpul
> +  vs3-ldo1-supply:
> +    description: Input supply for vsram-apu, vsram-digrf, vsram-mdfe
> +  vs3-ldo2-supply:
> +    description: Input supply for vsram-modem, vrf0p9
> +  vsys-ldo1-supply:
> +    description: Input supply for vaux18, vemc, vtref18
> +
> +patternProperties:
> +  "^v(buck[1-7]|s[1-3])$":
> +    description: Buck regulators
> +    type: object
> +    $ref: regulator.yaml#
> +    properties:
> +      regulator-allowed-modes:
> +        description: |
> +          Allowed Buck regulator operating modes allowed. Valid values below.
> +            0 - Normal mode with automatic power saving, reducing the switching
> +                frequency when light load conditions are detected
> +            1 - Forced Continuous Conduction mode (FCCM) for improved voltage
> +                regulation accuracy with constant switching frequency but lower
> +                regulator efficiency
> +            2 - Forced Low Power mode for improved regulator efficiency, used
> +                when no heavy load is expected, does not limit the maximum out
> +                current but unless only a light load is applied, there will be
> +                regulation accuracy and efficiency losses.
> +            3 - Forced Ultra Low Power mode for ultra low load, this greatly
> +                reduces the maximum output power, makes the regulator to be
> +                efficient only for ultra light load, and greatly reduces the
> +                quiescent current (Iq) of the buck.
> +        maxItems: 3
> +        items:
> +          enum: [ 0, 1, 2, 3 ]
> +    unevaluatedProperties: false

Move this after $ref.

> +
> +  "^va(12-1|12-2|15)$":
> +    type: object
> +    $ref: regulator.yaml#
> +    properties:
> +      regulator-allowed-modes:
> +        description: |
> +          Allowed LDO regulator operating modes allowed. Valid values below.
> +            0 - Normal mode with automatic power saving, reducing the switching
> +                frequency when light load conditions are detected
> +            2 - Forced Low Power mode for improved regulator efficiency, used
> +                when no heavy load is expected, does not limit the maximum out
> +                current but unless only a light load is applied, there will be
> +                regulation accuracy and efficiency losses.
> +        maxItems: 2
> +        items:
> +          enum: [ 0, 2 ]
> +    unevaluatedProperties: false
> +
> +  "^v(aux|m|rf-io|tref)18$":
> +    type: object
> +    $ref: regulator.yaml#
> +    properties:
> +      regulator-allowed-modes:
> +        maxItems: 2
> +        items:
> +          enum: [ 0, 2 ]
> +    unevaluatedProperties: false
> +
> +  "^v(cn13|cn15|emc)$":
> +    type: object
> +    $ref: regulator.yaml#
> +    properties:
> +      regulator-allowed-modes:
> +        maxItems: 2
> +        items:
> +          enum: [ 0, 2 ]
> +    unevaluatedProperties: false
> +
> +  "^vio(0p75|18)$":
> +    type: object
> +    $ref: regulator.yaml#
> +    properties:
> +      regulator-allowed-modes:
> +        maxItems: 2
> +        items:
> +          enum: [ 0, 2 ]
> +    unevaluatedProperties: false
> +
> +  "^vrf(0p9|12|13|18)$":
> +    type: object
> +    $ref: regulator.yaml#
> +    properties:
> +      regulator-allowed-modes:
> +        maxItems: 2
> +        items:
> +          enum: [ 0, 2 ]
> +    unevaluatedProperties: false
> +
> +  "^vsram-(apu|cpub|cpum|cpul|digrf|mdfe|modem)$":
> +    type: object
> +    $ref: regulator.yaml#
> +    properties:
> +      regulator-allowed-modes:
> +        maxItems: 2
> +        items:
> +          enum: [ 0, 2 ]
> +    unevaluatedProperties: false
> +
> +  "^vufs(12|18)$":
> +    type: object
> +    $ref: regulator.yaml#
> +    properties:
> +      regulator-allowed-modes:
> +        maxItems: 2
> +        items:
> +          enum: [ 0, 2 ]
> +    unevaluatedProperties: false

A lot of duplication here. Either combine the regex's to 1 entry or add 
a $defs entry and make all of these a 1 line $ref.

> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>

I thought I said this already, but drop the example here. 1 complete 
example in the mfd schema only.

> +
> +    pmic {
> +      interrupt-controller;
> +      #address-cells = <1>;
> +      #interrupt-cells = <3>;
> +
> +      regulators@30 {
> +        compatible = "mediatek,mt6363-regulator";
> +        reg = <0x
> +
> +        vio18 {
> +          regulator-name = "pp1800-vio18-s3";
> +          regulator-min-microvolt = <1800000>;
> +          regulator-max-microvolt = <1800000>;
> +          regulator-allowed-modes = <0 2>;
> +          regulator-allow-set-load;
> +          regulator-over-current-protection;
> +        };
> +      };
> +    };
> +...
> -- 
> 2.50.1
>
Re: [PATCH v5 3/8] dt-bindings: regulator: Document MediaTek MT6363 PMIC Regulators
Posted by Chen-Yu Tsai 2 months, 2 weeks ago
On Thu, Jul 17, 2025 at 11:29 PM Rob Herring <robh@kernel.org> wrote:
>
> On Tue, Jul 15, 2025 at 04:02:19PM +0200, AngeloGioacchino Del Regno wrote:
> > Add bindings for the regulators found in the MediaTek MT6363 PMIC,
> > usually found in board designs using the MT6991 Dimensity 9400 and
> > on MT8196 Kompanio SoC for Chromebooks, along with the MT6316 and
> > MT6373 PMICs.
> >
> > Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> > ---
> >  .../regulator/mediatek,mt6363-regulator.yaml  | 193 ++++++++++++++++++
> >  1 file changed, 193 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/regulator/mediatek,mt6363-regulator.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6363-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6363-regulator.yaml
> > new file mode 100644
> > index 000000000000..ea1f6c92cffc
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6363-regulator.yaml
> > @@ -0,0 +1,193 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/regulator/mediatek,mt6363-regulator.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: MediaTek MT6363 PMIC Regulators
> > +
> > +maintainers:
> > +  - AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> > +
> > +description:
> > +  The MT6363 SPMI PMIC provides 10 BUCK and 25 LDO (Low DropOut) regulators
> > +  and can optionally provide overcurrent warnings with one ocp interrupt
> > +  for each voltage regulator.
> > +
> > +properties:
> > +  compatible:
> > +    const: mediatek,mt6363-regulator
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  vsys-vbuck1-supply:
> > +    description: Input supply for vbuck1
>
> blank line
>
> > +  vsys-vbuck2-supply:
> > +    description: Input supply for vbuck2
>
> blank line, and so on...
>
> > +  vsys-vbuck3-supply:
> > +    description: Input supply for vbuck3
> > +  vsys-vbuck4-supply:
> > +    description: Input supply for vbuck4
> > +  vsys-vbuck5-supply:
> > +    description: Input supply for vbuck5
> > +  vsys-vbuck6-supply:
> > +    description: Input supply for vbuck6
> > +  vsys-vbuck7-supply:
> > +    description: Input supply for vbuck7
> > +  vsys-vs1-supply:
> > +    description: Input supply for vs1
> > +  vsys-vs2-supply:
> > +    description: Input supply for vs2
> > +  vsys-vs3-supply:
> > +    description: Input supply for vs3

You could also merge the ones above with a regex and move it to
patternProperties. Since these are one to one mappings that should
work still.

> > +  vs1-ldo1-supply:
> > +    description: Input supply for va15, vio0p75, vm18, vrf18, vrf-io18
> > +  vs1-ldo2-supply:
> > +    description: Input supply for vcn15, vio18, vufs18
> > +  vs2-ldo1-supply:
> > +    description: Input supply for vsram-cpub, vsram-cpum, vrf12, vrf13, vufs12
> > +  vs2-ldo2-supply:
> > +    description: Input supply for va12-1, va12-2, vcn13, vsram-cpul
> > +  vs3-ldo1-supply:
> > +    description: Input supply for vsram-apu, vsram-digrf, vsram-mdfe
> > +  vs3-ldo2-supply:
> > +    description: Input supply for vsram-modem, vrf0p9
> > +  vsys-ldo1-supply:
> > +    description: Input supply for vaux18, vemc, vtref18

For these, I wonder if the description is really needed.

From a device tree writing point of view, the author is likely looking
at the diagram and tracing each of these pins to a supply. They won't
care which LDO it's actually feeding.

From an implementer POV, the author is likely looking at the datasheet
for other details not spelled out here, such as voltage steps and
register offsets. The datasheet also says which supply pin feeds into
which LDOs.

ChenYu
Re: [PATCH v5 3/8] dt-bindings: regulator: Document MediaTek MT6363 PMIC Regulators
Posted by Rob Herring (Arm) 2 months, 3 weeks ago
On Tue, 15 Jul 2025 16:02:19 +0200, AngeloGioacchino Del Regno wrote:
> Add bindings for the regulators found in the MediaTek MT6363 PMIC,
> usually found in board designs using the MT6991 Dimensity 9400 and
> on MT8196 Kompanio SoC for Chromebooks, along with the MT6316 and
> MT6373 PMICs.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  .../regulator/mediatek,mt6363-regulator.yaml  | 193 ++++++++++++++++++
>  1 file changed, 193 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/regulator/mediatek,mt6363-regulator.yaml
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Error: Documentation/devicetree/bindings/regulator/mediatek,mt6363-regulator.example.dts:27.21-22 syntax error
FATAL ERROR: Unable to parse input tree
make[2]: *** [scripts/Makefile.dtbs:131: Documentation/devicetree/bindings/regulator/mediatek,mt6363-regulator.example.dtb] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/builds/robherring/dt-review-ci/linux/Makefile:1525: dt_binding_check] Error 2
make: *** [Makefile:248: __sub-make] Error 2

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20250715140224.206329-4-angelogioacchino.delregno@collabora.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.