aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-11-23 07:37:35 -0500
committerMark Brown <broonie@kernel.org>2014-11-24 13:36:19 -0500
commited1358f508e1ebcb01e1e545c5330599098b7687 (patch)
tree828e78f9f560f90a290bcb86d25f72ad5d4db645 /sound
parentf114040e3ea6e07372334ade75d1ee0775c355e1 (diff)
ASoC: wm8974: 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/wm8974.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/sound/soc/codecs/wm8974.c b/sound/soc/codecs/wm8974.c
index 682e9eda1019..ff0e4646b934 100644
--- a/sound/soc/codecs/wm8974.c
+++ b/sound/soc/codecs/wm8974.c
@@ -568,18 +568,6 @@ static struct snd_soc_dai_driver wm8974_dai = {
568 .symmetric_rates = 1, 568 .symmetric_rates = 1,
569}; 569};
570 570
571static int wm8974_suspend(struct snd_soc_codec *codec)
572{
573 wm8974_set_bias_level(codec, SND_SOC_BIAS_OFF);
574 return 0;
575}
576
577static int wm8974_resume(struct snd_soc_codec *codec)
578{
579 wm8974_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
580 return 0;
581}
582
583static const struct regmap_config wm8974_regmap = { 571static const struct regmap_config wm8974_regmap = {
584 .reg_bits = 7, 572 .reg_bits = 7,
585 .val_bits = 9, 573 .val_bits = 9,
@@ -599,24 +587,13 @@ static int wm8974_probe(struct snd_soc_codec *codec)
599 return ret; 587 return ret;
600 } 588 }
601 589
602 wm8974_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
603
604 return ret;
605}
606
607/* power down chip */
608static int wm8974_remove(struct snd_soc_codec *codec)
609{
610 wm8974_set_bias_level(codec, SND_SOC_BIAS_OFF);
611 return 0; 590 return 0;
612} 591}
613 592
614static struct snd_soc_codec_driver soc_codec_dev_wm8974 = { 593static struct snd_soc_codec_driver soc_codec_dev_wm8974 = {
615 .probe = wm8974_probe, 594 .probe = wm8974_probe,
616 .remove = wm8974_remove,
617 .suspend = wm8974_suspend,
618 .resume = wm8974_resume,
619 .set_bias_level = wm8974_set_bias_level, 595 .set_bias_level = wm8974_set_bias_level,
596 .suspend_bias_off = true,
620 597
621 .controls = wm8974_snd_controls, 598 .controls = wm8974_snd_controls,
622 .num_controls = ARRAY_SIZE(wm8974_snd_controls), 599 .num_controls = ARRAY_SIZE(wm8974_snd_controls),