aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-11-23 07:37:46 -0500
committerMark Brown <broonie@kernel.org>2014-11-24 13:42:38 -0500
commita70cf928ca396447416422c2ec1697a530534ac9 (patch)
tree6b6b8005a50298fac5a6d693c64bddd6f26d9ae7 /sound
parent5d01410fe4d92081f349b013a2e7a95429e4f2c9 (diff)
ASoC: wm9090: 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>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/wm9090.c32
1 files changed, 1 insertions, 31 deletions
diff --git a/sound/soc/codecs/wm9090.c b/sound/soc/codecs/wm9090.c
index a13f0725611a..6ffe8dc4f3fa 100644
--- a/sound/soc/codecs/wm9090.c
+++ b/sound/soc/codecs/wm9090.c
@@ -550,45 +550,15 @@ static int wm9090_probe(struct snd_soc_codec *codec)
550 snd_soc_update_bits(codec, WM9090_CLOCKING_1, 550 snd_soc_update_bits(codec, WM9090_CLOCKING_1,
551 WM9090_TOCLK_ENA, WM9090_TOCLK_ENA); 551 WM9090_TOCLK_ENA, WM9090_TOCLK_ENA);
552 552
553 wm9090_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
554
555 wm9090_add_controls(codec); 553 wm9090_add_controls(codec);
556 554
557 return 0; 555 return 0;
558} 556}
559 557
560#ifdef CONFIG_PM
561static int wm9090_suspend(struct snd_soc_codec *codec)
562{
563 wm9090_set_bias_level(codec, SND_SOC_BIAS_OFF);
564
565 return 0;
566}
567
568static int wm9090_resume(struct snd_soc_codec *codec)
569{
570 wm9090_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
571
572 return 0;
573}
574#else
575#define wm9090_suspend NULL
576#define wm9090_resume NULL
577#endif
578
579static int wm9090_remove(struct snd_soc_codec *codec)
580{
581 wm9090_set_bias_level(codec, SND_SOC_BIAS_OFF);
582
583 return 0;
584}
585
586static struct snd_soc_codec_driver soc_codec_dev_wm9090 = { 558static struct snd_soc_codec_driver soc_codec_dev_wm9090 = {
587 .probe = wm9090_probe, 559 .probe = wm9090_probe,
588 .remove = wm9090_remove,
589 .suspend = wm9090_suspend,
590 .resume = wm9090_resume,
591 .set_bias_level = wm9090_set_bias_level, 560 .set_bias_level = wm9090_set_bias_level,
561 .suspend_bias_off = true,
592}; 562};
593 563
594static const struct regmap_config wm9090_regmap = { 564static const struct regmap_config wm9090_regmap = {