aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-10-20 04:56:38 -0400
committerMark Brown <broonie@kernel.org>2014-10-22 06:33:53 -0400
commitcfbb77ce368b8d4181e06f8982a440702567eb98 (patch)
tree7a379f6bd3cabaece042d7cab4efea7fb80b2e02
parentf114040e3ea6e07372334ade75d1ee0775c355e1 (diff)
ASoC: sta529: 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>
-rw-r--r--sound/soc/codecs/sta529.c35
1 files changed, 2 insertions, 33 deletions
diff --git a/sound/soc/codecs/sta529.c b/sound/soc/codecs/sta529.c
index 89c748dd3d6e..b0f436d10125 100644
--- a/sound/soc/codecs/sta529.c
+++ b/sound/soc/codecs/sta529.c
@@ -319,41 +319,10 @@ static struct snd_soc_dai_driver sta529_dai = {
319 .ops = &sta529_dai_ops, 319 .ops = &sta529_dai_ops,
320}; 320};
321 321
322static int sta529_probe(struct snd_soc_codec *codec)
323{
324 sta529_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
325
326 return 0;
327}
328
329/* power down chip */
330static int sta529_remove(struct snd_soc_codec *codec)
331{
332 sta529_set_bias_level(codec, SND_SOC_BIAS_OFF);
333
334 return 0;
335}
336
337static int sta529_suspend(struct snd_soc_codec *codec)
338{
339 sta529_set_bias_level(codec, SND_SOC_BIAS_OFF);
340
341 return 0;
342}
343
344static int sta529_resume(struct snd_soc_codec *codec)
345{
346 sta529_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
347
348 return 0;
349}
350
351static const struct snd_soc_codec_driver sta529_codec_driver = { 322static const struct snd_soc_codec_driver sta529_codec_driver = {
352 .probe = sta529_probe,
353 .remove = sta529_remove,
354 .set_bias_level = sta529_set_bias_level, 323 .set_bias_level = sta529_set_bias_level,
355 .suspend = sta529_suspend, 324 .suspend_bias_off = true,
356 .resume = sta529_resume, 325
357 .controls = sta529_snd_controls, 326 .controls = sta529_snd_controls,
358 .num_controls = ARRAY_SIZE(sta529_snd_controls), 327 .num_controls = ARRAY_SIZE(sta529_snd_controls),
359}; 328};