aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-11-23 07:37:26 -0500
committerMark Brown <broonie@kernel.org>2014-12-22 06:43:12 -0500
commita380acb88611e1ee90dcb3da39e05991cadc6682 (patch)
treee681f3b03d75ca43c585b945192dbb978b6c8497
parent5ede19c58a1ec274b28e03a76b855c3c55ab6f11 (diff)
ASoC: wm8750: 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/wm8750.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/sound/soc/codecs/wm8750.c b/sound/soc/codecs/wm8750.c
index d9e262657887..eb0a1644ba11 100644
--- a/sound/soc/codecs/wm8750.c
+++ b/sound/soc/codecs/wm8750.c
@@ -686,18 +686,6 @@ static struct snd_soc_dai_driver wm8750_dai = {
686 .ops = &wm8750_dai_ops, 686 .ops = &wm8750_dai_ops,
687}; 687};
688 688
689static int wm8750_suspend(struct snd_soc_codec *codec)
690{
691 wm8750_set_bias_level(codec, SND_SOC_BIAS_OFF);
692 return 0;
693}
694
695static int wm8750_resume(struct snd_soc_codec *codec)
696{
697 wm8750_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
698 return 0;
699}
700
701static int wm8750_probe(struct snd_soc_codec *codec) 689static int wm8750_probe(struct snd_soc_codec *codec)
702{ 690{
703 int ret; 691 int ret;
@@ -708,9 +696,6 @@ static int wm8750_probe(struct snd_soc_codec *codec)
708 return ret; 696 return ret;
709 } 697 }
710 698
711 /* charge output caps */
712 wm8750_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
713
714 /* set the update bits */ 699 /* set the update bits */
715 snd_soc_update_bits(codec, WM8750_LDAC, 0x0100, 0x0100); 700 snd_soc_update_bits(codec, WM8750_LDAC, 0x0100, 0x0100);
716 snd_soc_update_bits(codec, WM8750_RDAC, 0x0100, 0x0100); 701 snd_soc_update_bits(codec, WM8750_RDAC, 0x0100, 0x0100);
@@ -724,18 +709,10 @@ static int wm8750_probe(struct snd_soc_codec *codec)
724 return ret; 709 return ret;
725} 710}
726 711
727static int wm8750_remove(struct snd_soc_codec *codec)
728{
729 wm8750_set_bias_level(codec, SND_SOC_BIAS_OFF);
730 return 0;
731}
732
733static struct snd_soc_codec_driver soc_codec_dev_wm8750 = { 712static struct snd_soc_codec_driver soc_codec_dev_wm8750 = {
734 .probe = wm8750_probe, 713 .probe = wm8750_probe,
735 .remove = wm8750_remove,
736 .suspend = wm8750_suspend,
737 .resume = wm8750_resume,
738 .set_bias_level = wm8750_set_bias_level, 714 .set_bias_level = wm8750_set_bias_level,
715 .suspend_bias_off = true,
739 716
740 .controls = wm8750_snd_controls, 717 .controls = wm8750_snd_controls,
741 .num_controls = ARRAY_SIZE(wm8750_snd_controls), 718 .num_controls = ARRAY_SIZE(wm8750_snd_controls),