regulator: gpio: Document regulator-type property
Subsystems (2)
Mark Brown
maintainerPATCH 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
@@ -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
Mark Brown
maintainerPATCH 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
@@ -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
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]>
Reported-by Laurent Pinchart <[email protected]>Signed-off-by 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.cindex13ec94d984ca..c0a1d00b78c9100644drivers/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
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]>
Reported-by Laurent Pinchart <[email protected]>Signed-off-by 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.txtindex63c659800c03..aaf5f66e66fb100644
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
-0Any property defined as part of the core regulator binding defined in regulator.txt can also be used.
Signature · 3 lines
Regards, Laurent Pinchart
Mark Brown
maintainerQuoted 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.