Skip to contentSkip to conversation

regulator: dt-bindings: Convert mediatek,mt6380-regulator to DT schema

PATCH In review Rob Herring (Arm) 2 participants 4 messages Sep 22 – Sep 23

Subsystems (3)
lore
Share & tools
lore

Rob Herring (Arm)

author maintainer
#0 lore raw

PATCH 1/1 regulator: dt-bindings: Convert mediatek,mt6380-regulator to DT schema

Convert the MediaTek mediatek,mt6380-regulator binding to DT schema format. It's a straight forward conversion.

The regulators are part of the "pwrap" block, so add a $ref to them.

Assisted-by LLM
---
 .../regulator/mediatek,mt6380-regulator.yaml  | 117 ++++++++++++++++++
 .../bindings/regulator/mt6380-regulator.txt   |  89 -------------
 .../bindings/soc/mediatek/mediatek,pwrap.yaml |   3 +
 3 files changed, 120 insertions(+), 89 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/regulator/mediatek,mt6380-regulator.yaml
 delete mode 100644 Documentation/devicetree/bindings/regulator/mt6380-regulator.txt
Documentation/devicetree/bindings/regulator/mediatek,mt6380-regulator.yaml new file +117 -0
new file mode 100644
index 000000000000..0b3c604da727
@@ -0,0 +1,117 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/mediatek,mt6380-regulator.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek MT6380 Regulator
+
+maintainers:
+  - Sean Wang <[email protected]>
+
+properties:
+  compatible:
+    const: mediatek,mt6380-regulator
+
+patternProperties:
+  '^buck-(vcore1?|vrf)$':
+    description: BUCK regulators
+    $ref: regulator.yaml#
+    unevaluatedProperties: false
+
+    required:
+      - regulator-min-microvolt
+      - regulator-max-microvolt
+      - regulator-ramp-delay
+
+  '^ldo-v([mat]|phy|ddr)$':
+    type: object
+    description: LDO regulators
+    $ref: regulator.yaml#
+    unevaluatedProperties: false
+
+    required:
+      - regulator-min-microvolt
+      - regulator-max-microvolt
+      - regulator-ramp-delay
+
+required:
+  - compatible
+
+additionalProperties: false
+
+examples:
+  - |
+    regulators {
+        compatible = "mediatek,mt6380-regulator";
+
+        buck-vcore1 {
+            regulator-name = "vcore1";
+            regulator-min-microvolt = <600000>;
+            regulator-max-microvolt = <1393750>;
+            regulator-ramp-delay = <6250>;
+            regulator-always-on;
+            regulator-boot-on;
+        };
+
+        buck-vcore {
+            regulator-name = "vcore";
+            regulator-min-microvolt = <600000>;
+            regulator-max-microvolt = <1393750>;
+            regulator-ramp-delay = <6250>;
+        };
+
+        buck-vrf {
+            regulator-name = "vrf";
+            regulator-min-microvolt = <1200000>;
+            regulator-max-microvolt = <1575000>;
+            regulator-ramp-delay = <0>;
+            regulator-always-on;
+            regulator-boot-on;
+        };
+
+        ldo-vm {
+            regulator-name = "vm";
+            regulator-min-microvolt = <1050000>;
+            regulator-max-microvolt = <1400000>;
+            regulator-ramp-delay = <0>;
+            regulator-always-on;
+            regulator-boot-on;
+        };
+
+        ldo-va {
+            regulator-name = "va";
+            regulator-min-microvolt = <2200000>;
+            regulator-max-microvolt = <3300000>;
+            regulator-ramp-delay = <0>;
+            regulator-always-on;
+            regulator-boot-on;
+        };
+
+        ldo-vphy {
+            regulator-name = "vphy";
+            regulator-min-microvolt = <1800000>;
+            regulator-max-microvolt = <1800000>;
+            regulator-ramp-delay = <0>;
+            regulator-always-on;
+            regulator-boot-on;
+        };
+
+        ldo-vddr {
+            regulator-name = "vddr";
+            regulator-min-microvolt = <1240000>;
+            regulator-max-microvolt = <1840000>;
+            regulator-ramp-delay = <0>;
+            regulator-always-on;
+            regulator-boot-on;
+        };
+
+        ldo-vt {
+            regulator-name = "vt";
+            regulator-min-microvolt = <2200000>;
+            regulator-max-microvolt = <3300000>;
+            regulator-ramp-delay = <0>;
+            regulator-always-on;
+            regulator-boot-on;
+        };
+    };
Documentation/devicetree/bindings/regulator/mt6380-regulator.txt deleted +0 -89

89 lines not on this page · raw message

Documentation/devicetree/bindings/soc/mediatek/mediatek,pwrap.yaml +3 -0
index e7c4a3984c60..79b755858bad 100644
@@ -105,6 +105,9 @@ properties:
   pmic:
     type: object
 
+  regulators:
+    $ref: /schemas/regulator/mediatek,mt6380-regulator.yaml#
+
 required:
   - compatible
   - reg
Signature · 1 line
2.53.0
maintainer
#1 lore raw
Quoted 8 lines · Rob Herring (Arm)

Convert the MediaTek mediatek,mt6380-regulator binding to DT schema format. It's a straight forward conversion.

Documentation/devicetree/bindings/regulator/mediatek,mt6380-regulator.yaml new file +5 -0
+  '^buck-(vcore1?|vrf)$':
+    description: BUCK regulators
+    $ref: regulator.yaml#
+    unevaluatedProperties: false
+

Documentation/devicetree/bindings/regulator/mediatek,mt6380-regulator.yaml line 31

Quoted 10 lines
Documentation/devicetree/bindings/regulator/mediatek,mt6380-regulator.yaml new file +10 -0
+    required:
+      - regulator-min-microvolt
+      - regulator-max-microvolt
+      - regulator-ramp-delay
+
+  '^ldo-v([mat]|phy|ddr)$':
+    type: object
+    description: LDO regulators
+    $ref: regulator.yaml#
+    unevaluatedProperties: false

The LDO is an object but the buck is not? I'll apply, but the above looks weird.

author maintainer
#2 lore raw
Quoted 14 lines · Mark Brown
Quoted 13 lines · Rob Herring (Arm)

Convert the MediaTek mediatek,mt6380-regulator binding to DT schema format. It's a straight forward conversion.

Documentation/devicetree/bindings/regulator/mediatek,mt6380-regulator.yaml new file +10 -0
+  '^buck-(vcore1?|vrf)$':
+    description: BUCK regulators
+    $ref: regulator.yaml#
+    unevaluatedProperties: false
+
+    required:
+      - regulator-min-microvolt
+      - regulator-max-microvolt
+      - regulator-ramp-delay
+
Quoted 8 lines

Documentation/devicetree/bindings/regulator/mediatek,mt6380-regulator.yaml line 31

Quoted 5 lines
Documentation/devicetree/bindings/regulator/mediatek,mt6380-regulator.yaml new file +5 -0
+  '^ldo-v([mat]|phy|ddr)$':
+    type: object
+    description: LDO regulators
+    $ref: regulator.yaml#
+    unevaluatedProperties: false

The LDO is an object but the buck is not? I'll apply, but the above looks weird.

I missed dropping 'type: object' here in my review/rewrite of the LLM generated conversion. It is not needed because regulator.yaml has it (after processing, every schema doc does).

Rob

maintainer
#3 lore raw
In reply to Rob Herring (Arm)
Quoted 1 line · Rob Herring (Arm)

regulator: dt-bindings: Convert mediatek,mt6380-regulator to DT schema

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-7.4

Thanks!

[1/1] regulator: dt-bindings: Convert mediatek,mt6380-regulator to DT schema

      https://git.kernel.org/broonie/regulator/c/22fe14c9bcb6

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark