Commit fc7d76e4 authored by Tony Lindgren's avatar Tony Lindgren Committed by Lee Jones

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: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent a613b739
...@@ -421,6 +421,12 @@ static int load_twl4030_script(struct twl4030_script *tscript, ...@@ -421,6 +421,12 @@ static int load_twl4030_script(struct twl4030_script *tscript,
goto out; goto out;
} }
if (tscript->flags & TWL4030_WAKEUP12_SCRIPT) { if (tscript->flags & TWL4030_WAKEUP12_SCRIPT) {
/* Reset any existing sleep script to avoid hangs on reboot */
err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, END_OF_SCRIPT,
R_SEQ_ADD_A2S);
if (err)
goto out;
err = twl4030_config_wakeup12_sequence(address); err = twl4030_config_wakeup12_sequence(address);
if (err) if (err)
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment