Commit dfcc9047 authored by Mark Brown's avatar Mark Brown

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: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarLiam Girdwood <lrg@ti.com>
parent 56fba41f
...@@ -1147,8 +1147,27 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event) ...@@ -1147,8 +1147,27 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event)
power = w->power_check(w); power = w->power_check(w);
else else
power = 1; 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) if (w->power == power)
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment