Skip to contentSkip to conversation

regulator: mt6315: add regulator supplies

PATCH RESEND Superseded Chen-Yu Tsai 3 participants 7 messages Mar 24 – Mar 26

Subsystems (3)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover regulator: mt6315: add regulator supplies

(Resent with correct subject on cover letter)

Hi,

This series is part of a broader collection of regulator related cleanups for MediaTek Chromebooks. This one covers the MT6315 PMIC.

Patch 1 adds the names of the power supply inputs to the binding.

Patch 2 adds the supply names from the DT binding change in patch 1 to the regulator descriptions in the driver. This patch has a checkpatch.pl warnings, but I wonder if it's because the context size for checking complex macros is not large enough.

Device tree changes will be sent separately. The goal is to get the regulator tree as complete as possible. This includes adding supply names to other regulator DT bindings, and adding all the supply links to the existing DTs.

Please have a look.

Thanks
ChenYu

Chen-Yu Tsai (2):
regulator: dt-bindings: mt6315: Add regulator supplies
regulator: mt6315: Add regulator supplies

 .../bindings/regulator/mt6315-regulator.yaml        | 13 +++++++++++++
 drivers/regulator/mt6315-regulator.c                | 11 ++++++-----
 2 files changed, 19 insertions(+), 5 deletions(-)
Signature · 1 line
2.53.0.983.g0bb29b3bc5-goog
#1 lore raw

PATCH RESEND 1/2 regulator: dt-bindings: mt6315: Add regulator supplies

The MT6315 family of PMICs has 4 buck regulators. Each regulator has a separate supply.

Add these supplies to the device tree binding.

---
 .../bindings/regulator/mt6315-regulator.yaml        | 13 +++++++++++++
 1 file changed, 13 insertions(+)
Documentation/devicetree/bindings/regulator/mt6315-regulator.yaml +13 -0
index fa6743bb269d..ba99a0d02bc7 100644
@@ -29,6 +29,16 @@ properties:
     type: object
     description: List of regulators and its properties
 
+    properties:
+      pvdd1-supply:
+        description: Supply for vbuck1
+      pvdd2-supply:
+        description: Supply for vbuck2
+      pvdd3-supply:
+        description: Supply for vbuck3
+      pvdd4-supply:
+        description: Supply for vbuck4
+
     patternProperties:
       "^vbuck[1-4]$":
         type: object
@@ -51,6 +61,9 @@ examples:
       reg = <0x6 0>;
 
       regulators {
+        pvdd1-supply = <&pp4200_z2>;
+        pvdd3-supply = <&pp4200_z2>;
+
         vbuck1 {
           regulator-min-microvolt = <300000>;
           regulator-max-microvolt = <1193750>;
Signature · 1 line
2.53.0.983.g0bb29b3bc5-goog
#2 lore raw

Re: [PATCH RESEND 1/2] regulator: dt-bindings: mt6315: Add regulator supplies

Quoted 7 lines · Chen-Yu Tsai
Documentation/devicetree/bindings/regulator/mt6315-regulator.yaml +0 -0
index fa6743bb269d..ba99a0d02bc7 100644
@@ -29,6 +29,16 @@ properties:
     type: object
     description: List of regulators and its properties

Documentation/devicetree/bindings/regulator/mt6315-regulator.yaml properties: · line 40

Quoted 10 lines
Documentation/devicetree/bindings/regulator/mt6315-regulator.yaml +9 -0
 
+    properties:
+      pvdd1-supply:
+        description: Supply for vbuck1
+      pvdd2-supply:
+        description: Supply for vbuck2
+      pvdd3-supply:
+        description: Supply for vbuck3
+      pvdd4-supply:
+        description: Supply for vbuck4

These all look per-regulator supplies, so I think they should be in each regulator node (see also regulator.yaml).

Or in top-level, but not in "regulators" node. The regulators is only wrapping node for children.

I wonder what should be our preference - have supplies per regulator or in top-level node. @Mark, any preference from your side?

Documentation/devicetree/bindings/regulator/mt6315-regulator.yaml examples: · line 65

Quoted 10 lines
Documentation/devicetree/bindings/regulator/mt6315-regulator.yaml +3 -0
+
     patternProperties:
       "^vbuck[1-4]$":
         type: object
@@ -51,6 +61,9 @@ examples:
       reg = <0x6 0>;
 
       regulators {
+        pvdd1-supply = <&pp4200_z2>;
+        pvdd3-supply = <&pp4200_z2>;

Best regards,
Krzysztof

maintainer
#3 lore raw

Re: [PATCH RESEND 1/2] regulator: dt-bindings: mt6315: Add regulator supplies

Quoted 5 lines · Krzysztof Kozlowski

Documentation/devicetree/bindings/regulator/mt6315-regulator.yaml properties: · line 40

Quoted 2 lines · Chen-Yu Tsai
Documentation/devicetree/bindings/regulator/mt6315-regulator.yaml +2 -0
+      pvdd4-supply:
+        description: Supply for vbuck4
Quoted 8 lines

These all look per-regulator supplies, so I think they should be in each regulator node (see also regulator.yaml).

Or in top-level, but not in "regulators" node. The regulators is only wrapping node for children.

I wonder what should be our preference - have supplies per regulator or in top-level node. @Mark, any preference from your side?

The top level, so people can figure out where to describe supplies without having to read the bindings so much - the supplies go into the chip, even if they're distributed within it.

Please don't add random characters to my name.

#4 lore raw

Re: [PATCH RESEND 1/2] regulator: dt-bindings: mt6315: Add regulator supplies

Quoted 13 lines · Mark Brown
Quoted 10 lines · Krzysztof Kozlowski

Documentation/devicetree/bindings/regulator/mt6315-regulator.yaml properties: · line 40

Quoted 2 lines · Chen-Yu Tsai
Documentation/devicetree/bindings/regulator/mt6315-regulator.yaml +2 -0
+      pvdd4-supply:
+        description: Supply for vbuck4

These all look per-regulator supplies, so I think they should be in each regulator node (see also regulator.yaml).

Or in top-level, but not in "regulators" node. The regulators is only wrapping node for children.

Quoted 6 lines
Quoted 2 lines

I wonder what should be our preference - have supplies per regulator or in top-level node. @Mark, any preference from your side?

The top level, so people can figure out where to describe supplies without having to read the bindings so much - the supplies go into the chip, even if they're distributed within it.

OK. What about the more complicated mfd PMICs? We already added *-supplies for the regulator side of these PMICs in

- regulator/mediatek,mt6358-regulator.yaml
- regulator/mediatek,mt6363-regulator.yaml

And my other series for the MT6359 also adds them in this manner.

Thanks
ChenYu

maintainer
#5 lore raw

Re: [PATCH RESEND 1/2] regulator: dt-bindings: mt6315: Add regulator supplies

Quoted 6 lines · Chen-Yu Tsai
Quoted 3 lines · Mark Brown

The top level, so people can figure out where to describe supplies without having to read the bindings so much - the supplies go into the chip, even if they're distributed within it.

Quoted 7 lines

OK. What about the more complicated mfd PMICs? We already added *-supplies for the regulator side of these PMICs in

- regulator/mediatek,mt6358-regulator.yaml
- regulator/mediatek,mt6363-regulator.yaml

And my other series for the MT6359 also adds them in this manner.

Existing bindings are existing bindings, we can't really do anything with them.

#6 lore raw

PATCH RESEND 2/2 regulator: mt6315: Add regulator supplies

In reply to Chen-Yu Tsai

The MT6315 family of PMICs has 4 buck regulators. Each regulator has a separate supply.

Add these supplies to the driver.

---
 drivers/regulator/mt6315-regulator.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/regulator/mt6315-regulator.c +6 -5
index d3f93aae0fc5..231e64fb0596 100644
@@ -31,10 +31,11 @@ struct mt6315_chip {
 	struct regmap *regmap;
 };
 
-#define MT_BUCK(_name, _bid, _vsel)				\
+#define MT_BUCK(_name, _bid, _supply, _vsel)			\
 [_bid] = {							\
 	.desc = {						\
 		.name = _name,					\
+		.supply_name = _supply,				\
 		.of_match = of_match_ptr(_name),		\
 		.regulators_node = "regulators",		\
 		.ops = &mt6315_volt_range_ops,			\
@@ -190,10 +191,10 @@ static const struct regulator_ops mt6315_volt_range_ops = {
 };
 
 static const struct mt6315_regulator_info mt6315_regulators[MT6315_VBUCK_MAX] = {
-	MT_BUCK("vbuck1", MT6315_VBUCK1, MT6315_BUCK_TOP_ELR0),
-	MT_BUCK("vbuck2", MT6315_VBUCK2, MT6315_BUCK_TOP_ELR2),
-	MT_BUCK("vbuck3", MT6315_VBUCK3, MT6315_BUCK_TOP_ELR4),
-	MT_BUCK("vbuck4", MT6315_VBUCK4, MT6315_BUCK_TOP_ELR6),
+	MT_BUCK("vbuck1", MT6315_VBUCK1, "pvdd1", MT6315_BUCK_TOP_ELR0),
+	MT_BUCK("vbuck2", MT6315_VBUCK2, "pvdd2", MT6315_BUCK_TOP_ELR2),
+	MT_BUCK("vbuck3", MT6315_VBUCK3, "pvdd3", MT6315_BUCK_TOP_ELR4),
+	MT_BUCK("vbuck4", MT6315_VBUCK4, "pvdd4", MT6315_BUCK_TOP_ELR6),
 };
 
 static const struct regmap_config mt6315_regmap_config = {
Signature · 1 line
2.53.0.983.g0bb29b3bc5-goog