Skip to contentSkip to conversation

OMAP4: PMIC: Add support for twl6030 regulators

PATCH In review [email protected] 1 participant 1 message Oct 1, 2009

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

PATCH v3 3/4 OMAP4: PMIC: Add support for twl6030 regulators

From: Rajendra Nayak <[email protected]>

This version of patch series enables RUN TIME selection of TWL4030 or TWL6030.

This patch updates the regulator driver to add support for TWL6030 PMIC specific LDO regulators. SMPS resources are not yet supported for TWL6030 and also .set_mode and .get_status for LDO's are yet to be implemented for TWL6030.

---
 drivers/mfd/twl-core.c            |    3 +-
 drivers/regulator/Kconfig         |    6 +-
 drivers/regulator/Makefile        |    2 +-
 drivers/regulator/twl-regulator.c |  134 +++++++++++++++++++++++++++++++------
 include/linux/i2c/twl.h           |   37 ++++++++++
 5 files changed, 155 insertions(+), 27 deletions(-)
drivers/mfd/twl-core.c +2 -1
index dfbcb59..ea9bcba 100644
@@ -112,7 +112,7 @@
 /* Triton Core internal information (BEGIN) */
 
 /* Last - for index max*/
-#define TWL4030_MODULE_LAST		TWL4030_MODULE_SECURED_REG
+#define TWL4030_MODULE_LAST		TWL_MODULE_PM_SLAVE_LDO
 
 #define TWL_NUM_SLAVES		4
 
@@ -270,6 +270,7 @@ static struct twl_mapping twl4030_map[TWL4030_MODULE_LAST + 1] = {
 	{ 3, TWL4030_BASEADD_PM_RECEIVER },
 	{ 3, TWL4030_BASEADD_RTC },
 	{ 3, TWL4030_BASEADD_SECURED_REG },
+	{ 3, TWL4030_BASEADD_PM_RECEIVER },
 };
 
 static struct twl_mapping twl6030_map[] = {
drivers/regulator/Kconfig +3 -3
index f431779..7f5987e 100644
@@ -75,9 +75,9 @@ config REGULATOR_MAX1586
 	  regulator via I2C bus. The provided regulator is suitable
 	  for PXA27x chips to control VCC_CORE and VCC_USIM voltages.
 
-config REGULATOR_TWL4030
-	bool "TI TWL4030/TWL5030/TPS695x0 PMIC"
-	depends on TWL4030_CORE
+config REGULATOR_TWL
+	bool "TI TWL4030/TWL5030/TWL6030/TPS695x0 PMIC"
+	depends on TWL_CORE
 	help
 	  This driver supports the voltage regulators provided by
 	  this family of companion chips.
drivers/regulator/Makefile +1 -1
index 0653ce8..712f733 100644
@@ -11,7 +11,7 @@ obj-$(CONFIG_REGULATOR_USERSPACE_CONSUMER) += userspace-consumer.o
 obj-$(CONFIG_REGULATOR_BQ24022) += bq24022.o
 obj-$(CONFIG_REGULATOR_LP3971) += lp3971.o
 obj-$(CONFIG_REGULATOR_MAX1586) += max1586.o
-obj-$(CONFIG_REGULATOR_TWL4030) += twl-regulator.o
+obj-$(CONFIG_REGULATOR_TWL) += twl-regulator.o
 obj-$(CONFIG_REGULATOR_WM8350) += wm8350-regulator.o
 obj-$(CONFIG_REGULATOR_WM8400) += wm8400-regulator.o
 obj-$(CONFIG_REGULATOR_DA903X)	+= da903x.o
drivers/regulator/twl-regulator.c +112 -22

239 lines not on this page · raw message

include/linux/i2c/twl.h +37 -0
index ed81ff9..1f060db 100644
@@ -65,6 +65,8 @@
 #define TWL4030_MODULE_PM_RECEIVER	0x13
 #define TWL4030_MODULE_RTC		0x14
 #define TWL4030_MODULE_SECURED_REG	0x15
+#define TWL4030_MODULE_PM_SLAVE_LDO	0x16
+
 
 /* FIXME define TWL4030_MODULE_* until all drivers are modified*/
 #define TWL_MODULE_USB		TWL4030_MODULE_USB
@@ -89,6 +91,7 @@
 #define TWL_MODULE_PM_RECEIVER	TWL4030_MODULE_PM_RECEIVER
 #define TWL_MODULE_RTC		TWL4030_MODULE_RTC
 #define TWL_MODULE_SECURED_REG	TWL4030_MODULE_SECURED_REG
+#define TWL_MODULE_PM_SLAVE_LDO TWL4030_MODULE_PM_SLAVE_LDO
 
 #define GPIO_INTR_OFFSET	0
 #define KEYPAD_INTR_OFFSET	1
@@ -357,6 +360,12 @@ int twl6030_interrupt_mask(u8 bit_mask, u8 offset);
 #define MSG_SINGULAR(devgrp, id, state) \
 	((devgrp) << 13 | 0 << 12 | (id) << 4 | (state))
 
+#define MSG_BROADCAST_ALL(devgrp, state) \
+	((devgrp) << 5 | (state))
+
+#define MSG_BROADCAST_REF MSG_BROADCAST_ALL
+#define MSG_BROADCAST_PROV MSG_BROADCAST_ALL
+#define MSG_BROADCAST__CLK_RST MSG_BROADCAST_ALL
 /*----------------------------------------------------------------------*/
 
 struct twl_bci_platform_data {
@@ -467,6 +476,7 @@ int twl4030_sih_setup(int module);
  * VIO is generally fixed.
  */
 
+/* TWL4030 SMPS/LDO's */
 /* EXTERNAL dc-to-dc buck converters */
 #define TWL4030_REG_VDD1	0
 #define TWL4030_REG_VDD2	1
@@ -493,4 +503,31 @@ int twl4030_sih_setup(int module);
 #define TWL4030_REG_VUSB1V8	18
 #define TWL4030_REG_VUSB3V1	19
 
+/* TWL6030 SMPS/LDO's */
+/* EXTERNAL dc-to-dc buck convertor contollable via SR */
+#define TWL6030_REG_VDD1	0
+#define TWL6030_REG_VDD2	1
+#define TWL6030_REG_VDD3	2
+
+/* Non SR compliant dc-to-dc buck convertors */
+#define	TWL6030_REG_VMEM	3
+#define TWL6030_REG_V2V1	4
+#define	TWL6030_REG_V1V29	5
+#define TWL6030_REG_V1V8	6
+
+/* EXTERNAL LDOs */
+#define TWL6030_REG_VAUX1_6030	7
+#define TWL6030_REG_VAUX2_6030	8
+#define TWL6030_REG_VAUX3_6030	9
+#define TWL6030_REG_VMMC	10
+#define TWL6030_REG_VPP		11
+#define TWL6030_REG_VUSIM	12
+#define TWL6030_REG_VANA	13
+#define TWL6030_REG_VCXIO	14
+#define TWL6030_REG_VDAC	15
+#define TWL6030_REG_VUSB	16
+
+/* INTERNAL LDOs */
+#define TWL6030_REG_VRTC	17
+
 #endif /* End of __TWL4030_H */
Signature · 1 line
1.5.4.7