diff mbox

[2/2] Documentation: Describe Device Tree bindings for GPIO Regulator driver

Message ID 1350307020-5910-2-git-send-email-lee.jones@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Lee Jones Oct. 15, 2012, 1:17 p.m. UTC
Here we specify all non-standard bindings which can be used when
requesting the use of an GPIO controlled regulator from Device Tree.

Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 .../bindings/regulator/gpio-regulator.txt          |   25 ++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/gpio-regulator.txt

Comments

Arnd Bergmann Oct. 15, 2012, 2:10 p.m. UTC | #1
On Monday 15 October 2012, Lee Jones wrote:
> diff --git a/Documentation/devicetree/bindings/regulator/gpio-regulator.txt b/Documentation/devicetree/bindings/regulator/gpio-regulator.txt
> new file mode 100644
> index 0000000..5f77ee0
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/gpio-regulator.txt
> @@ -0,0 +1,25 @@
> +GPIO controlled regulators
> +
> +Required properties:
> +- compatible            : Must be "regulator-gpio".
> +
> +Optional properties:
> +- gpio-enable           : GPIO to use to enable/disable the regulator.
> +- startup-delay-us      : Startup time in microseconds.
> +- enable-active-high    : Polarity of GPIO is active high (default is low).
> +
> +Any property defined as part of the core regulator binding defined in
> +regulator.txt can also be used.
> +
> +Example:
> +
> +       mmciv: gpio-regulator {
> +               compatible = "regulator-gpio";
> +               regulator-name = "mmci-gpio-supply";
> +               regulator-min-microvolt = <1800000>;
> +               regulator-max-microvolt = <2600000>;
> +               gpio = <&gpio0 24 0x4>;
> +               startup-delay-us = <100000>;
> +               enable-active-high;
> +               regulator-boot-on;
> +       };

The example doesn't match the documentation for the name of the gpio property
("gpio" vs. "gpio-enable"). I think the convention is to use "gpios".

Shouldn't this property be mandatory? I think there is little point in
defining a gpio-regulator without a gpio line attached to it.

Finally, the "enable-active-high" looks redundant, as that is something
that is normally encoded in the "gpios" property.

	Arnd
Mark Brown Oct. 23, 2012, 9:45 a.m. UTC | #2
On Mon, Oct 15, 2012 at 02:17:00PM +0100, Lee Jones wrote:
> Here we specify all non-standard bindings which can be used when
> requesting the use of an GPIO controlled regulator from Device Tree.
> 
> Mark Brown <broonie@opensource.wolfsonmicro.com>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

The reason I didn't get this patch is that you didn't CC me on it...
notice what you've done above.
Lee Jones Oct. 23, 2012, 9:55 a.m. UTC | #3
On Tue, 23 Oct 2012, Mark Brown wrote:

> On Mon, Oct 15, 2012 at 02:17:00PM +0100, Lee Jones wrote:
> > Here we specify all non-standard bindings which can be used when
> > requesting the use of an GPIO controlled regulator from Device Tree.
> > 
> > Mark Brown <broonie@opensource.wolfsonmicro.com>
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> 
> The reason I didn't get this patch is that you didn't CC me on it...
> notice what you've done above.

Yes, I saw it and corrected it in the end, hence why you received
it when I resent - my bad.
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/regulator/gpio-regulator.txt b/Documentation/devicetree/bindings/regulator/gpio-regulator.txt
new file mode 100644
index 0000000..5f77ee0
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/gpio-regulator.txt
@@ -0,0 +1,25 @@ 
+GPIO controlled regulators
+
+Required properties:
+- compatible            : Must be "regulator-gpio".
+
+Optional properties:
+- gpio-enable           : GPIO to use to enable/disable the regulator.
+- startup-delay-us      : Startup time in microseconds.
+- enable-active-high    : Polarity of GPIO is active high (default is low).
+
+Any property defined as part of the core regulator binding defined in
+regulator.txt can also be used.
+
+Example:
+
+	mmciv: gpio-regulator {
+		compatible = "regulator-gpio";
+		regulator-name = "mmci-gpio-supply";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <2600000>;
+		gpio = <&gpio0 24 0x4>;
+		startup-delay-us = <100000>;
+		enable-active-high;
+		regulator-boot-on;
+	};