aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-11-23 07:37:27 -0500
committerMark Brown <broonie@kernel.org>2014-11-24 13:24:56 -0500
commit6c286afb01cc641e2a78e485467e4a90aedfbd75 (patch)
tree2c9e74afbca07f41ba03f0f9d05e480176e4dfeb
parentf114040e3ea6e07372334ade75d1ee0775c355e1 (diff)
ASoC: wm8776: 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>
-rw-r--r--sound/soc/codecs/wm8776.c31
1 files changed, 1 insertions, 30 deletions
diff --git a/sound/soc/codecs/wm8776.c b/sound/soc/codecs/wm8776.c
index 70952ceb278b..c13050b77931 100644
--- a/sound/soc/codecs/wm8776.c
+++ b/sound/soc/codecs/wm8776.c
@@ -408,24 +408,6 @@ static struct snd_soc_dai_driver wm8776_dai[] = {
408 }, 408 },
409}; 409};
410 410
411#ifdef CONFIG_PM
412static int wm8776_suspend(struct snd_soc_codec *codec)
413{
414 wm8776_set_bias_level(codec, SND_SOC_BIAS_OFF);
415
416 return 0;
417}
418
419static int wm8776_resume(struct snd_soc_codec *codec)
420{
421 wm8776_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
422 return 0;
423}
424#else
425#define wm8776_suspend NULL
426#define wm8776_resume NULL
427#endif
428
429static int wm8776_probe(struct snd_soc_codec *codec) 411static int wm8776_probe(struct snd_soc_codec *codec)
430{ 412{
431 int ret = 0; 413 int ret = 0;
@@ -436,8 +418,6 @@ static int wm8776_probe(struct snd_soc_codec *codec)
436 return ret; 418 return ret;
437 } 419 }
438 420
439 wm8776_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
440
441 /* Latch the update bits; right channel only since we always 421 /* Latch the update bits; right channel only since we always
442 * update both. */ 422 * update both. */
443 snd_soc_update_bits(codec, WM8776_HPRVOL, 0x100, 0x100); 423 snd_soc_update_bits(codec, WM8776_HPRVOL, 0x100, 0x100);
@@ -446,19 +426,10 @@ static int wm8776_probe(struct snd_soc_codec *codec)
446 return ret; 426 return ret;
447} 427}
448 428
449/* power down chip */
450static int wm8776_remove(struct snd_soc_codec *codec)
451{
452 wm8776_set_bias_level(codec, SND_SOC_BIAS_OFF);
453 return 0;
454}
455
456static struct snd_soc_codec_driver soc_codec_dev_wm8776 = { 429static struct snd_soc_codec_driver soc_codec_dev_wm8776 = {
457 .probe = wm8776_probe, 430 .probe = wm8776_probe,
458 .remove = wm8776_remove,
459 .suspend = wm8776_suspend,
460 .resume = wm8776_resume,
461 .set_bias_level = wm8776_set_bias_level, 431 .set_bias_level = wm8776_set_bias_level,
432 .suspend_bias_off = true,
462 433
463 .controls = wm8776_snd_controls, 434 .controls = wm8776_snd_controls,
464 .num_controls = ARRAY_SIZE(wm8776_snd_controls), 435 .num_controls = ARRAY_SIZE(wm8776_snd_controls),