diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-06-04 10:34:43 (GMT) |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-06-06 20:45:44 (GMT) |
commit | dfcc9047c97ca99b151e30133c9bccf5ab258ca6 (patch) | |
tree | d61be1397b018c9e31a0703cc8bdde9d7b73e2c0 | |
parent | 56fba41f8f6444f9e2db3bfe2c4cc5c5bac43d1d (diff) | |
download | linux-dfcc9047c97ca99b151e30133c9bccf5ab258ca6.tar.xz |
ASoC: Don't bring the CODEC up to full power for supplies and biases
If the only widgets active within a CODEC are supplies and micbiases we
are not passing audio, we are probably just doing microphone detection.
This will not generally require either fully accurate reference voltages
or much power so
If this turns out to be unsuitable for some systems we can provide a
facility to override this decision.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
-rw-r--r-- | sound/soc/soc-dapm.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 0bbded4..6be6546 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -1147,8 +1147,27 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event) power = w->power_check(w); else power = 1; - if (power) - w->dapm->target_bias_level = SND_SOC_BIAS_ON; + + if (power) { + d = w->dapm; + + /* Supplies and micbiases only bring + * the context up to STANDBY as unless + * something else is active and + * passing audio they generally don't + * require full power. + */ + switch (w->id) { + case snd_soc_dapm_supply: + case snd_soc_dapm_micbias: + if (d->target_bias_level < SND_SOC_BIAS_STANDBY) + d->target_bias_level = SND_SOC_BIAS_STANDBY; + break; + default: + d->target_bias_level = SND_SOC_BIAS_ON; + break; + } + } if (w->power == power) continue; |