aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-09-04 13:44:12 -0400
committerMark Brown <broonie@kernel.org>2014-09-04 15:10:26 -0400
commit85362efb80070bed890602483f71cd103be303c2 (patch)
tree35d74d717707f9ca41161c190c144c848972cc85
parent0f0cc5a775ebe88d9be12489874bd2799b42e242 (diff)
ASoC: ssm2602: 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. While we are at it also remove the regcache_cache_only() calls from suspend/resume as there shouldn't be any IO between suspend and resume. 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>
-rw-r--r--sound/soc/codecs/ssm2602.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/sound/soc/codecs/ssm2602.c b/sound/soc/codecs/ssm2602.c
index 484b3bbe8624..0dec13648563 100644
--- a/sound/soc/codecs/ssm2602.c
+++ b/sound/soc/codecs/ssm2602.c
@@ -502,18 +502,11 @@ static struct snd_soc_dai_driver ssm2602_dai = {
502 .symmetric_samplebits = 1, 502 .symmetric_samplebits = 1,
503}; 503};
504 504
505static int ssm2602_suspend(struct snd_soc_codec *codec)
506{
507 ssm2602_set_bias_level(codec, SND_SOC_BIAS_OFF);
508 return 0;
509}
510
511static int ssm2602_resume(struct snd_soc_codec *codec) 505static int ssm2602_resume(struct snd_soc_codec *codec)
512{ 506{
513 struct ssm2602_priv *ssm2602 = snd_soc_codec_get_drvdata(codec); 507 struct ssm2602_priv *ssm2602 = snd_soc_codec_get_drvdata(codec);
514 508
515 regcache_sync(ssm2602->regmap); 509 regcache_sync(ssm2602->regmap);
516 ssm2602_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
517 510
518 return 0; 511 return 0;
519} 512}
@@ -586,27 +579,14 @@ static int ssm260x_codec_probe(struct snd_soc_codec *codec)
586 break; 579 break;
587 } 580 }
588 581
589 if (ret) 582 return ret;
590 return ret;
591
592 ssm2602_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
593
594 return 0;
595}
596
597/* remove everything here */
598static int ssm2602_remove(struct snd_soc_codec *codec)
599{
600 ssm2602_set_bias_level(codec, SND_SOC_BIAS_OFF);
601 return 0;
602} 583}
603 584
604static struct snd_soc_codec_driver soc_codec_dev_ssm2602 = { 585static struct snd_soc_codec_driver soc_codec_dev_ssm2602 = {
605 .probe = ssm260x_codec_probe, 586 .probe = ssm260x_codec_probe,
606 .remove = ssm2602_remove,
607 .suspend = ssm2602_suspend,
608 .resume = ssm2602_resume, 587 .resume = ssm2602_resume,
609 .set_bias_level = ssm2602_set_bias_level, 588 .set_bias_level = ssm2602_set_bias_level,
589 .suspend_bias_off = true,
610 590
611 .controls = ssm260x_snd_controls, 591 .controls = ssm260x_snd_controls,
612 .num_controls = ARRAY_SIZE(ssm260x_snd_controls), 592 .num_controls = ARRAY_SIZE(ssm260x_snd_controls),