summaryrefslogtreecommitdiff
path: root/drivers/mfd/wm8994-core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-06-29 14:55:39 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2012-07-09 00:33:04 +0200
commited393dcd419fd2a00d33cd169dded7303e1c0968 (patch)
tree0f8fc5157b14b4471fdf26bc41c2be70320da7dd /drivers/mfd/wm8994-core.c
parent59db96913c9d94fe74002df494eb80e4a5ca4087 (diff)
mfd: Use regcache_sync_region() to sync wm8994 GPIO registers on suspend
Now we have regcache sync region we can use it to do a more efficient sync of the pin configuration after we reset the device during suspend. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/wm8994-core.c')
-rw-r--r--drivers/mfd/wm8994-core.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c
index f75cdccd1043..53293c742a19 100644
--- a/drivers/mfd/wm8994-core.c
+++ b/drivers/mfd/wm8994-core.c
@@ -196,7 +196,6 @@ static int wm8994_suspend(struct device *dev)
{
struct wm8994 *wm8994 = dev_get_drvdata(dev);
int ret;
- int gpio_regs[WM8994_NUM_GPIO_REGS];
/* Don't actually go through with the suspend if the CODEC is
* still active (eg, for audio passthrough from CP. */
@@ -278,27 +277,23 @@ static int wm8994_suspend(struct device *dev)
WM8994_LDO1ENA_PD | WM8994_LDO2ENA_PD,
WM8994_LDO1ENA_PD | WM8994_LDO2ENA_PD);
- /* Save GPIO registers before reset */
- regmap_bulk_read(wm8994->regmap, WM8994_GPIO_1, gpio_regs,
- WM8994_NUM_GPIO_REGS);
-
/* Explicitly put the device into reset in case regulators
* don't get disabled in order to ensure consistent restart.
*/
wm8994_reg_write(wm8994, WM8994_SOFTWARE_RESET,
wm8994_reg_read(wm8994, WM8994_SOFTWARE_RESET));
+ regcache_mark_dirty(wm8994->regmap);
+
/* Restore GPIO registers to prevent problems with mismatched
* pin configurations.
*/
- ret = regmap_bulk_write(wm8994->regmap, WM8994_GPIO_1, gpio_regs,
- WM8994_NUM_GPIO_REGS);
+ ret = regcache_sync_region(wm8994->regmap, WM8994_GPIO_1,
+ WM8994_GPIO_11);
if (ret != 0)
dev_err(dev, "Failed to restore GPIO registers: %d\n", ret);
regcache_cache_only(wm8994->regmap, true);
- regcache_mark_dirty(wm8994->regmap);
-
wm8994->suspended = true;
ret = regulator_bulk_disable(wm8994->num_supplies,