aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/twl-core.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2014-04-10 19:47:18 -0400
committerLee Jones <lee.jones@linaro.org>2014-04-23 10:31:05 -0400
commita613b739b8c08eab811e677810045cc0522fc3e6 (patch)
treec3d8142c39c53333af788264ef38019fa304334d /drivers/mfd/twl-core.c
parent455c6fdbd219161bd09b1165f11699d6d73de11c (diff)
mfd: twl-core: Fix idle mode signaling for omaps when booted with device tree
I noticed a regression where the omap sys_clkreq signal will never trigger for omap3 when booted with device tree while it triggers when booted in legacy mode. This means voltage scaling does not do anything when booted with device tree. Turns out the reason is we fail to initialize the SmartReflex enable bit in twl4030 with the following error: twl: not initialized And that happens because we are wrongly tinkering with the twl4030 registers in arch/arm/mach-omap2/omap_twl.c before the driver is initialized. Looking at the the SmartReflex bit enable code in omap_twl.c, we need to always set it. So let's fix the issue by always enabling the twl4030 SmartReflex bit in the drivers/mfd/twl-core.c probe, and drop the related code in omap_twl.c. Note that we still have some twl4030 tinkering left in omap_twl.c for the twl6030 case, but that's a different patch. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/twl-core.c')
-rw-r--r--drivers/mfd/twl-core.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index ed718328eff1..ad7d04f95dd1 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -98,7 +98,11 @@
98#define TWL4030_BASEADD_BACKUP 0x0014 98#define TWL4030_BASEADD_BACKUP 0x0014
99#define TWL4030_BASEADD_INT 0x002E 99#define TWL4030_BASEADD_INT 0x002E
100#define TWL4030_BASEADD_PM_MASTER 0x0036 100#define TWL4030_BASEADD_PM_MASTER 0x0036
101
101#define TWL4030_BASEADD_PM_RECEIVER 0x005B 102#define TWL4030_BASEADD_PM_RECEIVER 0x005B
103#define TWL4030_DCDC_GLOBAL_CFG 0x06
104#define SMARTREFLEX_ENABLE BIT(3)
105
102#define TWL4030_BASEADD_RTC 0x001C 106#define TWL4030_BASEADD_RTC 0x001C
103#define TWL4030_BASEADD_SECURED_REG 0x0000 107#define TWL4030_BASEADD_SECURED_REG 0x0000
104 108
@@ -1204,6 +1208,11 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
1204 * Disable TWL4030/TWL5030 I2C Pull-up on I2C1 and I2C4(SR) interface. 1208 * Disable TWL4030/TWL5030 I2C Pull-up on I2C1 and I2C4(SR) interface.
1205 * Program I2C_SCL_CTRL_PU(bit 0)=0, I2C_SDA_CTRL_PU (bit 2)=0, 1209 * Program I2C_SCL_CTRL_PU(bit 0)=0, I2C_SDA_CTRL_PU (bit 2)=0,
1206 * SR_I2C_SCL_CTRL_PU(bit 4)=0 and SR_I2C_SDA_CTRL_PU(bit 6)=0. 1210 * SR_I2C_SCL_CTRL_PU(bit 4)=0 and SR_I2C_SDA_CTRL_PU(bit 6)=0.
1211 *
1212 * Also, always enable SmartReflex bit as that's needed for omaps to
1213 * to do anything over I2C4 for voltage scaling even if SmartReflex
1214 * is disabled. Without the SmartReflex bit omap sys_clkreq idle
1215 * signal will never trigger for retention idle.
1207 */ 1216 */
1208 if (twl_class_is_4030()) { 1217 if (twl_class_is_4030()) {
1209 u8 temp; 1218 u8 temp;
@@ -1212,6 +1221,12 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
1212 temp &= ~(SR_I2C_SDA_CTRL_PU | SR_I2C_SCL_CTRL_PU | \ 1221 temp &= ~(SR_I2C_SDA_CTRL_PU | SR_I2C_SCL_CTRL_PU | \
1213 I2C_SDA_CTRL_PU | I2C_SCL_CTRL_PU); 1222 I2C_SDA_CTRL_PU | I2C_SCL_CTRL_PU);
1214 twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1); 1223 twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1);
1224
1225 twl_i2c_read_u8(TWL_MODULE_PM_RECEIVER, &temp,
1226 TWL4030_DCDC_GLOBAL_CFG);
1227 temp |= SMARTREFLEX_ENABLE;
1228 twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER, temp,
1229 TWL4030_DCDC_GLOBAL_CFG);
1215 } 1230 }
1216 1231
1217 if (node) { 1232 if (node) {