Skip to contentSkip to conversation

Device tree support for TWL regulators

PATCH Superseded Rajendra Nayak 2 participants 5 messages Feb 23, 2012 – Feb 24, 2012

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

v3 cover Device tree support for TWL regulators

Re-sending as these patches did not make it to the lists due to issues with my 'git send-email'

v3 has mainly 2 differences from v2
-1- TWL driver now uses just one table for both dt and non-dt based lookup for driver data.
-2- All common regulator nodes for twl4030 and twl6030 are now defined in the twl4030.dtsi and twl6030.dtsi instead of repeating the nodes in all board files, which also means the patch ('arm/dts: twl: Pass regulator data from dt') has a dependency with the series from Benoit which adds the twl4030.dtsi and twl6030.dtsi files[1].

I have tested the patches on omap4panda and omap3beagle boards.

[1] git://git.kernel.org/pub/scm/linux/kernel/git/bcousson/linux-omap-dt.git

	for_3.4/dt_i2c_twl

Rajendra Nayak (2):
regulator: twl: adapt twl-regulator driver to dt arm/dts: twl: Pass regulator data from dt

 .../bindings/regulator/twl-regulator.txt           |   63 ++++++
 arch/arm/boot/dts/omap3-beagle.dts                 |    6 +
 arch/arm/boot/dts/twl4030.dtsi                     |   18 ++
 arch/arm/boot/dts/twl6030.dtsi                     |   60 +++++
 drivers/regulator/twl-regulator.c                  |  227 +++++++++++++-------
 5 files changed, 301 insertions(+), 73 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/regulator/twl-regulator.txt
#1 lore raw

PATCH v3 1/2 regulator: twl: adapt twl-regulator driver to dt

Modify the twl regulator driver to extract the regulator_init_data from device tree when passed, instead of getting it through platform_data structures (on non-DT builds)

Also add documentation for TWL regulator specific bindings.

---
 .../bindings/regulator/twl-regulator.txt           |   63 ++++++
 drivers/regulator/twl-regulator.c                  |  227 +++++++++++++-------
 2 files changed, 217 insertions(+), 73 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/regulator/twl-regulator.txt
Documentation/devicetree/bindings/regulator/twl-regulator.txt new file +63 -0
new file mode 100644
index 0000000..074e344
@@ -0,0 +1,63 @@
+TWL family of regulators
+
+Required properties:
+For twl6030 regulators/LDOs
+- compatible:
+  - "ti,twl6030-vaux1" for VAUX1 LDO
+  - "ti,twl6030-vaux2" for VAUX2 LDO
+  - "ti,twl6030-vaux3" for VAUX3 LDO
+  - "ti,twl6030-vmmc" for VMMC LDO
+  - "ti,twl6030-vpp" for VPP LDO
+  - "ti,twl6030-vusim" for VUSIM LDO
+  - "ti,twl6030-vana" for VANA LDO
+  - "ti,twl6030-vcxio" for VCXIO LDO
+  - "ti,twl6030-vdac" for VDAC LDO
+  - "ti,twl6030-vusb" for VUSB LDO
+  - "ti,twl6030-clk32kg" for CLK32KG LDO
+For twl6025 regulators/LDOs
+- compatible:
+  - "ti,twl6025-ldo1" for LDO1 LDO
+  - "ti,twl6025-ldo2" for LDO2 LDO
+  - "ti,twl6025-ldo3" for LDO3 LDO
+  - "ti,twl6025-ldo4" for LDO4 LDO
+  - "ti,twl6025-ldo5" for LDO5 LDO
+  - "ti,twl6025-ldo6" for LDO6 LDO
+  - "ti,twl6025-ldo7" for LDO7 LDO
+  - "ti,twl6025-ldoln" for LDOLN LDO
+  - "ti,twl6025-ldousb" for LDOUSB LDO
+  - "ti,twl6025-smps3" for SMPS3 LDO
+  - "ti,twl6025-smps4" for SMPS4 LDO
+  - "ti,twl6025-vio" for VIO LDO
+For twl4030 regulators/LDOs
+- compatible:
+  - "ti,twl4030-vaux1" for VAUX1 LDO
+  - "ti,twl4030-vaux2" for VAUX2 LDO
+  - "ti,twl5030-vaux2" for VAUX2 LDO
+  - "ti,twl4030-vaux3" for VAUX3 LDO
+  - "ti,twl4030-vaux4" for VAUX4 LDO
+  - "ti,twl4030-vmmc1" for VMMC1 LDO
+  - "ti,twl4030-vmmc2" for VMMC2 LDO
+  - "ti,twl4030-vpll1" for VPLL1 LDO
+  - "ti,twl4030-vpll2" for VPLL2 LDO
+  - "ti,twl4030-vsim" for VSIM LDO
+  - "ti,twl4030-vdac" for VDAC LDO
+  - "ti,twl4030-vintana2" for VINTANA2 LDO
+  - "ti,twl4030-vio" for VIO LDO
+  - "ti,twl4030-vdd1" for VDD1 LDO
+  - "ti,twl4030-vdd2" for VDD2 LDO
+  - "ti,twl4030-vintana1" for VINTANA1 LDO
+  - "ti,twl4030-vintdig" for VINTDIG LDO
+  - "ti,twl4030-vusb1v5" for VUSB1V5 LDO
+  - "ti,twl4030-vusb1v8" for VUSB1V8 LDO
+  - "ti,twl4030-vusb3v1" for VUSB3V1 LDO
+
+Optional properties:
+- Any optional property defined in bindings/regulator/regulator.txt
+
+Example:
+
+	xyz: regulator at 0 {
+		compatible = "ti,twl6030-vaux1";
+		regulator-min-microvolt  = <1000000>;
+		regulator-max-microvolt  = <3000000>;
+	};
drivers/regulator/twl-regulator.c +154 -73

323 lines not on this page · raw message

Signature · 1 line
1.7.1
#2 lore raw

PATCH v3 1/2 regulator: twl: adapt twl-regulator driver to dt

Quoted 3 lines · Rajendra Nayak

Modify the twl regulator driver to extract the regulator_init_data from device tree when passed, instead of getting it through platform_data structures (on non-DT builds)

This doesn't apply to current -next, I expect because of the SMPS
regulator changes which went in. Please always submit patches against
-next. There's also a patch from Tero adding support for some
additional regulators which is floating around and would conflict with
this. Could you guys please coordinate with each other on this?
-------------- 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/20120223/e2644df1/attachment.sig>

#3 lore raw

PATCH v3 1/2 regulator: twl: adapt twl-regulator driver to dt

Quoted 10 lines · Mark Brown
Quoted 3 lines · Rajendra Nayak

Modify the twl regulator driver to extract the regulator_init_data from device tree when passed, instead of getting it through platform_data structures (on non-DT builds)

This doesn't apply to current -next, I expect because of the SMPS regulator changes which went in. Please always submit patches against -next. There's also a patch from Tero adding support for some additional regulators which is floating around and would conflict with this. Could you guys please coordinate with each other on this?

Sure, I will co-ordinate with Tero and post my patches against -next.

#4 lore raw

PATCH v3 2/2 arm/dts: twl: Pass regulator data from dt

In reply to Rajendra Nayak

Pass all the voltage regulator information for
twl6030/twl4030 PMIC from device tree.

---
 arch/arm/boot/dts/omap3-beagle.dts |    6 +++
 arch/arm/boot/dts/twl4030.dtsi     |   18 +++++++++++
 arch/arm/boot/dts/twl6030.dtsi     |   60 ++++++++++++++++++++++++++++++++++++
 3 files changed, 84 insertions(+), 0 deletions(-)
arch/arm/boot/dts/omap3-beagle.dts +6 -0
index 714ba5d..54556b1 100644
@@ -26,6 +26,12 @@
 		reg = <0x48>;
 		interrupts = <7>; /* SYS_NIRQ cascaded to intc */
 		interrupt-parent = <&intc>;
+
+		vsim: regulator at 10 {
+			compatible = "ti,twl4030-vsim";
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <3000000>;
+		};
 	};
 };
 
arch/arm/boot/dts/twl4030.dtsi +18 -0
index 8be5223..a94654c 100644
@@ -18,4 +18,22 @@
 		compatible = "ti,twl4030-rtc";
 		interrupts = <11>;
 	};
+
+	vdac: regulator at 0 {
+		compatible = "ti,twl4030-vdac";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+	};
+
+	vpll2: regulator at 1 {
+		compatible = "ti,twl4030-vpll2";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+	};
+
+	vmmc1: regulator at 2 {
+		compatible = "ti,twl4030-vmmc1";
+		regulator-min-microvolt = <1850000>;
+		regulator-max-microvolt = <3150000>;
+	};
 };
arch/arm/boot/dts/twl6030.dtsi +60 -0

64 lines not on this page · raw message

Signature · 1 line
1.7.1