aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-09-06 08:29:34 -0400
committerMark Brown <broonie@kernel.org>2014-09-06 08:38:07 -0400
commit35199a7c11d5f6a87a5b35dfd69fde3f65d37fac (patch)
treeb2ff46a7d436d5cea7346e23ecc976d838192f9f
parent2a93f70925a56ae1629be8b46c3c6d502f98dded (diff)
ASoC: ml26124: 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. 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>
-rw-r--r--sound/soc/codecs/ml26124.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/sound/soc/codecs/ml26124.c b/sound/soc/codecs/ml26124.c
index e661e8420e3d..711f55039522 100644
--- a/sound/soc/codecs/ml26124.c
+++ b/sound/soc/codecs/ml26124.c
@@ -565,41 +565,19 @@ static struct snd_soc_dai_driver ml26124_dai = {
565 .symmetric_rates = 1, 565 .symmetric_rates = 1,
566}; 566};
567 567
568#ifdef CONFIG_PM
569static int ml26124_suspend(struct snd_soc_codec *codec)
570{
571 ml26124_set_bias_level(codec, SND_SOC_BIAS_OFF);
572
573 return 0;
574}
575
576static int ml26124_resume(struct snd_soc_codec *codec)
577{
578 ml26124_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
579
580 return 0;
581}
582#else
583#define ml26124_suspend NULL
584#define ml26124_resume NULL
585#endif
586
587static int ml26124_probe(struct snd_soc_codec *codec) 568static int ml26124_probe(struct snd_soc_codec *codec)
588{ 569{
589 /* Software Reset */ 570 /* Software Reset */
590 snd_soc_update_bits(codec, ML26124_SW_RST, 0x01, 1); 571 snd_soc_update_bits(codec, ML26124_SW_RST, 0x01, 1);
591 snd_soc_update_bits(codec, ML26124_SW_RST, 0x01, 0); 572 snd_soc_update_bits(codec, ML26124_SW_RST, 0x01, 0);
592 573
593 ml26124_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
594
595 return 0; 574 return 0;
596} 575}
597 576
598static struct snd_soc_codec_driver soc_codec_dev_ml26124 = { 577static struct snd_soc_codec_driver soc_codec_dev_ml26124 = {
599 .probe = ml26124_probe, 578 .probe = ml26124_probe,
600 .suspend = ml26124_suspend,
601 .resume = ml26124_resume,
602 .set_bias_level = ml26124_set_bias_level, 579 .set_bias_level = ml26124_set_bias_level,
580 .suspend_bias_off = true,
603 .dapm_widgets = ml26124_dapm_widgets, 581 .dapm_widgets = ml26124_dapm_widgets,
604 .num_dapm_widgets = ARRAY_SIZE(ml26124_dapm_widgets), 582 .num_dapm_widgets = ARRAY_SIZE(ml26124_dapm_widgets),
605 .dapm_routes = ml26124_intercon, 583 .dapm_routes = ml26124_intercon,