diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-11-23 07:37:32 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-11-24 13:28:20 -0500 |
commit | bf68a0470876b5bf43758c50a7585eb5f6e177ea (patch) | |
tree | e965380520b1ab5bb2426685487b8d961d0d76b3 /sound | |
parent | f114040e3ea6e07372334ade75d1ee0775c355e1 (diff) |
ASoC: wm8955: 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 this is already done 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.
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')
-rw-r--r-- | sound/soc/codecs/wm8955.c | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/sound/soc/codecs/wm8955.c b/sound/soc/codecs/wm8955.c index 09d91d9dc4ee..1173f7fef5a7 100644 --- a/sound/soc/codecs/wm8955.c +++ b/sound/soc/codecs/wm8955.c | |||
@@ -866,29 +866,6 @@ static struct snd_soc_dai_driver wm8955_dai = { | |||
866 | .ops = &wm8955_dai_ops, | 866 | .ops = &wm8955_dai_ops, |
867 | }; | 867 | }; |
868 | 868 | ||
869 | #ifdef CONFIG_PM | ||
870 | static int wm8955_suspend(struct snd_soc_codec *codec) | ||
871 | { | ||
872 | struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec); | ||
873 | |||
874 | wm8955_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
875 | |||
876 | regcache_mark_dirty(wm8955->regmap); | ||
877 | |||
878 | return 0; | ||
879 | } | ||
880 | |||
881 | static int wm8955_resume(struct snd_soc_codec *codec) | ||
882 | { | ||
883 | wm8955_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
884 | |||
885 | return 0; | ||
886 | } | ||
887 | #else | ||
888 | #define wm8955_suspend NULL | ||
889 | #define wm8955_resume NULL | ||
890 | #endif | ||
891 | |||
892 | static int wm8955_probe(struct snd_soc_codec *codec) | 869 | static int wm8955_probe(struct snd_soc_codec *codec) |
893 | { | 870 | { |
894 | struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec); | 871 | struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec); |
@@ -964,18 +941,10 @@ err_enable: | |||
964 | return ret; | 941 | return ret; |
965 | } | 942 | } |
966 | 943 | ||
967 | static int wm8955_remove(struct snd_soc_codec *codec) | ||
968 | { | ||
969 | wm8955_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
970 | return 0; | ||
971 | } | ||
972 | |||
973 | static struct snd_soc_codec_driver soc_codec_dev_wm8955 = { | 944 | static struct snd_soc_codec_driver soc_codec_dev_wm8955 = { |
974 | .probe = wm8955_probe, | 945 | .probe = wm8955_probe, |
975 | .remove = wm8955_remove, | ||
976 | .suspend = wm8955_suspend, | ||
977 | .resume = wm8955_resume, | ||
978 | .set_bias_level = wm8955_set_bias_level, | 946 | .set_bias_level = wm8955_set_bias_level, |
947 | .suspend_bias_off = true, | ||
979 | 948 | ||
980 | .controls = wm8955_snd_controls, | 949 | .controls = wm8955_snd_controls, |
981 | .num_controls = ARRAY_SIZE(wm8955_snd_controls), | 950 | .num_controls = ARRAY_SIZE(wm8955_snd_controls), |