diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-11-23 07:37:19 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-11-24 13:18:08 -0500 |
commit | 99b108c73f3876d71ac6631e85e0f093e53b7e66 (patch) | |
tree | 3b14a4128296e74fd62555683891016625425467 | |
parent | f114040e3ea6e07372334ade75d1ee0775c355e1 (diff) |
ASoC: wm8510: 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.
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/wm8510.c | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/sound/soc/codecs/wm8510.c b/sound/soc/codecs/wm8510.c index e11127f9069e..8736ad094b24 100644 --- a/sound/soc/codecs/wm8510.c +++ b/sound/soc/codecs/wm8510.c | |||
@@ -575,41 +575,17 @@ static struct snd_soc_dai_driver wm8510_dai = { | |||
575 | .symmetric_rates = 1, | 575 | .symmetric_rates = 1, |
576 | }; | 576 | }; |
577 | 577 | ||
578 | static int wm8510_suspend(struct snd_soc_codec *codec) | ||
579 | { | ||
580 | wm8510_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
581 | return 0; | ||
582 | } | ||
583 | |||
584 | static int wm8510_resume(struct snd_soc_codec *codec) | ||
585 | { | ||
586 | wm8510_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
587 | return 0; | ||
588 | } | ||
589 | |||
590 | static int wm8510_probe(struct snd_soc_codec *codec) | 578 | static int wm8510_probe(struct snd_soc_codec *codec) |
591 | { | 579 | { |
592 | wm8510_reset(codec); | 580 | wm8510_reset(codec); |
593 | 581 | ||
594 | /* power on device */ | ||
595 | wm8510_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
596 | |||
597 | return 0; | ||
598 | } | ||
599 | |||
600 | /* power down chip */ | ||
601 | static int wm8510_remove(struct snd_soc_codec *codec) | ||
602 | { | ||
603 | wm8510_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
604 | return 0; | 582 | return 0; |
605 | } | 583 | } |
606 | 584 | ||
607 | static struct snd_soc_codec_driver soc_codec_dev_wm8510 = { | 585 | static struct snd_soc_codec_driver soc_codec_dev_wm8510 = { |
608 | .probe = wm8510_probe, | 586 | .probe = wm8510_probe, |
609 | .remove = wm8510_remove, | ||
610 | .suspend = wm8510_suspend, | ||
611 | .resume = wm8510_resume, | ||
612 | .set_bias_level = wm8510_set_bias_level, | 587 | .set_bias_level = wm8510_set_bias_level, |
588 | .suspend_bias_off = true, | ||
613 | 589 | ||
614 | .controls = wm8510_snd_controls, | 590 | .controls = wm8510_snd_controls, |
615 | .num_controls = ARRAY_SIZE(wm8510_snd_controls), | 591 | .num_controls = ARRAY_SIZE(wm8510_snd_controls), |