Skip to contentSkip to conversation

Documentation: dt-bindings: Use generic property for hardware enable pins

PATCH In review Milo Kim 3 participants 7 messages Feb 28, 2017 – Mar 7, 2017

Subsystems (2)
lore
Share & tools
lore

Milo Kim

author
#0 lore raw

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

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.

---
 .../bindings/regulator/lm363x-regulator.txt        | 78 +++++++++++++++++++++-
 1 file changed, 76 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/regulator/lm363x-regulator.txt +76 -2
index 8f14df9d1205..cc5a6151d85f 100644
@@ -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
Signature · 1 line
2.11.0
author
#1 lore raw

PATCH 2/2 regulator: lm363x: Use generic DT property name for external control pins

Vpos and Vneg LDOs can be enabled or disabled by external GPIOs. Use general DT property 'enable-gpios' for this usage. Two enable pins are differentiable by selecting the index number.

---
 drivers/regulator/lm363x-regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/regulator/lm363x-regulator.c +2 -2
index f53e63301a20..ce5f7d9ad475 100644
@@ -227,9 +227,9 @@ static int lm363x_regulator_of_get_enable_gpio(struct device_node *np, int id)
 	 */
 	switch (id) {
 	case LM3632_LDO_POS:
-		return of_get_named_gpio(np, "ti,lcm-en1-gpio", 0);
+		return of_get_named_gpio(np, "enable-gpios", 0);
 	case LM3632_LDO_NEG:
-		return of_get_named_gpio(np, "ti,lcm-en2-gpio", 0);
+		return of_get_named_gpio(np, "enable-gpios", 1);
 	default:
 		return -EINVAL;
 	}
Signature · 6 lines
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer
#2 lore raw

Applied "regulator: lm363x: Use generic DT property name for external control pins" to the regulator tree

The patch

regulator: lm363x: Use generic DT property name for external control pins

has been applied to the regulator tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 9503b5085fd0e7cfc6e32b1a473a997303d7e26a Mon Sep 17 00:00:00 2001

From: Milo Kim <[email protected]>
Date: Tue, 28 Feb 2017 16:50:41 +0900
Subject: [PATCH] regulator: lm363x: Use generic DT property name for external
control pins

Vpos and Vneg LDOs can be enabled or disabled by external GPIOs. Use general DT property 'enable-gpios' for this usage. Two enable pins are differentiable by selecting the index number.

---
 drivers/regulator/lm363x-regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/regulator/lm363x-regulator.c +2 -2
index f53e63301a20..ce5f7d9ad475 100644
@@ -227,9 +227,9 @@ static int lm363x_regulator_of_get_enable_gpio(struct device_node *np, int id)
 	 */
 	switch (id) {
 	case LM3632_LDO_POS:
-		return of_get_named_gpio(np, "ti,lcm-en1-gpio", 0);
+		return of_get_named_gpio(np, "enable-gpios", 0);
 	case LM3632_LDO_NEG:
-		return of_get_named_gpio(np, "ti,lcm-en2-gpio", 0);
+		return of_get_named_gpio(np, "enable-gpios", 1);
 	default:
 		return -EINVAL;
 	}
Signature · 6 lines
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer
#3 lore raw
In reply to Milo Kim
Quoted 14 lines · Milo Kim

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.

---
 .../bindings/regulator/lm363x-regulator.txt        | 78 +++++++++++++++++++++-
 1 file changed, 76 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/regulator/lm363x-regulator.txt +0 -0
index 8f14df9d1205..cc5a6151d85f 100644

Documentation/devicetree/bindings/regulator/lm363x-regulator.txt Required property: · line 12

Quoted 7 lines
Documentation/devicetree/bindings/regulator/lm363x-regulator.txt +2 -2
@@ -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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#4 lore raw
Quoted 16 lines · Rob Herring
Quoted 15 lines · Milo Kim

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.

---
 .../bindings/regulator/lm363x-regulator.txt        | 78 +++++++++++++++++++++-
 1 file changed, 76 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/regulator/lm363x-regulator.txt +0 -0
index 8f14df9d1205..cc5a6151d85f 100644
@@ -8,8 +8,8 @@ Required property:
 
Quoted 10 lines

Documentation/devicetree/bindings/regulator/lm363x-regulator.txt Required property: · line 12

Quoted 6 lines
Documentation/devicetree/bindings/regulator/lm363x-regulator.txt +2 -2
 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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#5 lore raw
In reply to Milo Kim
Quoted 3 lines · Milo Kim

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.

maintainer
#6 lore raw

Applied "regulator: lm363x: Use generic property for hardware enable pins" to the regulator tree

In reply to Milo Kim

The patch

regulator: lm363x: Use generic property for hardware enable pins

has been applied to the regulator tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 45493684f5953d83cb2621027ad0792d167bedab Mon Sep 17 00:00:00 2001

From: Milo Kim <[email protected]>
Date: Tue, 28 Feb 2017 16:50:40 +0900
Subject: [PATCH] regulator: lm363x: Use generic property for hardware enable
pins

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.

---
 .../bindings/regulator/lm363x-regulator.txt        | 78 +++++++++++++++++++++-
 1 file changed, 76 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/regulator/lm363x-regulator.txt +76 -2
index 8f14df9d1205..cc5a6151d85f 100644
@@ -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
Signature · 1 line
2.11.0