diff mbox

[1/2] regulator: gpio-regulator: Add required regulator-type property

Message ID 1385653493-9952-2-git-send-email-laurent.pinchart+renesas@ideasonboard.com (mailing list archive)
State New, archived
Headers show

Commit Message

Laurent Pinchart Nov. 28, 2013, 3:44 p.m. UTC
The gpio-regulator driver requires the regulator-type property to be
present. Document it as required in the DT bindings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 Documentation/devicetree/bindings/regulator/gpio-regulator.txt | 2 ++
 1 file changed, 2 insertions(+)

Comments

Mark Brown Dec. 5, 2013, 12:09 a.m. UTC | #1
On Thu, Nov 28, 2013 at 04:44:52PM +0100, Laurent Pinchart wrote:
> The gpio-regulator driver requires the regulator-type property to be
> present. Document it as required in the DT bindings.

It does?  That seems needless.  It should just default to voltage and
provide a way override to current, though frankly I'd be astonished to
see a GPIO controlled current regulator at all so I'm not sure I'd even
bother writing the code for that until someone needs it.  As it is this
will most likely just be noise in the DT files and wasted cycles parsing
the property.

Please CC maintainers...
Laurent Pinchart Dec. 5, 2013, 12:47 a.m. UTC | #2
Hi Mark,

On Thursday 05 December 2013 00:09:28 Mark Brown wrote:
> On Thu, Nov 28, 2013 at 04:44:52PM +0100, Laurent Pinchart wrote:
> > The gpio-regulator driver requires the regulator-type property to be
> > present. Document it as required in the DT bindings.
> 
> It does?  That seems needless.  It should just default to voltage and
> provide a way override to current, though frankly I'd be astonished to see a
> GPIO controlled current regulator at all so I'm not sure I'd even bother
> writing the code for that until someone needs it.  As it is this will most
> likely just be noise in the DT files and wasted cycles parsing the property.

I'm fine with that. The property should still be documented in the DT bindings 
as optional though. Or be removed completely until a GPIO-controlled current 
regulator is needed.

> Please CC maintainers...

My bad, sorry.
Laurent Pinchart May 13, 2014, 12:06 a.m. UTC | #3
Hi Mark,

On Thursday 05 December 2013 01:47:04 Laurent Pinchart wrote:
> On Thursday 05 December 2013 00:09:28 Mark Brown wrote:
> > On Thu, Nov 28, 2013 at 04:44:52PM +0100, Laurent Pinchart wrote:
> > > The gpio-regulator driver requires the regulator-type property to be
> > > present. Document it as required in the DT bindings.
> > 
> > It does?  That seems needless.  It should just default to voltage and
> > provide a way override to current, though frankly I'd be astonished to see
> > a GPIO controlled current regulator at all so I'm not sure I'd even
> > bother writing the code for that until someone needs it.  As it is this
> > will most likely just be noise in the DT files and wasted cycles parsing
> > the property.
>
> I'm fine with that. The property should still be documented in the DT
> bindings as optional though. Or be removed completely until a
> GPIO-controlled current regulator is needed.

What's the status of this ? The gpio regulator driver now defaults to voltage 
regulator when the regulator-type property is not set. Should the DT bindings 
document the property as optional (I can submit a patch for that), or do you 
consider that the gpio regulator driver should support voltage regulators only 
when used with DT, and just keep the regulator-type property support in the 
driver for backward compatibility ?

> > Please CC maintainers...
> 
> My bad, sorry.
Mark Brown May 13, 2014, 4:59 p.m. UTC | #4
On Tue, May 13, 2014 at 02:06:23AM +0200, Laurent Pinchart wrote:

> What's the status of this ? The gpio regulator driver now defaults to voltage 
> regulator when the regulator-type property is not set. Should the DT bindings 
> document the property as optional (I can submit a patch for that), or do you 
> consider that the gpio regulator driver should support voltage regulators only 
> when used with DT, and just keep the regulator-type property support in the 
> driver for backward compatibility ?

I don't really care either way, I did write a patch for the bindings but
there was some language lawyering over it and I never cared enough to
get round to updating it.
Laurent Pinchart May 21, 2014, 1:44 p.m. UTC | #5
On Tuesday 13 May 2014 17:59:21 Mark Brown wrote:
> On Tue, May 13, 2014 at 02:06:23AM +0200, Laurent Pinchart wrote:
> > What's the status of this ? The gpio regulator driver now defaults to
> > voltage regulator when the regulator-type property is not set. Should the
> > DT bindings document the property as optional (I can submit a patch for
> > that), or do you consider that the gpio regulator driver should support
> > voltage regulators only when used with DT, and just keep the
> > regulator-type property support in the driver for backward compatibility
> > ?
> 
> I don't really care either way, I did write a patch for the bindings but
> there was some language lawyering over it and I never cared enough to
> get round to updating it.

Could you please point me to the patch ?
Mark Brown May 21, 2014, 2:22 p.m. UTC | #6
On Wed, May 21, 2014 at 03:44:56PM +0200, Laurent Pinchart wrote:
> On Tuesday 13 May 2014 17:59:21 Mark Brown wrote:

> > I don't really care either way, I did write a patch for the bindings but
> > there was some language lawyering over it and I never cared enough to
> > get round to updating it.

> Could you please point me to the patch ?

I appear to have discarded it I'm afraid.
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/regulator/gpio-regulator.txt b/Documentation/devicetree/bindings/regulator/gpio-regulator.txt
index 63c6598..a560711 100644
--- a/Documentation/devicetree/bindings/regulator/gpio-regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/gpio-regulator.txt
@@ -4,6 +4,7 @@  Required properties:
 - compatible		: Must be "regulator-gpio".
 - states		: Selection of available voltages and GPIO configs.
                           if there are no states, then use a fixed regulator
+- regulator-type	: Must be either "voltage" or "current".
 
 Optional properties:
 - enable-gpio		: GPIO to use to enable/disable the regulator.
@@ -22,6 +23,7 @@  Example:
 		regulator-name = "mmci-gpio-supply";
 		regulator-min-microvolt = <1800000>;
 		regulator-max-microvolt = <2600000>;
+		regulator-type = "voltage";
 		regulator-boot-on;
 
 		enable-gpio = <&gpio0 23 0x4>;