aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8753.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2015-03-30 15:04:49 -0400
committerMark Brown <broonie@kernel.org>2015-04-01 16:28:01 -0400
commita1f0b9674936bf55d5d49813de01547de2667690 (patch)
treef47a79c7ae73e6d18d232cc525c36ab0048ca23e /sound/soc/codecs/wm8753.c
parent35afd9221b301d1959eadab2d45a2cb94dcb7d30 (diff)
ASoC: wm8753: 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>
Diffstat (limited to 'sound/soc/codecs/wm8753.c')
-rw-r--r--sound/soc/codecs/wm8753.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c
index 176fcb1530c3..c50a5959345f 100644
--- a/sound/soc/codecs/wm8753.c
+++ b/sound/soc/codecs/wm8753.c
@@ -1447,19 +1447,12 @@ static struct snd_soc_dai_driver wm8753_dai[] = {
1447}, 1447},
1448}; 1448};
1449 1449
1450static int wm8753_suspend(struct snd_soc_codec *codec)
1451{
1452 wm8753_set_bias_level(codec, SND_SOC_BIAS_OFF);
1453 return 0;
1454}
1455
1456static int wm8753_resume(struct snd_soc_codec *codec) 1450static int wm8753_resume(struct snd_soc_codec *codec)
1457{ 1451{
1458 struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec); 1452 struct wm8753_priv *wm8753 = snd_soc_codec_get_drvdata(codec);
1459 1453
1460 regcache_sync(wm8753->regmap); 1454 regcache_sync(wm8753->regmap);
1461 1455
1462 wm8753_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
1463 return 0; 1456 return 0;
1464} 1457}
1465 1458
@@ -1476,7 +1469,6 @@ static int wm8753_probe(struct snd_soc_codec *codec)
1476 return ret; 1469 return ret;
1477 } 1470 }
1478 1471
1479 wm8753_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
1480 wm8753->dai_func = 0; 1472 wm8753->dai_func = 0;
1481 1473
1482 /* set the update bits */ 1474 /* set the update bits */
@@ -1494,20 +1486,11 @@ static int wm8753_probe(struct snd_soc_codec *codec)
1494 return 0; 1486 return 0;
1495} 1487}
1496 1488
1497/* power down chip */
1498static int wm8753_remove(struct snd_soc_codec *codec)
1499{
1500 wm8753_set_bias_level(codec, SND_SOC_BIAS_OFF);
1501
1502 return 0;
1503}
1504
1505static struct snd_soc_codec_driver soc_codec_dev_wm8753 = { 1489static struct snd_soc_codec_driver soc_codec_dev_wm8753 = {
1506 .probe = wm8753_probe, 1490 .probe = wm8753_probe,
1507 .remove = wm8753_remove,
1508 .suspend = wm8753_suspend,
1509 .resume = wm8753_resume, 1491 .resume = wm8753_resume,
1510 .set_bias_level = wm8753_set_bias_level, 1492 .set_bias_level = wm8753_set_bias_level,
1493 .suspend_bias_off = true,
1511 1494
1512 .controls = wm8753_snd_controls, 1495 .controls = wm8753_snd_controls,
1513 .num_controls = ARRAY_SIZE(wm8753_snd_controls), 1496 .num_controls = ARRAY_SIZE(wm8753_snd_controls),