Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319710
b: refs/heads/master
c: 78a27cd
h: refs/heads/master
v: v3
  • Loading branch information
Chris Rattray authored and Samuel Ortiz committed Jul 8, 2012
1 parent e6d88a0 commit ecbe0fb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a834e81051fd51890bd9a64e109b587f8e12199a
refs/heads/master: 78a27cd3e891e8da343942aec10c926eaffabd63
13 changes: 13 additions & 0 deletions trunk/drivers/mfd/wm8994-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ 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. */
Expand Down Expand Up @@ -277,12 +278,24 @@ 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));

/* 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);
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);

Expand Down

0 comments on commit ecbe0fb

Please sign in to comment.