aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8903.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-02 13:23:37 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-03 05:59:45 -0500
commit45e967553f3466f773ecd418c09fe92b753f18b0 (patch)
tree6b82204d900297b27229bc01be40cc394d215665 /sound/soc/codecs/wm8903.c
parent88a1b12b9c70d1b2ea4d11bdfa6ae65c9570909b (diff)
ASoC: Use a normal cache sync for WM8903
The driver used to use a complicated method to sync the register cache after having brought the bias level up to standby in resume due to the use of the write sequencer to manage the initial power up. Now that we don't use the write sequencer there is no need for this and we can just use snd_soc_cache_sync() directly. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Tested-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'sound/soc/codecs/wm8903.c')
-rw-r--r--sound/soc/codecs/wm8903.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
index 745681258eda..fdc3ff053f98 100644
--- a/sound/soc/codecs/wm8903.c
+++ b/sound/soc/codecs/wm8903.c
@@ -1767,23 +1767,11 @@ static int wm8903_suspend(struct snd_soc_codec *codec)
1767 1767
1768static int wm8903_resume(struct snd_soc_codec *codec) 1768static int wm8903_resume(struct snd_soc_codec *codec)
1769{ 1769{
1770 int i; 1770 struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec);
1771 u16 *reg_cache = codec->reg_cache;
1772 u16 *tmp_cache = kmemdup(reg_cache, sizeof(wm8903_reg_defaults),
1773 GFP_KERNEL);
1774 1771
1775 /* Bring the codec back up to standby first to minimise pop/clicks */ 1772 snd_soc_cache_sync(codec);
1776 wm8903_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
1777 1773
1778 /* Sync back everything else */ 1774 wm8903_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
1779 if (tmp_cache) {
1780 for (i = 2; i < ARRAY_SIZE(wm8903_reg_defaults); i++)
1781 if (tmp_cache[i] != reg_cache[i])
1782 snd_soc_write(codec, i, tmp_cache[i]);
1783 kfree(tmp_cache);
1784 } else {
1785 dev_err(codec->dev, "Failed to allocate temporary cache\n");
1786 }
1787 1775
1788 return 0; 1776 return 0;
1789} 1777}