diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-09-04 19:44:06 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-09-04 20:10:25 +0100 |
commit | 86dbf2ac6fcb2d2932d4610f2dfe0954aa0633f7 (patch) | |
tree | eca1064e4c727feb98ab402f81f3f8b83e3f0bd1 /sound/soc/soc-core.c | |
parent | 1c325f771a88579f227fe017e4ee77d852cf5435 (diff) | |
download | lwn-86dbf2ac6fcb2d2932d4610f2dfe0954aa0633f7.tar.gz lwn-86dbf2ac6fcb2d2932d4610f2dfe0954aa0633f7.zip |
ASoC: Add support for automatically going to BIAS_OFF on suspend
There is a substantial amount of drivers that in go to SND_SOC_BIAS_OFF on
suspend and go back to SND_SOC_BIAS_SUSPEND on resume (Often this is even
the only thing done in the suspend and resume handlers). This patch
introduces a new suspend_bias_off flag, which when set by a driver will let
the ASoC core automatically put the device's DAPM context at the
SND_SOC_BIAS_OFF level during suspend. Once the device is resumed the DAPM
context will go back to SND_SOC_BIAS_STANDBY (if the context is idle,
otherwise to SND_SOC_BIAS_ON).
This will allow us to remove a fair bit of duplicated code from the drivers.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 068785fa1a06..2bdf9a4ac2b4 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -4402,6 +4402,7 @@ int snd_soc_register_codec(struct device *dev, codec->component.ignore_pmdown_time = codec_drv->ignore_pmdown_time; codec->dapm.codec = codec; codec->dapm.idle_bias_off = codec_drv->idle_bias_off; + codec->dapm.suspend_bias_off = codec_drv->suspend_bias_off; if (codec_drv->seq_notifier) codec->dapm.seq_notifier = codec_drv->seq_notifier; if (codec_drv->set_bias_level) |