aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8728.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-11-23 07:37:23 -0500
committerMark Brown <broonie@kernel.org>2014-11-24 13:20:49 -0500
commitd4d41436ff3b1fddf2f8feafa6772647eac6b61d (patch)
treeab7f52218d41b433338c529b6a53cc8f6ca954ff /sound/soc/codecs/wm8728.c
parentf114040e3ea6e07372334ade75d1ee0775c355e1 (diff)
ASoC: wm8728: 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/wm8728.c')
-rw-r--r--sound/soc/codecs/wm8728.c34
1 files changed, 2 insertions, 32 deletions
diff --git a/sound/soc/codecs/wm8728.c b/sound/soc/codecs/wm8728.c
index 38ff826f589a..55c7fb4fc786 100644
--- a/sound/soc/codecs/wm8728.c
+++ b/sound/soc/codecs/wm8728.c
@@ -212,40 +212,10 @@ static struct snd_soc_dai_driver wm8728_dai = {
212 .ops = &wm8728_dai_ops, 212 .ops = &wm8728_dai_ops,
213}; 213};
214 214
215static int wm8728_suspend(struct snd_soc_codec *codec)
216{
217 wm8728_set_bias_level(codec, SND_SOC_BIAS_OFF);
218
219 return 0;
220}
221
222static int wm8728_resume(struct snd_soc_codec *codec)
223{
224 wm8728_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
225
226 return 0;
227}
228
229static int wm8728_probe(struct snd_soc_codec *codec)
230{
231 /* power on device */
232 wm8728_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
233
234 return 0;
235}
236
237static int wm8728_remove(struct snd_soc_codec *codec)
238{
239 wm8728_set_bias_level(codec, SND_SOC_BIAS_OFF);
240 return 0;
241}
242
243static struct snd_soc_codec_driver soc_codec_dev_wm8728 = { 215static struct snd_soc_codec_driver soc_codec_dev_wm8728 = {
244 .probe = wm8728_probe,
245 .remove = wm8728_remove,
246 .suspend = wm8728_suspend,
247 .resume = wm8728_resume,
248 .set_bias_level = wm8728_set_bias_level, 216 .set_bias_level = wm8728_set_bias_level,
217 .suspend_bias_off = true,
218
249 .controls = wm8728_snd_controls, 219 .controls = wm8728_snd_controls,
250 .num_controls = ARRAY_SIZE(wm8728_snd_controls), 220 .num_controls = ARRAY_SIZE(wm8728_snd_controls),
251 .dapm_widgets = wm8728_dapm_widgets, 221 .dapm_widgets = wm8728_dapm_widgets,