diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-09-06 08:29:33 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-09-06 08:38:07 -0400 |
commit | 2a93f70925a56ae1629be8b46c3c6d502f98dded (patch) | |
tree | 9a15031e02953e3c976281536a692d2681df1c07 | |
parent | 3d2c42d191a89ab35e3002309882e3b70fe12112 (diff) |
ASoC: jz4740: 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>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/jz4740.c | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/sound/soc/codecs/jz4740.c b/sound/soc/codecs/jz4740.c index bcebd1a9ce31..df7c01cf7072 100644 --- a/sound/soc/codecs/jz4740.c +++ b/sound/soc/codecs/jz4740.c | |||
@@ -293,41 +293,13 @@ static int jz4740_codec_dev_probe(struct snd_soc_codec *codec) | |||
293 | regmap_update_bits(jz4740_codec->regmap, JZ4740_REG_CODEC_1, | 293 | regmap_update_bits(jz4740_codec->regmap, JZ4740_REG_CODEC_1, |
294 | JZ4740_CODEC_1_SW2_ENABLE, JZ4740_CODEC_1_SW2_ENABLE); | 294 | JZ4740_CODEC_1_SW2_ENABLE, JZ4740_CODEC_1_SW2_ENABLE); |
295 | 295 | ||
296 | jz4740_codec_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
297 | |||
298 | return 0; | 296 | return 0; |
299 | } | 297 | } |
300 | 298 | ||
301 | static int jz4740_codec_dev_remove(struct snd_soc_codec *codec) | ||
302 | { | ||
303 | jz4740_codec_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
304 | |||
305 | return 0; | ||
306 | } | ||
307 | |||
308 | #ifdef CONFIG_PM_SLEEP | ||
309 | |||
310 | static int jz4740_codec_suspend(struct snd_soc_codec *codec) | ||
311 | { | ||
312 | return jz4740_codec_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
313 | } | ||
314 | |||
315 | static int jz4740_codec_resume(struct snd_soc_codec *codec) | ||
316 | { | ||
317 | return jz4740_codec_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
318 | } | ||
319 | |||
320 | #else | ||
321 | #define jz4740_codec_suspend NULL | ||
322 | #define jz4740_codec_resume NULL | ||
323 | #endif | ||
324 | |||
325 | static struct snd_soc_codec_driver soc_codec_dev_jz4740_codec = { | 299 | static struct snd_soc_codec_driver soc_codec_dev_jz4740_codec = { |
326 | .probe = jz4740_codec_dev_probe, | 300 | .probe = jz4740_codec_dev_probe, |
327 | .remove = jz4740_codec_dev_remove, | ||
328 | .suspend = jz4740_codec_suspend, | ||
329 | .resume = jz4740_codec_resume, | ||
330 | .set_bias_level = jz4740_codec_set_bias_level, | 301 | .set_bias_level = jz4740_codec_set_bias_level, |
302 | .suspend_bias_off = true, | ||
331 | 303 | ||
332 | .controls = jz4740_codec_controls, | 304 | .controls = jz4740_codec_controls, |
333 | .num_controls = ARRAY_SIZE(jz4740_codec_controls), | 305 | .num_controls = ARRAY_SIZE(jz4740_codec_controls), |