aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/tlv320aic32x4.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-11-26 14:57:56 -0500
committerMark Brown <broonie@kernel.org>2014-11-27 06:16:35 -0500
commitf10c0a71e6efc7c8cbc3bfcfd0ecf822607f0b3d (patch)
tree4b3ed61e734679e11cb833e6ea5c9bbf3aeb3088 /sound/soc/codecs/tlv320aic32x4.c
parentf114040e3ea6e07372334ade75d1ee0775c355e1 (diff)
ASoC: tlv320aic32x4: 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> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/tlv320aic32x4.c')
-rw-r--r--sound/soc/codecs/tlv320aic32x4.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index 6ea662db2410..015467ed606b 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -597,18 +597,6 @@ static struct snd_soc_dai_driver aic32x4_dai = {
597 .symmetric_rates = 1, 597 .symmetric_rates = 1,
598}; 598};
599 599
600static int aic32x4_suspend(struct snd_soc_codec *codec)
601{
602 aic32x4_set_bias_level(codec, SND_SOC_BIAS_OFF);
603 return 0;
604}
605
606static int aic32x4_resume(struct snd_soc_codec *codec)
607{
608 aic32x4_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
609 return 0;
610}
611
612static int aic32x4_probe(struct snd_soc_codec *codec) 600static int aic32x4_probe(struct snd_soc_codec *codec)
613{ 601{
614 struct aic32x4_priv *aic32x4 = snd_soc_codec_get_drvdata(codec); 602 struct aic32x4_priv *aic32x4 = snd_soc_codec_get_drvdata(codec);
@@ -654,8 +642,6 @@ static int aic32x4_probe(struct snd_soc_codec *codec)
654 snd_soc_write(codec, AIC32X4_RMICPGANIN, 642 snd_soc_write(codec, AIC32X4_RMICPGANIN,
655 AIC32X4_RMICPGANIN_CM1R_10K); 643 AIC32X4_RMICPGANIN_CM1R_10K);
656 644
657 aic32x4_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
658
659 /* 645 /*
660 * Workaround: for an unknown reason, the ADC needs to be powered up 646 * Workaround: for an unknown reason, the ADC needs to be powered up
661 * and down for the first capture to work properly. It seems related to 647 * and down for the first capture to work properly. It seems related to
@@ -669,18 +655,10 @@ static int aic32x4_probe(struct snd_soc_codec *codec)
669 return 0; 655 return 0;
670} 656}
671 657
672static int aic32x4_remove(struct snd_soc_codec *codec)
673{
674 aic32x4_set_bias_level(codec, SND_SOC_BIAS_OFF);
675 return 0;
676}
677
678static struct snd_soc_codec_driver soc_codec_dev_aic32x4 = { 658static struct snd_soc_codec_driver soc_codec_dev_aic32x4 = {
679 .probe = aic32x4_probe, 659 .probe = aic32x4_probe,
680 .remove = aic32x4_remove,
681 .suspend = aic32x4_suspend,
682 .resume = aic32x4_resume,
683 .set_bias_level = aic32x4_set_bias_level, 660 .set_bias_level = aic32x4_set_bias_level,
661 .suspend_bias_off = true,
684 662
685 .controls = aic32x4_snd_controls, 663 .controls = aic32x4_snd_controls,
686 .num_controls = ARRAY_SIZE(aic32x4_snd_controls), 664 .num_controls = ARRAY_SIZE(aic32x4_snd_controls),