aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2016-10-21 04:27:08 -0400
committerMark Brown <broonie@kernel.org>2016-10-24 12:48:41 -0400
commit1457de3b8766045b815d1b37b7edc7b7c17c9dbc (patch)
tree4a978de853ef22016bf4779b0aa4f6623e5d72be
parent206964e8265c4aeeda8338a3c1cec9814a90647b (diff)
ASoC: wm9705: Remove ac97_read/ac97_write wrappers
Since the regmap conversion ac97_read/ac97_write are just simple wrappers around snd_soc_read/snd_soc_write. Use those instead directly and remove the wrappers. Also use snd_soc_update_bits() where appropriate. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/wm9705.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/sound/soc/codecs/wm9705.c b/sound/soc/codecs/wm9705.c
index 70ab6077fa55..e73ff6176622 100644
--- a/sound/soc/codecs/wm9705.c
+++ b/sound/soc/codecs/wm9705.c
@@ -226,33 +226,20 @@ static const struct snd_soc_dapm_route wm9705_audio_map[] = {
226 {"Right ADC", NULL, "ADC PGA"}, 226 {"Right ADC", NULL, "ADC PGA"},
227}; 227};
228 228
229static unsigned int ac97_read(struct snd_soc_codec *codec, unsigned int reg)
230{
231 return snd_soc_read(codec, reg);
232}
233
234static int ac97_write(struct snd_soc_codec *codec, unsigned int reg,
235 unsigned int val)
236{
237 return snd_soc_write(codec, reg, val);
238}
239
240static int ac97_prepare(struct snd_pcm_substream *substream, 229static int ac97_prepare(struct snd_pcm_substream *substream,
241 struct snd_soc_dai *dai) 230 struct snd_soc_dai *dai)
242{ 231{
243 struct snd_soc_codec *codec = dai->codec; 232 struct snd_soc_codec *codec = dai->codec;
244 int reg; 233 int reg;
245 u16 vra;
246 234
247 vra = ac97_read(codec, AC97_EXTENDED_STATUS); 235 snd_soc_update_bits(codec, AC97_EXTENDED_STATUS, 0x1, 0x1);
248 ac97_write(codec, AC97_EXTENDED_STATUS, vra | 0x1);
249 236
250 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 237 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
251 reg = AC97_PCM_FRONT_DAC_RATE; 238 reg = AC97_PCM_FRONT_DAC_RATE;
252 else 239 else
253 reg = AC97_PCM_LR_ADC_RATE; 240 reg = AC97_PCM_LR_ADC_RATE;
254 241
255 return ac97_write(codec, reg, substream->runtime->rate); 242 return snd_soc_write(codec, reg, substream->runtime->rate);
256} 243}
257 244
258#define WM9705_AC97_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 | \ 245#define WM9705_AC97_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 | \
@@ -299,7 +286,7 @@ static struct snd_soc_dai_driver wm9705_dai[] = {
299static int wm9705_soc_suspend(struct snd_soc_codec *codec) 286static int wm9705_soc_suspend(struct snd_soc_codec *codec)
300{ 287{
301 regcache_cache_bypass(codec->component.regmap, true); 288 regcache_cache_bypass(codec->component.regmap, true);
302 ac97_write(codec, AC97_POWERDOWN, 0xffff); 289 snd_soc_write(codec, AC97_POWERDOWN, 0xffff);
303 regcache_cache_bypass(codec->component.regmap, false); 290 regcache_cache_bypass(codec->component.regmap, false);
304 291
305 return 0; 292 return 0;