aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/twl4030-power.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2014-05-13 21:34:04 -0400
committerLee Jones <lee.jones@linaro.org>2014-05-28 03:04:58 -0400
commitfc7d76e4c0dc8746f56dcd0a7d9b62ce5e759c04 (patch)
tree728f0d06c2186537dbb0fa5e11261cd5ec2e547d /drivers/mfd/twl4030-power.c
parenta613b739b8c08eab811e677810045cc0522fc3e6 (diff)
mfd: twl4030-power: Fix hang on reboot if sleep configuration was loaded earlier
Looks like we can still hit the issue of wrong load order of twl4030 configuration. If we have a sleep configuration loaded, and do a warm reset, the device can hang while initializing the wakeup12 sequence. We do have a warning message about wrong order of twl4030 configuration, but in this case it does not help as the sleep configuration was loaded during the previous boot and the state of twl4030 is maintained throughout the warm reset. Fix the issue by clearing any existing sleep configuration before we load the warm reset configuration. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/twl4030-power.c')
-rw-r--r--drivers/mfd/twl4030-power.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
index 96162b62f3c0..1b30d8adc270 100644
--- a/drivers/mfd/twl4030-power.c
+++ b/drivers/mfd/twl4030-power.c
@@ -421,6 +421,12 @@ static int load_twl4030_script(struct twl4030_script *tscript,
421 goto out; 421 goto out;
422 } 422 }
423 if (tscript->flags & TWL4030_WAKEUP12_SCRIPT) { 423 if (tscript->flags & TWL4030_WAKEUP12_SCRIPT) {
424 /* Reset any existing sleep script to avoid hangs on reboot */
425 err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, END_OF_SCRIPT,
426 R_SEQ_ADD_A2S);
427 if (err)
428 goto out;
429
424 err = twl4030_config_wakeup12_sequence(address); 430 err = twl4030_config_wakeup12_sequence(address);
425 if (err) 431 if (err)
426 goto out; 432 goto out;