Skip to content

Commit

Permalink
ASoC: wm8962: Restore device state after reset in runtime resume
Browse files Browse the repository at this point in the history
After the device has been reset we need to repeat the same
initialisation we do on probe to make sure that the device is in
a known state.

Tested-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Mark Brown authored and Mark Brown committed Jun 10, 2013
1 parent d74e9e7 commit 9c24b16
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions sound/soc/codecs/wm8962.c
Original file line number Diff line number Diff line change
Expand Up @@ -3756,6 +3756,21 @@ static int wm8962_runtime_resume(struct device *dev)

wm8962_reset(wm8962);

/* SYSCLK defaults to on; make sure it is off so we can safely
* write to registers if the device is declocked.
*/
regmap_update_bits(wm8962->regmap, WM8962_CLOCKING2,
WM8962_SYSCLK_ENA, 0);

/* Ensure we have soft control over all registers */
regmap_update_bits(wm8962->regmap, WM8962_CLOCKING2,
WM8962_CLKREG_OVD, WM8962_CLKREG_OVD);

/* Ensure that the oscillator and PLLs are disabled */
regmap_update_bits(wm8962->regmap, WM8962_PLL2,
WM8962_OSC_ENA | WM8962_PLL2_ENA | WM8962_PLL3_ENA,
0);

regcache_sync(wm8962->regmap);

return 0;
Expand Down

0 comments on commit 9c24b16

Please sign in to comment.