Skip to contentSkip to conversation

Add device tree support for AM33XX regulators

PATCH Applied AnilKumar Ch 2 participants 8 messages Jul 10, 2012 – Jul 16, 2012

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

v2 cover Add device tree support for AM33XX regulators

Add device tree support for regulators present on AM33XX family of devices like AM335X-EVM and AM335X-Bone. TPS65217 regulator is present on AM335X-Bone and TPS65910 on AM335X-EVM.

First patch adds the device tree support to tps65217 regulator so that it will take the parameters from tps65217.dtsi file and convert to tps65217 regulator parameters.

Second patch adds tps65910 device tree data by adding separate DT tps65910.dtsi file, which contains the generic tps65910 PMIC DT data.

Third patch adds tps65217 device tree data by adding separate tps65910.dtsi file, which contains the generic tps65910 PMIC DT data.

This patch series was tested by adding the I2C slave address to corresponding .dts files.

Changes form V1:
- Add regulator-compatible data to dt files.
- Separated device tree data addition to am335x-evm/bone dts from the regulator patches

AnilKumar Ch (3):
regulator: tps65217: Add device tree support
ARM: OMAP2+: AM33XX: Add tps65910 device tree data
ARM: OMAP2+: AM33XX: Add tps65217 device tree data

 .../devicetree/bindings/regulator/tps65217.txt     |   91 +++++++++++++++
 arch/arm/boot/dts/tps65217.dtsi                    |   84 +++++++++++++
 arch/arm/boot/dts/tps65910.dtsi                    |  123 ++++++++++++++++++++
 drivers/mfd/tps65217.c                             |   67 ++++++++++-
 drivers/regulator/tps65217-regulator.c             |    1 +
 include/linux/mfd/tps65217.h                       |    3 +-
 6 files changed, 366 insertions(+), 3 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/regulator/tps65217.txt
 create mode 100644 arch/arm/boot/dts/tps65217.dtsi
 create mode 100644 arch/arm/boot/dts/tps65910.dtsi
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v2 1/3 regulator: tps65217: Add device tree support

This commit adds device tree support for tps65217 pmic. And usage details are added to device tree documentation. Driver is tested by using kernel module with regulator set and get APIs.

---
 .../devicetree/bindings/regulator/tps65217.txt     |   91 ++++++++++++++++++++
 drivers/mfd/tps65217.c                             |   67 +++++++++++++-
 drivers/regulator/tps65217-regulator.c             |    1 +
 include/linux/mfd/tps65217.h                       |    3 +-
 4 files changed, 159 insertions(+), 3 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/regulator/tps65217.txt
Documentation/devicetree/bindings/regulator/tps65217.txt new file +91 -0
new file mode 100644
index 0000000..0487e96
@@ -0,0 +1,91 @@
+TPS65217 family of regulators
+
+Required properties:
+- compatible: "ti,tps65217"
+- reg: I2C slave address
+- regulators: list of regulators provided by this controller, must be named
+  after their hardware counterparts: dcdc[1-3] and ldo[1-4]
+- regulators: This is the list of child nodes that specify the regulator
+  initialization data for defined regulators. Not all regulators for the given
+  device need to be present. The definition for each of these nodes is defined
+  using the standard binding for regulators found at
+  Documentation/devicetree/bindings/regulator/regulator.txt.
+
+  The valid names for regulators are:
+  tps65217: dcdc1, dcdc2, dcdc3, ldo1, ldo2, ldo3 and ldo4
+
+Each regulator is defined using the standard binding for regulators.
+
+Example:
+
+	tps: tps@24 {
+		compatible = "ti,tps65217";
+
+		regulators {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			dcdc1_reg: regulator@0 {
+				reg = <0>;
+				regulator-compatible = "dcdc1";
+				regulator-min-microvolt = <900000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			dcdc2_reg: regulator@1 {
+				reg = <1>;
+				regulator-compatible = "dcdc2";
+				regulator-min-microvolt = <900000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			dcdc3_reg: regulator@2 {
+				reg = <2>;
+				regulator-compatible = "dcdc3";
+				regulator-min-microvolt = <900000>;
+				regulator-max-microvolt = <1500000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			ldo1_reg: regulator@3 {
+				reg = <3>;
+				regulator-compatible = "ldo1";
+				regulator-min-microvolt = <1000000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			ldo2_reg: regulator@4 {
+				reg = <4>;
+				regulator-compatible = "ldo2";
+				regulator-min-microvolt = <900000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			ldo3_reg: regulator@5 {
+				reg = <5>;
+				regulator-compatible = "ldo3";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			ldo4_reg: regulator@6 {
+				reg = <6>;
+				regulator-compatible = "ldo4";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+		};
+	};
drivers/mfd/tps65217.c +65 -2

101 lines not on this page · raw message

drivers/regulator/tps65217-regulator.c +1 -0
index 9d371d2..75401c7 100644
@@ -326,6 +326,7 @@ static int __devinit tps65217_regulator_probe(struct platform_device *pdev)
 	tps->info[pdev->id] = info;
 
 	config.dev = &pdev->dev;
+	config.of_node = pdev->dev.of_node;
 	config.init_data = pdev->dev.platform_data;
 	config.driver_data = tps;
 
include/linux/mfd/tps65217.h +2 -1
index e030ef9..10e0595 100644
@@ -217,7 +217,8 @@ enum tps65217_regulator_id {
  * Board data may be used to initialize regulator.
  */
 struct tps65217_board {
-	struct regulator_init_data *tps65217_init_data;
+	struct regulator_init_data *tps65217_init_data[TPS65217_NUM_REGULATOR];
+	struct device_node *of_node[TPS65217_NUM_REGULATOR];
 };
 
 /**
Signature · 1 line
1.7.9.5
Applied
#2 lore raw

Re: [PATCH v2 1/3] regulator: tps65217: Add device tree support

Quoted 3 lines · AnilKumar Ch

This commit adds device tree support for tps65217 pmic. And usage details are added to device tree documentation. Driver is tested by using kernel module with regulator set and get APIs.

Applied, thanks.

#3 lore raw

RE: [PATCH v2 1/3] regulator: tps65217: Add device tree support

Hi Mark,

Quoted 6 lines · Mark Brown
Quoted 3 lines · AnilKumar Ch

This commit adds device tree support for tps65217 pmic. And usage details are added to device tree documentation. Driver is tested by using kernel module with regulator set and get APIs.

Applied, thanks.

Thanks much, are you going to push reset of the patches in this series?

Thanks
AnilKumar

#4 lore raw

Re: [PATCH v2 1/3] regulator: tps65217: Add device tree support

Quoted 1 line · Chimata

Thanks much, are you going to push reset of the patches in this series?

No, there's no dependency so I'd expect them to be applied by the architecture maintainers.

#5 lore raw

RE: [PATCH v2 1/3] regulator: tps65217: Add device tree support

+Tony

Tony,

Quoted 7 lines · Mark Brown
Quoted 1 line · Chimata

Thanks much, are you going to push reset of the patches in this series?

No, there's no dependency so I'd expect them to be applied by the architecture maintainers.

Could you please push these [2/3 and 3/3] patches to linux-omap "devel-dt tree"?
http://marc.info/?l=linux-omap&m=134191889501150&w=2
http://marc.info/?l=linux-omap&m=134191891701159&w=2

After these patches, "PMIC I2C slave address addition for AM335x EVM/Bone will be submitted, which actually passes DT data to tps65910/217 drivers"

Regards
AnilKumar

#6 lore raw

PATCH v2 2/3 ARM: OMAP2+: AM33XX: Add tps65910 device tree data

In reply to AnilKumar Ch

Add device tree data for tps65910 regulator by adding all the consumers necessary for AM335X-EVM. The data will be map to a regulator constraints which is required for regulator set_voltage and get_voltage calls.

All tps65910 PMIC regulator constraints are placed in a seperate device tree include file (tps65910.dtsi).

This patch is tested by adding the I2C slave address of TPS65910 pmic to am335x-evm.dts file (Not included in this, I2C slave addition patch will be submitted to linux-omap, where am335x-evm.dts binding file is available).

---
 arch/arm/boot/dts/tps65910.dtsi |  123 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 123 insertions(+)
 create mode 100644 arch/arm/boot/dts/tps65910.dtsi
arch/arm/boot/dts/tps65910.dtsi new file +123 -0
new file mode 100644
index 0000000..b185235
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/*
+ * Integrated Power Management Chip
+ * http://www.ti.com/lit/ds/symlink/tps65910.pdf
+ */
+
+&tps {
+	compatible = "ti,tps65910";
+
+	regulators {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		vrtc_reg: regulator@0 {
+			reg = <0>;
+			regulator-compatible = "vrtc";
+			regulator-always-on;
+		};
+
+		vio_reg: regulator@1 {
+			reg = <1>;
+			regulator-compatible = "vio";
+			regulator-min-microvolt = <1500000>;
+			regulator-max-microvolt = <3300000>;
+			regulator-always-on;
+		};
+
+		vdd1_reg: regulator@2 {
+			reg = <2>;
+			regulator-compatible = "vdd1";
+			regulator-min-microvolt = <600000>;
+			regulator-max-microvolt = <1500000>;
+			regulator-boot-on;
+			regulator-always-on;
+		};
+
+		vdd2_reg: regulator@3 {
+			reg = <3>;
+			regulator-compatible = "vdd2";
+			regulator-min-microvolt = <600000>;
+			regulator-max-microvolt = <1500000>;
+			regulator-boot-on;
+			regulator-always-on;
+		};
+
+		vdd3_reg: regulator@4 {
+			reg = <4>;
+			regulator-compatible = "vdd3";
+			regulator-always-on;
+		};
+
+		vdig1_reg: regulator@5 {
+			reg = <5>;
+			regulator-compatible = "vdig1";
+			regulator-min-microvolt = <1200000>;
+			regulator-max-microvolt = <2700000>;
+			regulator-always-on;
+		};
+
+		vdig2_reg: regulator@6 {
+			reg = <6>;
+			regulator-compatible = "vdig2";
+			regulator-min-microvolt = <1000000>;
+			regulator-max-microvolt = <1800000>;
+			regulator-always-on;
+		};
+
+		vpll_reg: regulator@7 {
+			reg = <7>;
+			regulator-compatible = "vpll";
+			regulator-min-microvolt = <1000000>;
+			regulator-max-microvolt = <2500000>;
+			regulator-always-on;
+		};
+
+		vdac_reg: regulator@8 {
+			reg = <8>;
+			regulator-compatible = "vdac";
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <2850000>;
+			regulator-always-on;
+		};
+
+		vaux1_reg: regulator@9 {
+			reg = <9>;
+			regulator-compatible = "vaux1";
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <2850000>;
+			regulator-always-on;
+		};
+
+		vaux2_reg: regulator@10 {
+			reg = <10>;
+			regulator-compatible = "vaux2";
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <3300000>;
+			regulator-always-on;
+		};
+
+		vaux33_reg: regulator@11 {
+			reg = <11>;
+			regulator-compatible = "vaux33";
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <3300000>;
+			regulator-always-on;
+		};
+
+		vmmc_reg: regulator@12 {
+			reg = <12>;
+			regulator-compatible = "vmmc";
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <3300000>;
+			regulator-always-on;
+		};
+	};
+};
Signature · 1 line
1.7.9.5
#7 lore raw

PATCH v2 3/3 ARM: OMAP2+: AM33XX: Add tps65217 device tree data

In reply to AnilKumar Ch

Add device tree data for tps65217 regulator by adding all the consumers necessary for AM335X-BeagleBone. The data will be map to a regulator constraints which is required for regulator set_voltage and get_voltage calls.

All tps65217 PMIC regulator constraints are placed in a seperate device tree include file (tps65217.dtsi).

This patch is tested by adding the I2C slave address of TPS65217 pmic to am335x-bone.dts file (Not included in this, I2C slave addition patch will be submitted to linux-omap, where am335x-bone.dts binding file is available).

---
 arch/arm/boot/dts/tps65217.dtsi |   84 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 84 insertions(+)
 create mode 100644 arch/arm/boot/dts/tps65217.dtsi
arch/arm/boot/dts/tps65217.dtsi new file +84 -0
new file mode 100644
index 0000000..cbb9e5d
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+/*
+ * Integrated Power Management Chip
+ * http://www.ti.com/lit/ds/symlink/tps65217.pdf
+ */
+
+&tps {
+	compatible = "ti,tps65217";
+
+	regulators {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		dcdc1_reg: regulator@0 {
+			reg = <0>;
+			regulator-compatible = "dcdc1";
+			regulator-min-microvolt = <900000>;
+			regulator-max-microvolt = <1800000>;
+			regulator-boot-on;
+			regulator-always-on;
+		};
+
+		dcdc2_reg: regulator@1 {
+			reg = <1>;
+			regulator-compatible = "dcdc2";
+			regulator-min-microvolt = <900000>;
+			regulator-max-microvolt = <3300000>;
+			regulator-boot-on;
+			regulator-always-on;
+		};
+
+		dcdc3_reg: regulator@2 {
+			reg = <2>;
+			regulator-compatible = "dcdc3";
+			regulator-min-microvolt = <900000>;
+			regulator-max-microvolt = <1500000>;
+			regulator-boot-on;
+			regulator-always-on;
+		};
+
+		ldo1_reg: regulator@3 {
+			reg = <3>;
+			regulator-compatible = "ldo1";
+			regulator-min-microvolt = <1000000>;
+			regulator-max-microvolt = <3300000>;
+			regulator-boot-on;
+			regulator-always-on;
+		};
+
+		ldo2_reg: regulator@4 {
+			reg = <4>;
+			regulator-compatible = "ldo2";
+			regulator-min-microvolt = <900000>;
+			regulator-max-microvolt = <3300000>;
+			regulator-boot-on;
+			regulator-always-on;
+		};
+
+		ldo3_reg: regulator@5 {
+			reg = <5>;
+			regulator-compatible = "ldo3";
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <3300000>;
+			regulator-boot-on;
+			regulator-always-on;
+		};
+
+		ldo4_reg: regulator@6 {
+			reg = <6>;
+			regulator-compatible = "ldo4";
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <3300000>;
+			regulator-boot-on;
+			regulator-always-on;
+		};
+	};
+};
Signature · 1 line
1.7.9.5