[PATCH v2 1/6] dt-bindings: regulator: Document MediaTek MT6316 PMIC Regulators

AngeloGioacchino Del Regno posted 6 patches 3 months, 2 weeks ago
[PATCH v2 1/6] dt-bindings: regulator: Document MediaTek MT6316 PMIC Regulators
Posted by AngeloGioacchino Del Regno 3 months, 2 weeks ago
Add bindings for the regulators found in the MediaTek MT6316 PMIC,
usually found in board designs using the MT6991 Dimensity 9400 and
on MT8196 Kompanio SoC for Chromebooks.

This chip is fully controlled by SPMI and has multiple variants
providing different phase configurations.

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

diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6316-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6316-regulator.yaml
new file mode 100644
index 000000000000..019c3c36997c
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6316-regulator.yaml
@@ -0,0 +1,81 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/mediatek,mt6316-regulator.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek MT6316 SPMI PMIC Regulators
+
+maintainers:
+  - AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
+
+description: |
+  The MediaTek MT6316 PMIC is fully controlled by SPMI interface; it features
+  four step-down DC/DC (buck) converters and has multiple variants, providing
+  different phase configurations. In particular:
+  MT6316BP/VP:    2+2 Phase (buck 1+2, buck 3+4)
+  MT6316CP/HP/KP: 3+1 Phase (buck 1+2+4, buck 3)
+  MT6316DP/TP:    4+0 Phase (buck 1+2+3+4)
+
+properties:
+  compatible:
+    enum:
+      - mediatek,mt6316b-regulator
+      - mediatek,mt6316c-regulator
+      - mediatek,mt6316d-regulator
+
+  vbuck1234:
+    type: object
+    $ref: regulator.yaml#
+    unevaluatedProperties: false
+
+additionalProperties: false
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          const: mediatek,mt6316b-regulator
+    then:
+      patternProperties:
+        "^vbuck(12|34)$":
+          type: object
+          $ref: regulator.yaml#
+          unevaluatedProperties: false
+
+  - if:
+      properties:
+        compatible:
+          const: mediatek,mt6316c-regulator
+    then:
+      patternProperties:
+        "^vbuck(124|3)$":
+          type: object
+          $ref: regulator.yaml#
+          unevaluatedProperties: false
+
+  - if:
+      properties:
+        compatible:
+          const: mediatek,mt6316d-regulator
+    then:
+      properties:
+        vbuck1234: true
+    else:
+      properties:
+        vbuck1234: false
+
+examples:
+  - |
+    pmic {
+      regulators {
+        compatible = "mediatek,mt6316d-regulator";
+
+        vbuck1234 {
+          regulator-min-microvolt = <400000>;
+          regulator-max-microvolt = <1277500>;
+          regulator-always-on;
+        };
+      };
+    };
+...
-- 
2.49.0
Re: [PATCH v2 1/6] dt-bindings: regulator: Document MediaTek MT6316 PMIC Regulators
Posted by Krzysztof Kozlowski 3 months, 1 week ago
On Tue, Jun 24, 2025 at 09:35:43AM +0200, AngeloGioacchino Del Regno wrote:
> Add bindings for the regulators found in the MediaTek MT6316 PMIC,
> usually found in board designs using the MT6991 Dimensity 9400 and
> on MT8196 Kompanio SoC for Chromebooks.
> 
> This chip is fully controlled by SPMI and has multiple variants
> providing different phase configurations.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  .../regulator/mediatek,mt6316-regulator.yaml  | 81 +++++++++++++++++++
>  1 file changed, 81 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/regulator/mediatek,mt6316-regulator.yaml
> 
> diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6316-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6316-regulator.yaml
> new file mode 100644
> index 000000000000..019c3c36997c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6316-regulator.yaml
> @@ -0,0 +1,81 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/regulator/mediatek,mt6316-regulator.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: MediaTek MT6316 SPMI PMIC Regulators
> +
> +maintainers:
> +  - AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> +
> +description: |
> +  The MediaTek MT6316 PMIC is fully controlled by SPMI interface; it features
> +  four step-down DC/DC (buck) converters and has multiple variants, providing
> +  different phase configurations. In particular:
> +  MT6316BP/VP:    2+2 Phase (buck 1+2, buck 3+4)
> +  MT6316CP/HP/KP: 3+1 Phase (buck 1+2+4, buck 3)
> +  MT6316DP/TP:    4+0 Phase (buck 1+2+3+4)
> +
> +properties:
> +  compatible:
> +    enum:
> +      - mediatek,mt6316b-regulator
> +      - mediatek,mt6316c-regulator
> +      - mediatek,mt6316d-regulator
> +
> +  vbuck1234:
> +    type: object
> +    $ref: regulator.yaml#
> +    unevaluatedProperties: false
> +

Here you define all regulators

> +additionalProperties: false

This goes to the end.

> +
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          const: mediatek,mt6316b-regulator
> +    then:
> +      patternProperties:
> +        "^vbuck(12|34)$":

Every device has different regulators, so there is little benefit in
keeping this in one schema file.

Best regards,
Krzysztof