diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-29 16:07:04 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-01-20 08:58:24 -0500 |
commit | 274eb8f9d8780903ccd40e007928f26c3a8c6e15 (patch) | |
tree | 8468d58b9492d455e7190b2d33be4fa5c80b7163 /sound/soc/codecs/wm8904.c | |
parent | 93e26d4e44e65ef803ea35cfd0fe14fd8af49cb0 (diff) |
ASoC: Use standard cache sync for WM8904
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8904.c')
-rw-r--r-- | sound/soc/codecs/wm8904.c | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index 98d4f815b4a1..673a2fe585bc 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c | |||
@@ -2088,32 +2088,6 @@ static int wm8904_digital_mute(struct snd_soc_dai *codec_dai, int mute) | |||
2088 | return 0; | 2088 | return 0; |
2089 | } | 2089 | } |
2090 | 2090 | ||
2091 | static void wm8904_sync_cache(struct snd_soc_codec *codec) | ||
2092 | { | ||
2093 | u16 *reg_cache = codec->reg_cache; | ||
2094 | int i; | ||
2095 | |||
2096 | if (!codec->cache_sync) | ||
2097 | return; | ||
2098 | |||
2099 | codec->cache_only = 0; | ||
2100 | |||
2101 | /* Sync back cached values if they're different from the | ||
2102 | * hardware default. | ||
2103 | */ | ||
2104 | for (i = 1; i < codec->driver->reg_cache_size; i++) { | ||
2105 | if (!wm8904_access[i].writable) | ||
2106 | continue; | ||
2107 | |||
2108 | if (reg_cache[i] == wm8904_reg[i]) | ||
2109 | continue; | ||
2110 | |||
2111 | snd_soc_write(codec, i, reg_cache[i]); | ||
2112 | } | ||
2113 | |||
2114 | codec->cache_sync = 0; | ||
2115 | } | ||
2116 | |||
2117 | static int wm8904_set_bias_level(struct snd_soc_codec *codec, | 2091 | static int wm8904_set_bias_level(struct snd_soc_codec *codec, |
2118 | enum snd_soc_bias_level level) | 2092 | enum snd_soc_bias_level level) |
2119 | { | 2093 | { |
@@ -2146,7 +2120,7 @@ static int wm8904_set_bias_level(struct snd_soc_codec *codec, | |||
2146 | return ret; | 2120 | return ret; |
2147 | } | 2121 | } |
2148 | 2122 | ||
2149 | wm8904_sync_cache(codec); | 2123 | snd_soc_cache_sync(codec); |
2150 | 2124 | ||
2151 | /* Enable bias */ | 2125 | /* Enable bias */ |
2152 | snd_soc_update_bits(codec, WM8904_BIAS_CONTROL_0, | 2126 | snd_soc_update_bits(codec, WM8904_BIAS_CONTROL_0, |