diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-09-09 14:42:41 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-09-09 16:08:38 -0400 |
commit | 2a4bc751fcc50c15bd4782cfc2ea513bef92a20f (patch) | |
tree | 5511b59aef5d57602eb8b58552db25cd1fbe0535 /sound/soc | |
parent | 417c60e8f248a84e8e768c55d191689d1e27e05f (diff) |
ASoC: cs42l56: 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: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/codecs/cs42l56.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/sound/soc/codecs/cs42l56.c b/sound/soc/codecs/cs42l56.c index bb74dd17fa26..2ddc7ac10ad7 100644 --- a/sound/soc/codecs/cs42l56.c +++ b/sound/soc/codecs/cs42l56.c | |||
@@ -1016,20 +1016,6 @@ static struct snd_soc_dai_driver cs42l56_dai = { | |||
1016 | .ops = &cs42l56_ops, | 1016 | .ops = &cs42l56_ops, |
1017 | }; | 1017 | }; |
1018 | 1018 | ||
1019 | static int cs42l56_suspend(struct snd_soc_codec *codec) | ||
1020 | { | ||
1021 | cs42l56_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
1022 | |||
1023 | return 0; | ||
1024 | } | ||
1025 | |||
1026 | static int cs42l56_resume(struct snd_soc_codec *codec) | ||
1027 | { | ||
1028 | cs42l56_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
1029 | |||
1030 | return 0; | ||
1031 | } | ||
1032 | |||
1033 | static int beep_freq[] = { | 1019 | static int beep_freq[] = { |
1034 | 261, 522, 585, 667, 706, 774, 889, 1000, | 1020 | 261, 522, 585, 667, 706, 774, 889, 1000, |
1035 | 1043, 1200, 1333, 1412, 1600, 1714, 2000, 2182 | 1021 | 1043, 1200, 1333, 1412, 1600, 1714, 2000, 2182 |
@@ -1168,15 +1154,12 @@ static int cs42l56_probe(struct snd_soc_codec *codec) | |||
1168 | { | 1154 | { |
1169 | cs42l56_init_beep(codec); | 1155 | cs42l56_init_beep(codec); |
1170 | 1156 | ||
1171 | cs42l56_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
1172 | |||
1173 | return 0; | 1157 | return 0; |
1174 | } | 1158 | } |
1175 | 1159 | ||
1176 | static int cs42l56_remove(struct snd_soc_codec *codec) | 1160 | static int cs42l56_remove(struct snd_soc_codec *codec) |
1177 | { | 1161 | { |
1178 | cs42l56_free_beep(codec); | 1162 | cs42l56_free_beep(codec); |
1179 | cs42l56_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
1180 | 1163 | ||
1181 | return 0; | 1164 | return 0; |
1182 | } | 1165 | } |
@@ -1184,9 +1167,8 @@ static int cs42l56_remove(struct snd_soc_codec *codec) | |||
1184 | static struct snd_soc_codec_driver soc_codec_dev_cs42l56 = { | 1167 | static struct snd_soc_codec_driver soc_codec_dev_cs42l56 = { |
1185 | .probe = cs42l56_probe, | 1168 | .probe = cs42l56_probe, |
1186 | .remove = cs42l56_remove, | 1169 | .remove = cs42l56_remove, |
1187 | .suspend = cs42l56_suspend, | ||
1188 | .resume = cs42l56_resume, | ||
1189 | .set_bias_level = cs42l56_set_bias_level, | 1170 | .set_bias_level = cs42l56_set_bias_level, |
1171 | .suspend_bias_off = true, | ||
1190 | 1172 | ||
1191 | .dapm_widgets = cs42l56_dapm_widgets, | 1173 | .dapm_widgets = cs42l56_dapm_widgets, |
1192 | .num_dapm_widgets = ARRAY_SIZE(cs42l56_dapm_widgets), | 1174 | .num_dapm_widgets = ARRAY_SIZE(cs42l56_dapm_widgets), |