Skip to contentSkip to conversation

regulator: gpio: Document regulator-type property

PATCH In review Mark Brown 2 participants 5 messages Dec 5, 2013

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

PATCH 1/2 regulator: gpio: Document regulator-type property

From: Mark Brown <[email protected]>

---
 Documentation/devicetree/bindings/regulator/gpio-regulator.txt | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/regulator/gpio-regulator.txt +2 -0
index 63c659800c03..aaf5f66e66fb 100644
@@ -10,6 +10,8 @@ Optional properties:
 - gpios			: GPIO group used to control voltage.
 - startup-delay-us	: Startup time in microseconds.
 - enable-active-high	: Polarity of GPIO is active high (default is low).
+- regulator-type	: Specifies what is being regulated, must be either
+			  "voltage" or "current"
 
 Any property defined as part of the core regulator binding defined in
 regulator.txt can also be used.
Signature · 1 line
1.8.5.1
author maintainer
#1 lore raw

PATCH 2/2 regulator: gpio: Warn if an invalid regulator-type is supplied

From: Mark Brown <[email protected]>

---
 drivers/regulator/gpio-regulator.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/regulator/gpio-regulator.c +3 -0
index 13ec94d984ca..c0a1d00b78c9 100644
@@ -210,6 +210,9 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np)
 			config->type = REGULATOR_VOLTAGE;
 		else if (!strncmp("current", regtype, 7))
 			config->type = REGULATOR_CURRENT;
+		else
+			dev_warn(dev, "Unknown regulator-type '%s'\n",
+				 regtype);
 	}
 
 	return config;
Signature · 1 line
1.8.5.1
Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] regulator: gpio: Warn if an invalid regulator-type is supplied

Hi Mark,

Thank you for the patch.

Quoted 4 lines · On Thursday 05 December 2013 19:12:02 Mark Brown wrote:

From: Mark Brown <[email protected]>

I believe you could squash this patch with the one you've previously posted that makes the property optional. For the result,

Quoted 19 lines
---
 drivers/regulator/gpio-regulator.c | 3 +++
 1 file changed, 3 insertions(+)
(quoted diff) +0 -0

b/drivers/regulator/gpio-regulator.c index 13ec94d984ca..c0a1d00b78c9 100644

drivers/regulator/gpio-regulator.c +3 -0
@@ -210,6 +210,9 @@ of_get_gpio_regulator_config(struct device *dev, struct
 device_node *np) config->type = REGULATOR_VOLTAGE;
 		else if (!strncmp("current", regtype, 7))
 			config->type = REGULATOR_CURRENT;
+		else
+			dev_warn(dev, "Unknown regulator-type '%s'\n",
+				 regtype);
 	}
 
 	return config;
Signature · 3 lines
Regards,

Laurent Pinchart
#3 lore raw
In reply to Mark Brown

Hi Mark,

Thank you for the patch.

Quoted 14 lines · On Thursday 05 December 2013 19:12:01 Mark Brown wrote:

From: Mark Brown <[email protected]>

---
 Documentation/devicetree/bindings/regulator/gpio-regulator.txt | 2 ++
 1 file changed, 2 insertions(+)
(quoted diff) +0 -0

b/Documentation/devicetree/bindings/regulator/gpio-regulator.txt index 63c659800c03..aaf5f66e66fb 100644

Documentation/devicetree/bindings/regulator/gpio-regulator.txt Optional properties: · line 14

Quoted 5 lines
Documentation/devicetree/bindings/regulator/gpio-regulator.txt +2 -0
@@ -10,6 +10,8 @@ Optional properties:
 - gpios			: GPIO group used to control voltage.
 - startup-delay-us	: Startup time in microseconds.
 - enable-active-high	: Polarity of GPIO is active high (default is low).
+- regulator-type	: Specifies what is being regulated, must be either
+			  "voltage" or "current"

What about adding "The type defaults to voltage if unspecified." ?

Quoted 2 lines
Documentation/devicetree/bindings/regulator/gpio-regulator.txt +0 -0
 Any property defined as part of the core regulator binding defined in
 regulator.txt can also be used.
Signature · 3 lines
Regards,

Laurent Pinchart
author maintainer
#4 lore raw
Quoted 6 lines · Laurent Pinchart

Documentation/devicetree/bindings/regulator/gpio-regulator.txt Optional properties: · line 14

Quoted 2 lines · On Thursday 05 December 2013 19:12:01 Mark Brown wrote:

+- regulator-type : Specifies what is being regulated, must be either

Documentation/devicetree/bindings/regulator/gpio-regulator.txt +1 -0
+			  "voltage" or "current"

What about adding "The type defaults to voltage if unspecified." ?

I was trying to think of a stronger wording for that - more like "if specified at all should say "current", "voltage" is also supported for legacy reasons and is the default.". I'm not even sure about documenting voltage here.