diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-11-23 07:37:39 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-11-24 13:37:49 -0500 |
commit | 1f07b8de451f5f4f6a268a95a34183e528cda711 (patch) | |
tree | 183065b9e308ec3440eef846f0212f1436d00f41 /sound/soc | |
parent | 5d01410fe4d92081f349b013a2e7a95429e4f2c9 (diff) |
ASoC: wm8988: 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. Also remove the regcache_mark_dirty()
from the suspend handler since it is already called by the ASoC core.
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>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/codecs/wm8988.c | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/sound/soc/codecs/wm8988.c b/sound/soc/codecs/wm8988.c index a5130d965146..e418199155a8 100644 --- a/sound/soc/codecs/wm8988.c +++ b/sound/soc/codecs/wm8988.c | |||
@@ -793,21 +793,6 @@ static struct snd_soc_dai_driver wm8988_dai = { | |||
793 | .symmetric_rates = 1, | 793 | .symmetric_rates = 1, |
794 | }; | 794 | }; |
795 | 795 | ||
796 | static int wm8988_suspend(struct snd_soc_codec *codec) | ||
797 | { | ||
798 | struct wm8988_priv *wm8988 = snd_soc_codec_get_drvdata(codec); | ||
799 | |||
800 | wm8988_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
801 | regcache_mark_dirty(wm8988->regmap); | ||
802 | return 0; | ||
803 | } | ||
804 | |||
805 | static int wm8988_resume(struct snd_soc_codec *codec) | ||
806 | { | ||
807 | wm8988_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
808 | return 0; | ||
809 | } | ||
810 | |||
811 | static int wm8988_probe(struct snd_soc_codec *codec) | 796 | static int wm8988_probe(struct snd_soc_codec *codec) |
812 | { | 797 | { |
813 | int ret = 0; | 798 | int ret = 0; |
@@ -825,23 +810,13 @@ static int wm8988_probe(struct snd_soc_codec *codec) | |||
825 | snd_soc_update_bits(codec, WM8988_ROUT2V, 0x0100, 0x0100); | 810 | snd_soc_update_bits(codec, WM8988_ROUT2V, 0x0100, 0x0100); |
826 | snd_soc_update_bits(codec, WM8988_RINVOL, 0x0100, 0x0100); | 811 | snd_soc_update_bits(codec, WM8988_RINVOL, 0x0100, 0x0100); |
827 | 812 | ||
828 | wm8988_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
829 | |||
830 | return 0; | ||
831 | } | ||
832 | |||
833 | static int wm8988_remove(struct snd_soc_codec *codec) | ||
834 | { | ||
835 | wm8988_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
836 | return 0; | 813 | return 0; |
837 | } | 814 | } |
838 | 815 | ||
839 | static struct snd_soc_codec_driver soc_codec_dev_wm8988 = { | 816 | static struct snd_soc_codec_driver soc_codec_dev_wm8988 = { |
840 | .probe = wm8988_probe, | 817 | .probe = wm8988_probe, |
841 | .remove = wm8988_remove, | ||
842 | .suspend = wm8988_suspend, | ||
843 | .resume = wm8988_resume, | ||
844 | .set_bias_level = wm8988_set_bias_level, | 818 | .set_bias_level = wm8988_set_bias_level, |
819 | .suspend_bias_off = true, | ||
845 | 820 | ||
846 | .controls = wm8988_snd_controls, | 821 | .controls = wm8988_snd_controls, |
847 | .num_controls = ARRAY_SIZE(wm8988_snd_controls), | 822 | .num_controls = ARRAY_SIZE(wm8988_snd_controls), |