From: Mark Brown Date: Tue, 31 Jan 2012 15:49:10 +0000 (+0000) Subject: ASoC: core: Better support for idle_bias_off suspend ignores X-Git-Tag: v3.3-rc3~6^2^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=125a25da5729740b7d1dc417a3d5549321baae17;p=platform%2Fkernel%2Flinux-exynos.git ASoC: core: Better support for idle_bias_off suspend ignores If an idle_bias_off device is in any state other than off then it is still active for some reason (typically a low power function such as accessory detection). This wasn't an issue when the feature was implemented as we always went to _ON for any active function, subsequent power improvements have changed things. With the modern way of doing things we should overhaul the infrastructure to allow devices to explicitly take references for these functions but that's a much more invasive change and will require driver updates to deploy, this will bring the framework into line with the existing driver set before we do that work. Signed-off-by: Mark Brown Acked-by: Liam Girdwood --- diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index b5ecf6d..92cee24 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -567,6 +567,17 @@ int snd_soc_suspend(struct device *dev) if (!codec->suspended && codec->driver->suspend) { switch (codec->dapm.bias_level) { case SND_SOC_BIAS_STANDBY: + /* + * If the CODEC is capable of idle + * bias off then being in STANDBY + * means it's doing something, + * otherwise fall through. + */ + if (codec->dapm.idle_bias_off) { + dev_dbg(codec->dev, + "idle_bias_off CODEC on over suspend\n"); + break; + } case SND_SOC_BIAS_OFF: codec->driver->suspend(codec); codec->suspended = 1;