diff mbox

[1/2] Documentation: dt-bindings: Use generic property for hardware enable pins

Message ID 20170228075041.7568-1-milo.kim@ti.com
State Changes Requested, archived
Headers show

Commit Message

Kim, Milo Feb. 28, 2017, 7:50 a.m. UTC
With index usages, device specific properties can be replaced with generic
one. Vpos is index 0 and Vneg is index 1.
DT examples are added as well.

Signed-off-by: Milo Kim <milo.kim@ti.com>
---
 .../bindings/regulator/lm363x-regulator.txt        | 78 +++++++++++++++++++++-
 1 file changed, 76 insertions(+), 2 deletions(-)

Comments

Rob Herring March 3, 2017, 6:21 a.m. UTC | #1
On Tue, Feb 28, 2017 at 04:50:40PM +0900, Milo Kim wrote:
> With index usages, device specific properties can be replaced with generic
> one. Vpos is index 0 and Vneg is index 1.
> DT examples are added as well.
> 
> Signed-off-by: Milo Kim <milo.kim@ti.com>
> ---
>  .../bindings/regulator/lm363x-regulator.txt        | 78 +++++++++++++++++++++-
>  1 file changed, 76 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/regulator/lm363x-regulator.txt b/Documentation/devicetree/bindings/regulator/lm363x-regulator.txt
> index 8f14df9d1205..cc5a6151d85f 100644
> --- a/Documentation/devicetree/bindings/regulator/lm363x-regulator.txt
> +++ b/Documentation/devicetree/bindings/regulator/lm363x-regulator.txt
> @@ -8,8 +8,8 @@ Required property:
>  
>  Optional properties:
>    LM3632 has external enable pins for two LDOs.
> -  - ti,lcm-en1-gpio: A GPIO specifier for Vpos control pin.
> -  - ti,lcm-en2-gpio: A GPIO specifier for Vneg control pin.
> +  - enable-gpios: Two GPIO specifiers for Vpos and Vneg control pins.
> +                  The first entry is Vpos, the second is Vneg enable pin.

You're breaking compatibility with existing DTBs. You need to explain 
that and why it is okay in the commit message. In this case, I don't 
think it is okay as this chip could be used across vendors' platforms.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kim, Milo March 3, 2017, 6:56 a.m. UTC | #2
On 3/3/2017 3:21 PM, Rob Herring wrote:
> On Tue, Feb 28, 2017 at 04:50:40PM +0900, Milo Kim wrote:
>> With index usages, device specific properties can be replaced with generic
>> one. Vpos is index 0 and Vneg is index 1.
>> DT examples are added as well.
>>
>> Signed-off-by: Milo Kim <milo.kim@ti.com>
>> ---
>>  .../bindings/regulator/lm363x-regulator.txt        | 78 +++++++++++++++++++++-
>>  1 file changed, 76 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/regulator/lm363x-regulator.txt b/Documentation/devicetree/bindings/regulator/lm363x-regulator.txt
>> index 8f14df9d1205..cc5a6151d85f 100644
>> --- a/Documentation/devicetree/bindings/regulator/lm363x-regulator.txt
>> +++ b/Documentation/devicetree/bindings/regulator/lm363x-regulator.txt
>> @@ -8,8 +8,8 @@ Required property:
>>
>>  Optional properties:
>>    LM3632 has external enable pins for two LDOs.
>> -  - ti,lcm-en1-gpio: A GPIO specifier for Vpos control pin.
>> -  - ti,lcm-en2-gpio: A GPIO specifier for Vneg control pin.
>> +  - enable-gpios: Two GPIO specifiers for Vpos and Vneg control pins.
>> +                  The first entry is Vpos, the second is Vneg enable pin.
>
> You're breaking compatibility with existing DTBs. You need to explain
> that and why it is okay in the commit message. In this case, I don't
> think it is okay as this chip could be used across vendors' platforms.

Thanks for your comment.

The lm363x-regulator has a dependency on ti-lmu MFD driver which is not 
upstreamed. So I don't think this patch will break the compatibility 
because two properties are not used anywhere at this moment.
Please correct me if it's incorrect.

Using general DT property is simple/clear because two enable pins are 
differentiable by selecting the index number. That's the main reason of 
this patch.

Best regards,
Milo
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mark Brown March 7, 2017, 1:56 p.m. UTC | #3
On Tue, Feb 28, 2017 at 04:50:40PM +0900, Milo Kim wrote:
> With index usages, device specific properties can be replaced with generic
> one. Vpos is index 0 and Vneg is index 1.
> DT examples are added as well.

Please use subject lines matching the style for the subsystem.  This
makes it easier for people to identify relevant patches.
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/regulator/lm363x-regulator.txt b/Documentation/devicetree/bindings/regulator/lm363x-regulator.txt
index 8f14df9d1205..cc5a6151d85f 100644
--- a/Documentation/devicetree/bindings/regulator/lm363x-regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/lm363x-regulator.txt
@@ -8,8 +8,8 @@  Required property:
 
 Optional properties:
   LM3632 has external enable pins for two LDOs.
-  - ti,lcm-en1-gpio: A GPIO specifier for Vpos control pin.
-  - ti,lcm-en2-gpio: A GPIO specifier for Vneg control pin.
+  - enable-gpios: Two GPIO specifiers for Vpos and Vneg control pins.
+                  The first entry is Vpos, the second is Vneg enable pin.
 
 Child nodes:
   LM3631
@@ -30,5 +30,79 @@  Child nodes:
 
 Examples: Please refer to ti-lmu dt-bindings [2].
 
+lm3631@29 {
+	compatible = "ti,lm3631";
+	reg = <0x29>;
+
+	regulators {
+		compatible = "ti,lm363x-regulator";
+
+		vboost {
+			regulator-name = "lcd_boost";
+			regulator-min-microvolt = <4500000>;
+			regulator-max-microvolt = <6350000>;
+			regulator-always-on;
+		};
+
+		vcont {
+			regulator-name = "lcd_vcont";
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <3300000>;
+		};
+
+		voref {
+			regulator-name = "lcd_voref";
+			regulator-min-microvolt = <4000000>;
+			regulator-max-microvolt = <6000000>;
+		};
+
+		vpos {
+			regulator-name = "lcd_vpos";
+			regulator-min-microvolt = <4000000>;
+			regulator-max-microvolt = <6000000>;
+			regulator-boot-on;
+		};
+
+		vneg {
+			regulator-name = "lcd_vneg";
+			regulator-min-microvolt = <4000000>;
+			regulator-max-microvolt = <6000000>;
+			regulator-boot-on;
+		};
+	};
+};
+
+lm3632@11 {
+	compatible = "ti,lm3632";
+	reg = <0x11>;
+
+	regulators {
+		compatible = "ti,lm363x-regulator";
+
+		/* GPIO1_16 for Vpos, GPIO1_28 is for Vneg */
+		enable-gpios = <&gpio1 16 GPIO_ACTIVE_HIGH>,
+				<&gpio1 28 GPIO_ACTIVE_HIGH>;
+
+		vboost {
+			regulator-name = "lcd_boost";
+			regulator-min-microvolt = <4500000>;
+			regulator-max-microvolt = <6400000>;
+			regulator-always-on;
+		};
+
+		vpos {
+			regulator-name = "lcd_vpos";
+			regulator-min-microvolt = <4000000>;
+			regulator-max-microvolt = <6000000>;
+		};
+
+		vneg {
+			regulator-name = "lcd_vneg";
+			regulator-min-microvolt = <4000000>;
+			regulator-max-microvolt = <6000000>;
+		};
+	};
+};
+
 [1] ../regulator/regulator.txt
 [2] ../mfd/ti-lmu.txt