Skip to content

Commit

Permalink
ASoC: Use standard register cache sync in wm8993
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Dec 14, 2011
1 parent f6a9336 commit d0616bb
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions sound/soc/codecs/wm8993.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,28 +934,6 @@ static const struct snd_soc_dapm_route routes[] = {
{ "Right Headphone Mux", "DAC", "DACR" },
};

static void wm8993_cache_restore(struct snd_soc_codec *codec)
{
u16 *cache = codec->reg_cache;
int i;

if (!codec->cache_sync)
return;

/* Reenable hardware writes */
codec->cache_only = 0;

/* Restore the register settings */
for (i = 1; i < WM8993_MAX_REGISTER; i++) {
if (cache[i] == wm8993_reg_defaults[i])
continue;
snd_soc_write(codec, i, cache[i]);
}

/* We're in sync again */
codec->cache_sync = 0;
}

static int wm8993_set_bias_level(struct snd_soc_codec *codec,
enum snd_soc_bias_level level)
{
Expand All @@ -979,7 +957,7 @@ static int wm8993_set_bias_level(struct snd_soc_codec *codec,
if (ret != 0)
return ret;

wm8993_cache_restore(codec);
snd_soc_cache_sync(codec);

/* Tune DC servo configuration */
snd_soc_write(codec, 0x44, 3);
Expand Down

0 comments on commit d0616bb

Please sign in to comment.