diff --git a/arch/arm/mach-msm/footswitch-8x60.c b/arch/arm/mach-msm/footswitch-8x60.c index 98447fac0cd..a8e2449a097 100644 --- a/arch/arm/mach-msm/footswitch-8x60.c +++ b/arch/arm/mach-msm/footswitch-8x60.c @@ -255,6 +255,14 @@ static int footswitch_disable(struct regulator_dev *rdev) /* Wait for synchronous resets to propagate. */ udelay(RESET_DELAY_US); + /* + * Return clocks to their state before this function. For robustness + * if memory-retention across collapses is required, clocks should + * be disabled before asserting the clamps. Assuming clocks were off + * before entering footswitch_disable(), this will be true. + */ + restore_clocks(fs); + /* * Clamp the I/O ports of the core to ensure the values * remain fixed while the core is collapsed. @@ -266,9 +274,6 @@ static int footswitch_disable(struct regulator_dev *rdev) regval &= ~ENABLE_BIT; writel_relaxed(regval, fs->gfs_ctl_reg); - /* Return clocks to their state before this function. */ - restore_clocks(fs); - fs->is_enabled = false; return rc;