Skip to contentSkip to conversation

dt-bindings: regulator: Add dt property

PATCH In review Naresh Solanki 3 participants 12 messages Apr 18, 2023 – Apr 24, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 dt-bindings: regulator: Add dt property

Add DT property regulator-supplies.
This enables us to couple one or more regulator output to gether. This is use in case of Single connector having 2 or more supplies.

---
 .../bindings/regulator/regulator-output.yaml         | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/regulator/regulator-output.yaml +9 -3
index 078b37a1a71a..17f683d3c1f3 100644
@@ -21,13 +21,19 @@ properties:
   compatible:
     const: regulator-output
 
-  vout-supply:
+  regulator-supplies:
     description:
-      Phandle of the regulator supplying the output.
+      Specifies the name of the output supply provided by the regulator.
+      Defaults to "vout".
+    default: "vout"
+
+patternProperties:
+  ".*-supply":
+    description:
+      Specified the phandle for various supplies
 
 required:
   - compatible
-  - vout-supply
 
 additionalProperties: false
 

base-commit: c55470f8b0616b0adb758077dbae9b19c5aac005

Signature · 1 line
2.39.1
#1 lore raw

PATCH 2/2 regulator: userspace-consumer: Multiple regulators

Use property regulator-supplies to determine all regulator supplies.
This is useful in case of a connector having 2 or more supplies.
Example: PCIe connector on mainboard can be powered by 12V & 3.3V suplies.

---
 drivers/regulator/userspace-consumer.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
drivers/regulator/userspace-consumer.c +15 -4
index 97f075ed68c9..0bb49547b926 100644
@@ -120,7 +120,10 @@ static int regulator_userspace_consumer_probe(struct platform_device *pdev)
 	struct regulator_userspace_consumer_data tmpdata;
 	struct regulator_userspace_consumer_data *pdata;
 	struct userspace_consumer_data *drvdata;
-	int ret;
+	struct device_node *np = pdev->dev.of_node;
+	struct property *prop;
+	const char *supply;
+	int ret, count = 0;
 
 	pdata = dev_get_platdata(&pdev->dev);
 	if (!pdata) {
@@ -131,11 +134,19 @@ static int regulator_userspace_consumer_probe(struct platform_device *pdev)
 		memset(pdata, 0, sizeof(*pdata));
 
 		pdata->no_autoswitch = true;
-		pdata->num_supplies = 1;
-		pdata->supplies = devm_kzalloc(&pdev->dev, sizeof(*pdata->supplies), GFP_KERNEL);
+		pdata->num_supplies = of_property_count_strings(np, "regulator-supplies");
+		if (pdata->num_supplies < 0) {
+			dev_err(&pdev->dev, "could not parse property regulator-supplies");
+			return -EINVAL;
+		}
+		pdata->supplies = devm_kzalloc(&pdev->dev,
+					       sizeof(*pdata->supplies) * pdata->num_supplies,
+					       GFP_KERNEL);
 		if (!pdata->supplies)
 			return -ENOMEM;
-		pdata->supplies[0].supply = "vout";
+
+		of_property_for_each_string(np, "regulator-supplies", prop, supply)
+			pdata->supplies[count++].supply = supply;
 	}
 
 	if (pdata->num_supplies < 1) {
Signature · 1 line
2.39.1
#2 lore raw

Re: [PATCH 2/2] regulator: userspace-consumer: Multiple regulators

Quoted 31 lines · Naresh Solanki

Use property regulator-supplies to determine all regulator supplies.
This is useful in case of a connector having 2 or more supplies.
Example: PCIe connector on mainboard can be powered by 12V & 3.3V suplies.

---
drivers/regulator/userspace-consumer.c | 19 +++++++++++++++----

1 file changed, 15 insertions(+), 4 deletions(-)
drivers/regulator/userspace-consumer.c +4 -1
index 97f075ed68c9..0bb49547b926 100644
@@ -120,7 +120,10 @@ static int regulator_userspace_consumer_probe(struct platform_device *pdev)
 	struct regulator_userspace_consumer_data tmpdata;
 	struct regulator_userspace_consumer_data *pdata;
 	struct userspace_consumer_data *drvdata;
-	int ret;
+	struct device_node *np = pdev->dev.of_node;
+	struct property *prop;
+	const char *supply;
+	int ret, count = 0;
 
 	pdata = dev_get_platdata(&pdev->dev);
 	if (!pdata) {
@@ -131,11 +134,19 @@ static int regulator_userspace_consumer_probe(struct platform_device *pdev)
 		memset(pdata, 0, sizeof(*pdata));
 
 		pdata->no_autoswitch = true;

drivers/regulator/userspace-consumer.c static int regulator_userspace_consumer_probe(struct platform_device *pdev) · line 144

Quoted 10 lines
drivers/regulator/userspace-consumer.c +8 -2
-		pdata->num_supplies = 1;
-		pdata->supplies = devm_kzalloc(&pdev->dev, sizeof(*pdata->supplies), GFP_KERNEL);
+		pdata->num_supplies = of_property_count_strings(np, "regulator-supplies");
+		if (pdata->num_supplies < 0) {
+			dev_err(&pdev->dev, "could not parse property regulator-supplies");
+			return -EINVAL;
+		}
+		pdata->supplies = devm_kzalloc(&pdev->dev,
+					       sizeof(*pdata->supplies) * pdata->num_supplies,
+					       GFP_KERNEL);

AFAICT this doesn't appear to implement the "vout" default specified in the dt-binding patch?

Also, since the core of the userspace-consumer driver itself already supports multiple regulators, it might be nice for the subject line to mention DT supplies or something a bit more specifically.

Quoted 13 lines
drivers/regulator/userspace-consumer.c +3 -1
 		if (!pdata->supplies)
 			return -ENOMEM;
-		pdata->supplies[0].supply = "vout";
+
+		of_property_for_each_string(np, "regulator-supplies", prop, supply)
+			pdata->supplies[count++].supply = supply;
 	}
 
 	if (pdata->num_supplies < 1) {
Signature · 1 line
2.39.1
#3 lore raw

Re: [PATCH 2/2] regulator: userspace-consumer: Multiple regulators

Hi Zev,

Quoted 42 lines · Zev Weiss
Quoted 41 lines · Naresh Solanki

Use property regulator-supplies to determine all regulator supplies.
This is useful in case of a connector having 2 or more supplies.
Example: PCIe connector on mainboard can be powered by 12V & 3.3V suplies.

---
drivers/regulator/userspace-consumer.c | 19 +++++++++++++++----

1 file changed, 15 insertions(+), 4 deletions(-)
drivers/regulator/userspace-consumer.c +4 -1
index 97f075ed68c9..0bb49547b926 100644
@@ -120,7 +120,10 @@ static int 
 regulator_userspace_consumer_probe(struct platform_device *pdev)
     struct regulator_userspace_consumer_data tmpdata;
     struct regulator_userspace_consumer_data *pdata;
     struct userspace_consumer_data *drvdata;
-    int ret;
+    struct device_node *np = pdev->dev.of_node;
+    struct property *prop;
+    const char *supply;
+    int ret, count = 0;
 
     pdata = dev_get_platdata(&pdev->dev);

    if (!pdata) {

drivers/regulator/userspace-consumer.c +3 -2
@@ -131,11 +134,19 @@ static int 
 regulator_userspace_consumer_probe(struct platform_device *pdev)
         memset(pdata, 0, sizeof(*pdata));
 
         pdata->no_autoswitch = true;
-        pdata->num_supplies = 1;
-        pdata->supplies = devm_kzalloc(&pdev->dev, 
 sizeof(*pdata->supplies), GFP_KERNEL);
+        pdata->num_supplies = of_property_count_strings(np, 
 "regulator-supplies");
+        if (pdata->num_supplies < 0) {
+            dev_err(&pdev->dev, "could not parse property 
 regulator-supplies");
Quoted 8 lines

drivers/regulator/userspace-consumer.c static int regulator_userspace_consumer_probe(struct platform_device *pdev) · line 144

Quoted 6 lines
drivers/regulator/userspace-consumer.c +5 -0
+            return -EINVAL;
+        }
+        pdata->supplies = devm_kzalloc(&pdev->dev,
+                           sizeof(*pdata->supplies) * 
 pdata->num_supplies,
+                           GFP_KERNEL);

AFAICT this doesn't appear to implement the "vout" default specified in the dt-binding patch?

The "regulator-supplies" property will hold the default value of "vout" unless specified otherwise. As a result, the string enumeration retrieves the value of "vout" by default, and the "vout-supply" property is utilized for the regulator.

Quoted 2 lines

Also, since the core of the userspace-consumer driver itself already supports multiple regulators, it might be nice for the subject line to mention DT supplies or something a bit more specifically.

Sure. How about 'Support multiple supplies' ?

Quoted 10 lines
Quoted 10 lines
drivers/regulator/userspace-consumer.c +0 -0
         if (!pdata->supplies)

            return -ENOMEM;
-        pdata->supplies[0].supply = "vout";
+
+        of_property_for_each_string(np, "regulator-supplies", prop, supply)
+            pdata->supplies[count++].supply = supply;
    }

Quoted 5 lines
Quoted 5 lines

    if (pdata->num_supplies < 1) {

Signature · 1 line
2.39.1

Regards,
Naresh

#4 lore raw

Re: [PATCH 2/2] regulator: userspace-consumer: Multiple regulators

Quoted 53 lines · Naresh Solanki

Hi Zev,

Quoted 42 lines · Zev Weiss
Quoted 41 lines · Naresh Solanki

Use property regulator-supplies to determine all regulator supplies.
This is useful in case of a connector having 2 or more supplies.
Example: PCIe connector on mainboard can be powered by 12V & 3.3V suplies.

---
drivers/regulator/userspace-consumer.c | 19 +++++++++++++++----

1 file changed, 15 insertions(+), 4 deletions(-)
drivers/regulator/userspace-consumer.c +4 -1
index 97f075ed68c9..0bb49547b926 100644
@@ -120,7 +120,10 @@ static int 
 regulator_userspace_consumer_probe(struct platform_device *pdev)
     struct regulator_userspace_consumer_data tmpdata;
     struct regulator_userspace_consumer_data *pdata;
     struct userspace_consumer_data *drvdata;
-    int ret;
+    struct device_node *np = pdev->dev.of_node;
+    struct property *prop;
+    const char *supply;
+    int ret, count = 0;
 
     pdata = dev_get_platdata(&pdev->dev);

    if (!pdata) {

drivers/regulator/userspace-consumer.c +3 -2
@@ -131,11 +134,19 @@ static int 
 regulator_userspace_consumer_probe(struct platform_device *pdev)
         memset(pdata, 0, sizeof(*pdata));
 
         pdata->no_autoswitch = true;
-        pdata->num_supplies = 1;
-        pdata->supplies = devm_kzalloc(&pdev->dev, 
 sizeof(*pdata->supplies), GFP_KERNEL);
+        pdata->num_supplies = of_property_count_strings(np, 
 "regulator-supplies");
+        if (pdata->num_supplies < 0) {
+            dev_err(&pdev->dev, "could not parse property 
 regulator-supplies");
Quoted 8 lines

drivers/regulator/userspace-consumer.c static int regulator_userspace_consumer_probe(struct platform_device *pdev) · line 144

Quoted 6 lines
drivers/regulator/userspace-consumer.c +5 -0
+            return -EINVAL;
+        }
+        pdata->supplies = devm_kzalloc(&pdev->dev,
+                           sizeof(*pdata->supplies) * 
 pdata->num_supplies,
+                           GFP_KERNEL);

AFAICT this doesn't appear to implement the "vout" default specified in the dt-binding patch?

Quoted 2 lines

The "regulator-supplies" property will hold the default value of "vout" unless specified otherwise. As a result, the string enumeration retrieves the value of "vout" by default, and the "vout-supply" property is utilized for the regulator.

With the disclaimer that I'm not a DT expert, that's not my understanding of how DT works. I don't think the 'default' value specified in the binding forces the fdt to always include that value if it's not present in the dts (since I'm pretty sure dtc doesn't even look at the binding to know that a default exists when compiling the dts); rather, it's information meant to be used by the software implementing support for that device (e.g. a driver for it) about what value to assume if the property isn't present in the fdt.

Quoted 3 lines
Quoted 2 lines

Also, since the core of the userspace-consumer driver itself already supports multiple regulators, it might be nice for the subject line to mention DT supplies or something a bit more specifically.

Sure. How about 'Support multiple supplies' ?

I meant that it should explicitly mention "DT" (or perhaps "OF"). The driver's structure has supported multiple supplies since it was first introduced in 2009, so "Support multiple supplies" sounds like this commit is adding functionality that was already there. What this patch is doing is connecting that existing support to the OF support logic so that it can be used in a device-tree context.

Quoted 17 lines
Quoted 10 lines
Quoted 10 lines
drivers/regulator/userspace-consumer.c +0 -0
         if (!pdata->supplies)

            return -ENOMEM;
-        pdata->supplies[0].supply = "vout";
+
+        of_property_for_each_string(np, "regulator-supplies", prop, supply)
+            pdata->supplies[count++].supply = supply; }

Quoted 5 lines
Quoted 5 lines

    if (pdata->num_supplies < 1) {

Signature · 1 line
2.39.1

Regards,
Naresh

#5 lore raw

Re: [PATCH 2/2] regulator: userspace-consumer: Multiple regulators

Hi Zev,

Quoted 54 lines · Zev Weiss
Quoted 53 lines · Naresh Solanki

Hi Zev,

Quoted 50 lines · Zev Weiss
Quoted 37 lines · Naresh Solanki

Use property regulator-supplies to determine all regulator supplies.
This is useful in case of a connector having 2 or more supplies.
Example: PCIe connector on mainboard can be powered by 12V & 3.3V suplies.

---
drivers/regulator/userspace-consumer.c | 19 +++++++++++++++----

1 file changed, 15 insertions(+), 4 deletions(-)
drivers/regulator/userspace-consumer.c +4 -1
index 97f075ed68c9..0bb49547b926 100644
@@ -120,7 +120,10 @@ static int 
 regulator_userspace_consumer_probe(struct platform_device *pdev)
     struct regulator_userspace_consumer_data tmpdata;
     struct regulator_userspace_consumer_data *pdata;
     struct userspace_consumer_data *drvdata;
-    int ret;
+    struct device_node *np = pdev->dev.of_node;
+    struct property *prop;
+    const char *supply;
+    int ret, count = 0;
 
     pdata = dev_get_platdata(&pdev->dev);

    if (!pdata) {

drivers/regulator/userspace-consumer.c +1 -2
@@ -131,11 +134,19 @@ static int 
 regulator_userspace_consumer_probe(struct platform_device *pdev)
         memset(pdata, 0, sizeof(*pdata));
 
         pdata->no_autoswitch = true;
-        pdata->num_supplies = 1;
-        pdata->supplies = devm_kzalloc(&pdev->dev, 
 sizeof(*pdata->supplies), GFP_KERNEL);
+        pdata->num_supplies = of_property_count_strings(np, 

drivers/regulator/userspace-consumer.c static int · line 149

Quoted 10 lines
drivers/regulator/userspace-consumer.c +7 -0
 "regulator-supplies");
+        if (pdata->num_supplies < 0) {
+            dev_err(&pdev->dev, "could not parse property 
 regulator-supplies");
+            return -EINVAL;
+        }
+        pdata->supplies = devm_kzalloc(&pdev->dev,
+                           sizeof(*pdata->supplies) * 
 pdata->num_supplies,
+                           GFP_KERNEL);

AFAICT this doesn't appear to implement the "vout" default specified in the dt-binding patch?

Quoted 4 lines
Quoted 2 lines

The "regulator-supplies" property will hold the default value of "vout" unless specified otherwise. As a result, the string enumeration retrieves the value of "vout" by default, and the "vout-supply" property is utilized for the regulator.

With the disclaimer that I'm not a DT expert, that's not my understanding of how DT works.  I don't think the 'default' value specified in the binding forces the fdt to always include that value if it's not present in the dts (since I'm pretty sure dtc doesn't even look at the binding to know that a default exists when compiling the dts); rather, it's information meant to be used by the software implementing support for that device (e.g. a driver for it) about what value to assume if the property isn't present in the fdt.

I apologize for the oversight on my part. Upon further testing, I have discovered that the default did not reflect in the debug prints. I will address this issue and include the proper fix in the next patchset. Thank you for bringing this to my attention

Quoted 6 lines
Quoted 4 lines
Quoted 3 lines

Also, since the core of the userspace-consumer driver itself already supports multiple regulators, it might be nice for the subject line to mention DT supplies or something a bit more specifically.

Sure. How about 'Support multiple supplies' ?

I meant that it should explicitly mention "DT" (or perhaps "OF").  The driver's structure has supported multiple supplies since it was first introduced in 2009, so "Support multiple supplies" sounds like this commit is adding functionality that was already there.  What this patch is doing is connecting that existing support to the OF support logic so that it can be used in a device-tree context.

Sure. Will make it something like "Support multiple supplies in DT".

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
drivers/regulator/userspace-consumer.c +0 -0
         if (!pdata->supplies)

            return -ENOMEM;
-        pdata->supplies[0].supply = "vout";
+
+        of_property_for_each_string(np, "regulator-supplies", prop, supply)
+            pdata->supplies[count++].supply = supply;
    }

Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines

    if (pdata->num_supplies < 1) {

Signature · 1 line
2.39.1

Regards,
Naresh

Regards,
Naresh

#6 lore raw
In reply to Naresh Solanki
Quoted 15 lines · Naresh Solanki

Add DT property regulator-supplies.
This enables us to couple one or more regulator output to gether. This is use in case of Single connector having 2 or more supplies.

---
.../bindings/regulator/regulator-output.yaml | 12 +++++++++---

1 file changed, 9 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/regulator/regulator-output.yaml +0 -0
index 078b37a1a71a..17f683d3c1f3 100644
@@ -21,13 +21,19 @@ properties:
  compatible:

Documentation/devicetree/bindings/regulator/regulator-output.yaml properties: · line 29

Quoted 10 lines
Documentation/devicetree/bindings/regulator/regulator-output.yaml +5 -2
    const: regulator-output
 
-  vout-supply:
+  regulator-supplies:
    description:
-      Phandle of the regulator supplying the output.
+      Specifies the name of the output supply provided by the regulator.
+      Defaults to "vout".
+    default: "vout"
+

Was this meant to be specified as a string-array to allow providing multiple names?

Quoted 9 lines
Documentation/devicetree/bindings/regulator/regulator-output.yaml +4 -0
+patternProperties:
+  ".*-supply":
+    description:
+      Specified the phandle for various supplies
 

required:
- compatible
- - vout-supply

Quoted 3 lines

additionalProperties: false

I think it would be nice to also update the examples to show what a multi-supply instance would look like.

A slightly more descriptive subject line would also be good -- "Add dt property" is a bit vague.

Quoted 4 lines

base-commit: c55470f8b0616b0adb758077dbae9b19c5aac005

Signature · 1 line
2.39.1
#7 lore raw

Hi Zev,

Quoted 18 lines · Zev Weiss
Quoted 17 lines · Naresh Solanki

Add DT property regulator-supplies.
This enables us to couple one or more regulator output to gether. This is use in case of Single connector having 2 or more supplies.

---
.../bindings/regulator/regulator-output.yaml         | 12 +++++++++---

1 file changed, 9 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/regulator/regulator-output.yaml +0 -0
index 078b37a1a71a..17f683d3c1f3 100644
@@ -21,13 +21,19 @@ properties:

  compatible:
    const: regulator-output

Quoted 10 lines
Quoted 8 lines

-  vout-supply:
+  regulator-supplies:
    description:
-      Phandle of the regulator supplying the output.
+      Specifies the name of the output supply provided by the regulator. +      Defaults to "vout".
+    default: "vout"
+

Was this meant to be specified as a string-array to allow providing multiple names?

Yes. This is string-array.

Quoted 10 lines
Quoted 10 lines

+patternProperties:
+  ".*-supply":
+    description:
+      Specified the phandle for various supplies

required:
  - compatible
-  - vout-supply

Quoted 5 lines
Quoted 3 lines

additionalProperties: false

I think it would be nice to also update the examples to show what a multi-supply instance would look like.

Ack. Will do that.

Quoted 2 lines

A slightly more descriptive subject line would also be good -- "Add dt property" is a bit vague.

Suggestion ?
How about like 'Allow multiple supplies' or 'Add support for multiple supplies'

Quoted 5 lines
Quoted 5 lines

base-commit: c55470f8b0616b0adb758077dbae9b19c5aac005

Signature · 1 line
2.39.1

Regards,
Naresh

#8 lore raw
Quoted 31 lines · Naresh Solanki

Hi Zev,

Quoted 18 lines · Zev Weiss
Quoted 17 lines · Naresh Solanki

Add DT property regulator-supplies.
This enables us to couple one or more regulator output to gether. This is use in case of Single connector having 2 or more supplies.

---
.../bindings/regulator/regulator-output.yaml         | 12 +++++++++---

1 file changed, 9 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/regulator/regulator-output.yaml +0 -0
index 078b37a1a71a..17f683d3c1f3 100644
@@ -21,13 +21,19 @@ properties:

  compatible:
    const: regulator-output

Quoted 10 lines
Quoted 8 lines

-  vout-supply:
+  regulator-supplies:
    description:
-      Phandle of the regulator supplying the output.
+      Specifies the name of the output supply provided by the regulator. +      Defaults to "vout".
+    default: "vout"
+

Was this meant to be specified as a string-array to allow providing multiple names?

Quoted 1 line

Yes. This is string-array.

Okay -- in that case I think it should include

$ref: /schemas/types.yaml#/definitions/string-array

Quoted 14 lines
Quoted 14 lines
Quoted 13 lines

+patternProperties:
+  ".*-supply":
+    description:
+      Specified the phandle for various supplies

required:
  - compatible
-  - vout-supply

additionalProperties: false

Quoted 6 lines
Quoted 1 line

I think it would be nice to also update the examples to show what a multi-supply instance would look like.

Ack. Will do that.

Quoted 2 lines

A slightly more descriptive subject line would also be good -- "Add dt property" is a bit vague.

Suggestion ?
How about like 'Allow multiple supplies' or 'Add support for multiple supplies'

Sure, both of those sound fine to me.

Quoted 7 lines
Quoted 5 lines
Quoted 5 lines

base-commit: c55470f8b0616b0adb758077dbae9b19c5aac005

Signature · 1 line
2.39.1

Regards,
Naresh

#9 lore raw

Hi Zev,

Quoted 33 lines · Zev Weiss
Quoted 32 lines · Naresh Solanki

Hi Zev,

Quoted 29 lines · Zev Weiss
Quoted 17 lines · Naresh Solanki

Add DT property regulator-supplies.
This enables us to couple one or more regulator output to gether. This is use in case of Single connector having 2 or more supplies.

---
.../bindings/regulator/regulator-output.yaml         | 12 +++++++++---

1 file changed, 9 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/regulator/regulator-output.yaml +0 -0
index 078b37a1a71a..17f683d3c1f3 100644
@@ -21,13 +21,19 @@ properties:

  compatible:
    const: regulator-output

Quoted 9 lines

-  vout-supply:
+  regulator-supplies:
    description:
-      Phandle of the regulator supplying the output. +      Specifies the name of the output supply provided by the regulator.
+      Defaults to "vout".
+    default: "vout"
+

Was this meant to be specified as a string-array to allow providing multiple names?

Quoted 5 lines
Quoted 1 line

Yes. This is string-array.

Okay -- in that case I think it should include

  $ref: /schemas/types.yaml#/definitions/string-array

Ack

Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 14 lines

+patternProperties:
+  ".*-supply":
+    description:
+      Specified the phandle for various supplies

required:
  - compatible
-  - vout-supply

additionalProperties: false

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

I think it would be nice to also update the examples to show what a multi-supply instance would look like.

Ack. Will do that.

Quoted 2 lines

A slightly more descriptive subject line would also be good -- "Add dt property" is a bit vague.

Suggestion ?
How about like 'Allow multiple supplies' or 'Add support for multiple supplies'

Sure, both of those sound fine to me.

Thanks :)

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines

base-commit: c55470f8b0616b0adb758077dbae9b19c5aac005

Signature · 1 line
2.39.1

Regards,
Naresh

Regards,
Naresh

maintainer
#10 lore raw
In reply to Naresh Solanki
Quoted 51 lines · Naresh Solanki

Hi Zev,

Quoted 20 lines · Zev Weiss
Quoted 19 lines · Naresh Solanki

Add DT property regulator-supplies.
This enables us to couple one or more regulator output to gether. This is use in case of Single connector having 2 or more supplies.

---
.../bindings/regulator/regulator-output.yaml         | 12 +++++++++---

1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/regulator/regulator-output.yaml b/Documentation/devicetree/bindings/regulator/regulator-output.yaml index 078b37a1a71a..17f683d3c1f3 100644

Documentation/devicetree/bindings/regulator/regulator-output.yaml +0 -0
@@ -21,13 +21,19 @@ properties:

  compatible:
    const: regulator-output

Quoted 11 lines
Quoted 8 lines

-  vout-supply:
+  regulator-supplies:
    description:
-      Phandle of the regulator supplying the output.
+      Specifies the name of the output supply provided by the regulator. +      Defaults to "vout".
+    default: "vout"
+

Was this meant to be specified as a string-array to allow providing multiple names?

Yes. This is string-array.

Quoted 10 lines
Quoted 10 lines

+patternProperties:
+  ".*-supply":
+    description:
+      Specified the phandle for various supplies

required:
  - compatible
-  - vout-supply

Quoted 6 lines
Quoted 3 lines

additionalProperties: false

I think it would be nice to also update the examples to show what a multi-supply instance would look like.

Quoted 7 lines

Ack. Will do that.

Quoted 3 lines

A slightly more descriptive subject line would also be good -- "Add dt property" is a bit vague.

Suggestion ?
How about like 'Allow multiple supplies' or 'Add support for multiple supplies'

And indicate this is for regulator-output, As-is looks like it's something for all regulators.

Rob

#11 lore raw

Hi Rob,

Quoted 54 lines · Rob Herring
Quoted 53 lines · Naresh Solanki

Hi Zev,

Quoted 20 lines · Zev Weiss
Quoted 19 lines · Naresh Solanki

Add DT property regulator-supplies.
This enables us to couple one or more regulator output to gether. This is use in case of Single connector having 2 or more supplies.

---
.../bindings/regulator/regulator-output.yaml         | 12 +++++++++---

1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/regulator/regulator-output.yaml b/Documentation/devicetree/bindings/regulator/regulator-output.yaml index 078b37a1a71a..17f683d3c1f3 100644

Documentation/devicetree/bindings/regulator/regulator-output.yaml +0 -0
@@ -21,13 +21,19 @@ properties:
   compatible:
     const: regulator-output
 
Quoted 11 lines

Documentation/devicetree/bindings/regulator/regulator-output.yaml properties: · line 29

Quoted 8 lines
Documentation/devicetree/bindings/regulator/regulator-output.yaml +5 -2
-  vout-supply:
+  regulator-supplies:
     description:
-      Phandle of the regulator supplying the output.
+      Specifies the name of the output supply provided by the regulator.
+      Defaults to "vout".
+    default: "vout"
+

Was this meant to be specified as a string-array to allow providing multiple names?

Yes. This is string-array.

Quoted 10 lines
Quoted 10 lines
Documentation/devicetree/bindings/regulator/regulator-output.yaml +4 -0
+patternProperties:
+  ".*-supply":
+    description:
+      Specified the phandle for various supplies
 

required:
  - compatible
-  - vout-supply

Quoted 6 lines
Quoted 3 lines

additionalProperties: false

I think it would be nice to also update the examples to show what a multi-supply instance would look like.

Ack. Will do that.

Quoted 1 line
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

A slightly more descriptive subject line would also be good -- "Add dt property" is a bit vague.

Suggestion ?
How about like 'Allow multiple supplies' or 'Add support for multiple supplies'

And indicate this is for regulator-output, As-is looks like it's something for all regulators.

Thanks for bringing that to my notice. Will make:
dt-bindings: regulator-output: Add dt property

Quoted 2 lines

Rob

Regards,
Naresh