Skip to contentSkip to conversation

ASoC: core: Better support for idle_bias_off suspend ignores

PATCH In review Mark Brown 2 participants 2 messages Jan 31, 2012

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 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.

---
 sound/soc/soc-core.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
sound/soc/soc-core.c +11 -0
index 53fd9d2..09fa8a6 100644
@@ -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;
Signature · 1 line
1.7.9.rc1
Acked-by on v1 1/1
#1 lore raw
Quoted 29 lines · Mark Brown

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.

---
 sound/soc/soc-core.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
sound/soc/soc-core.c +4 -0
index 53fd9d2..09fa8a6 100644
@@ -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,

sound/soc/soc-core.c int snd_soc_suspend(struct device *dev) · line 583

Quoted 10 lines
sound/soc/soc-core.c +7 -0
+				 * 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;