Skip to contentSkip to conversation

Document GPIO regulator regulator-type property and use it

PATCH New Laurent Pinchart 4 participants 12 messages Nov 28, 2013 – May 21, 2014

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

cover Document GPIO regulator regulator-type property and use it

Hello,

This patch set documents the required regulator-type property for the GPIO regulator DT bindings and uses it in the Renesas Armadillo DT.

I've checked the DT files in mainline and all the GPIO regulator nodes but the one in r8a7740-armadillo800eva-reference.dts specify the regulator-type property.

Laurent Pinchart (2):
regulator: gpio-regulator: Add required regulator-type property
ARM: shmobile: armadillo: Set vccq_sdhi0 regulator type in DT

 Documentation/devicetree/bindings/regulator/gpio-regulator.txt | 2 ++
 arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts        | 2 ++
 2 files changed, 4 insertions(+)
Signature · 3 lines
Regards,

Laurent Pinchart
#1 lore raw

PATCH 1/2 regulator: gpio-regulator: Add required regulator-type property

The gpio-regulator driver requires the regulator-type property to be present. Document it as required in the DT bindings.

---
 Documentation/devicetree/bindings/regulator/gpio-regulator.txt | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/regulator/gpio-regulator.txt +2 -0
index 63c6598..a560711 100644
@@ -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>;
Signature · 1 line
1.8.3.2
maintainer
#2 lore raw

PATCH 1/2 regulator: gpio-regulator: Add required regulator-type property

Quoted 2 lines · Laurent Pinchart

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...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131205/bc4bd07d/attachment.sig>

#3 lore raw

PATCH 1/2 regulator: gpio-regulator: Add required regulator-type property

Hi Mark,

Quoted 9 lines · On Thursday 05 December 2013 00:09:28 Mark Brown wrote:
Quoted 2 lines · Laurent Pinchart

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.

Quoted 1 line

Please CC maintainers...

My bad, sorry.

Signature · 10 lines
Regards,

Laurent Pinchart
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131205/410b02e8/attachment-0001.sig>
#4 lore raw

PATCH 1/2 regulator: gpio-regulator: Add required regulator-type property

Hi Mark,

Quoted 12 lines · On Thursday 05 December 2013 01:47:04 Laurent Pinchart wrote:
Quoted 10 lines · On Thursday 05 December 2013 00:09:28 Mark Brown wrote:
Quoted 2 lines · Laurent Pinchart

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.

Quoted 3 lines

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 ?

Quoted 3 lines
Quoted 1 line

Please CC maintainers...

My bad, sorry.

Signature · 3 lines
Regards,

Laurent Pinchart
maintainer
#5 lore raw

PATCH 1/2 regulator: gpio-regulator: Add required regulator-type property

Quoted 6 lines · Laurent Pinchart

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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140513/2d8bbbc9/attachment.sig>

#6 lore raw

PATCH 1/2 regulator: gpio-regulator: Add required regulator-type property

Quoted 9 lines · On Tuesday 13 May 2014 17:59:21 Mark Brown wrote:
Quoted 7 lines · Laurent Pinchart

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 ?

Quoted 3 lines

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 ?

Signature · 10 lines
Regards,

Laurent Pinchart
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140521/2ea3bf88/attachment.sig>
maintainer
#7 lore raw

PATCH 1/2 regulator: gpio-regulator: Add required regulator-type property

Quoted 7 lines · Laurent Pinchart
Quoted 3 lines · 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140521/16d467a7/attachment.sig>

#8 lore raw

PATCH 2/2 ARM: shmobile: armadillo: Set vccq_sdhi0 regulator type in DT

In reply to Laurent Pinchart

The mandatory regulator-type property is missing, add it.

---
 arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts +2 -0
index 7b80f19..013a7cd 100644
@@ -53,6 +53,8 @@
 		regulator-name = "SDHI0 VccQ";
 		regulator-min-microvolt = <1800000>;
 		regulator-max-microvolt = <3300000>;
+		regulator-type = "voltage";
+
 		vin-supply = <&vcc_sdhi0>;
 
 		enable-gpio = <&pfc 74 GPIO_ACTIVE_HIGH>;
Signature · 1 line
1.8.3.2
#9 lore raw

PATCH 2/2 ARM: shmobile: armadillo: Set vccq_sdhi0 regulator type in DT

Quoted 1 line · Laurent Pinchart

The mandatory regulator-type property is missing, add it.

Thanks, I will queue this up.

Quoted 27 lines
---
 arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts +2 -0
index 7b80f19..013a7cd 100644
@@ -53,6 +53,8 @@
 		regulator-name = "SDHI0 VccQ";
 		regulator-min-microvolt = <1800000>;
 		regulator-max-microvolt = <3300000>;
+		regulator-type = "voltage";
+
 		vin-supply = <&vcc_sdhi0>;
 
 		enable-gpio = <&pfc 74 GPIO_ACTIVE_HIGH>;
Signature · 6 lines
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#10 lore raw

PATCH 2/2 ARM: shmobile: armadillo: Set vccq_sdhi0 regulator type in DT

Hi Simon,

Quoted 4 lines · On Thursday 05 December 2013 12:45:54 Simon Horman wrote:
Quoted 1 line · Laurent Pinchart

The mandatory regulator-type property is missing, add it.

Thanks, I will queue this up.

Mark has rightfully commented on patch 1/2 in this series that the regulator- type property shouldn't be mandatory but should default to voltage. We could then drop this patch.

Quoted 24 lines
Quoted 24 lines

Signed-off-by: Laurent Pinchart
<[email protected]>
---

 arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts | 2 ++
 1 file changed, 2 insertions(+)
(quoted diff) +0 -0

b/arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts index 7b80f19..013a7cd 100644

arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts +2 -0
@@ -53,6 +53,8 @@
 
 		regulator-name = "SDHI0 VccQ";
 		regulator-min-microvolt = <1800000>;
 		regulator-max-microvolt = <3300000>;
 
+		regulator-type = "voltage";
+
 
arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts +0 -0
 		vin-supply = <&vcc_sdhi0>;
 
 		enable-gpio = <&pfc 74 GPIO_ACTIVE_HIGH>;
Signature · 3 lines
Regards,

Laurent Pinchart
#11 lore raw

PATCH 2/2 ARM: shmobile: armadillo: Set vccq_sdhi0 regulator type in DT

Quoted 11 lines · Laurent Pinchart

Hi Simon,

Quoted 4 lines · On Thursday 05 December 2013 12:45:54 Simon Horman wrote:
Quoted 1 line · Laurent Pinchart

The mandatory regulator-type property is missing, add it.

Thanks, I will queue this up.

Mark has rightfully commented on patch 1/2 in this series that the regulator- type property shouldn't be mandatory but should default to voltage. We could then drop this patch.

I will drop it, thanks.

Quoted 34 lines
Quoted 24 lines
Quoted 24 lines

Signed-off-by: Laurent Pinchart
<[email protected]>
---

 arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts | 2 ++
 1 file changed, 2 insertions(+)
(quoted diff) +0 -0

b/arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts index 7b80f19..013a7cd 100644

arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts +2 -0
@@ -53,6 +53,8 @@
 
 		regulator-name = "SDHI0 VccQ";
 		regulator-min-microvolt = <1800000>;
 		regulator-max-microvolt = <3300000>;
 
+		regulator-type = "voltage";
+
 
arch/arm/boot/dts/r8a7740-armadillo800eva-reference.dts +0 -0
 		vin-supply = <&vcc_sdhi0>;
 
 		enable-gpio = <&pfc 74 GPIO_ACTIVE_HIGH>;
Signature · 8 lines
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html