Commit f98692ea authored by Mark Brown's avatar Mark Brown

ASoC: Use standard cache sync for WM8978

Saves a bit of code and supports further refactoring.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 623105dc
...@@ -891,16 +891,9 @@ static int wm8978_suspend(struct snd_soc_codec *codec) ...@@ -891,16 +891,9 @@ static int wm8978_suspend(struct snd_soc_codec *codec)
static int wm8978_resume(struct snd_soc_codec *codec) static int wm8978_resume(struct snd_soc_codec *codec)
{ {
struct wm8978_priv *wm8978 = snd_soc_codec_get_drvdata(codec); struct wm8978_priv *wm8978 = snd_soc_codec_get_drvdata(codec);
int i;
u16 *cache = codec->reg_cache;
/* Sync reg_cache with the hardware */ /* Sync reg_cache with the hardware */
for (i = 0; i < ARRAY_SIZE(wm8978_reg); i++) { snd_soc_cache_sync(codec);
if (i == WM8978_RESET)
continue;
if (cache[i] != wm8978_reg[i])
snd_soc_write(codec, i, cache[i]);
}
wm8978_set_bias_level(codec, SND_SOC_BIAS_STANDBY); wm8978_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment