diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-11-23 07:37:22 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-11-24 13:19:45 -0500 |
commit | 0bd324b1ad5c0922ac3f157763123d1550bdffd7 (patch) | |
tree | 24c49e5e1e63e6f59f584c2e0cffbab726f6029c | |
parent | f114040e3ea6e07372334ade75d1ee0775c355e1 (diff) |
ASoC: wm8711: Cleanup manual bias level transitions
Set the CODEC driver's suspend_bias_off flag rather than manually going to
SND_SOC_BIAS_OFF in suspend and SND_SOC_BIAS_STANDBY in resume. This makes
the code a bit shorter and cleaner. Also remove the extra write that sets
the WM8711_ACTIVE register to 0x00 in the suspend handler since this write
is already done when transitioning to SND_SOC_BIAS_OFF.
Since the ASoC core now takes care of setting the bias level to
SND_SOC_BIAS_OFF when removing the CODEC there is no need to do it manually
anymore either.
The manual transition to SND_SOC_BIAS_STANDBY at the end of CODEC probe()
can also be removed as the core will automatically do this after the CODEC
has been probed.
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/wm8711.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/sound/soc/codecs/wm8711.c b/sound/soc/codecs/wm8711.c index 32187e739b4f..121e46d53779 100644 --- a/sound/soc/codecs/wm8711.c +++ b/sound/soc/codecs/wm8711.c | |||
@@ -350,19 +350,6 @@ static struct snd_soc_dai_driver wm8711_dai = { | |||
350 | .ops = &wm8711_ops, | 350 | .ops = &wm8711_ops, |
351 | }; | 351 | }; |
352 | 352 | ||
353 | static int wm8711_suspend(struct snd_soc_codec *codec) | ||
354 | { | ||
355 | snd_soc_write(codec, WM8711_ACTIVE, 0x0); | ||
356 | wm8711_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
357 | return 0; | ||
358 | } | ||
359 | |||
360 | static int wm8711_resume(struct snd_soc_codec *codec) | ||
361 | { | ||
362 | wm8711_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
363 | return 0; | ||
364 | } | ||
365 | |||
366 | static int wm8711_probe(struct snd_soc_codec *codec) | 353 | static int wm8711_probe(struct snd_soc_codec *codec) |
367 | { | 354 | { |
368 | int ret; | 355 | int ret; |
@@ -373,8 +360,6 @@ static int wm8711_probe(struct snd_soc_codec *codec) | |||
373 | return ret; | 360 | return ret; |
374 | } | 361 | } |
375 | 362 | ||
376 | wm8711_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
377 | |||
378 | /* Latch the update bits */ | 363 | /* Latch the update bits */ |
379 | snd_soc_update_bits(codec, WM8711_LOUT1V, 0x0100, 0x0100); | 364 | snd_soc_update_bits(codec, WM8711_LOUT1V, 0x0100, 0x0100); |
380 | snd_soc_update_bits(codec, WM8711_ROUT1V, 0x0100, 0x0100); | 365 | snd_soc_update_bits(codec, WM8711_ROUT1V, 0x0100, 0x0100); |
@@ -383,19 +368,11 @@ static int wm8711_probe(struct snd_soc_codec *codec) | |||
383 | 368 | ||
384 | } | 369 | } |
385 | 370 | ||
386 | /* power down chip */ | ||
387 | static int wm8711_remove(struct snd_soc_codec *codec) | ||
388 | { | ||
389 | wm8711_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
390 | return 0; | ||
391 | } | ||
392 | |||
393 | static struct snd_soc_codec_driver soc_codec_dev_wm8711 = { | 371 | static struct snd_soc_codec_driver soc_codec_dev_wm8711 = { |
394 | .probe = wm8711_probe, | 372 | .probe = wm8711_probe, |
395 | .remove = wm8711_remove, | ||
396 | .suspend = wm8711_suspend, | ||
397 | .resume = wm8711_resume, | ||
398 | .set_bias_level = wm8711_set_bias_level, | 373 | .set_bias_level = wm8711_set_bias_level, |
374 | .suspend_bias_off = true, | ||
375 | |||
399 | .controls = wm8711_snd_controls, | 376 | .controls = wm8711_snd_controls, |
400 | .num_controls = ARRAY_SIZE(wm8711_snd_controls), | 377 | .num_controls = ARRAY_SIZE(wm8711_snd_controls), |
401 | .dapm_widgets = wm8711_dapm_widgets, | 378 | .dapm_widgets = wm8711_dapm_widgets, |