aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-06-04 06:34:43 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-06-06 16:45:44 -0400
commitdfcc9047c97ca99b151e30133c9bccf5ab258ca6 (patch)
treed61be1397b018c9e31a0703cc8bdde9d7b73e2c0 /sound/soc/soc-dapm.c
parent56fba41f8f6444f9e2db3bfe2c4cc5c5bac43d1d (diff)
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>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 0bbded43e213..6be6546648c8 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)
1147 power = w->power_check(w); 1147 power = w->power_check(w);
1148 else 1148 else
1149 power = 1; 1149 power = 1;
1150 if (power) 1150
1151 w->dapm->target_bias_level = SND_SOC_BIAS_ON; 1151 if (power) {
1152 d = w->dapm;
1153
1154 /* Supplies and micbiases only bring
1155 * the context up to STANDBY as unless
1156 * something else is active and
1157 * passing audio they generally don't
1158 * require full power.
1159 */
1160 switch (w->id) {
1161 case snd_soc_dapm_supply:
1162 case snd_soc_dapm_micbias:
1163 if (d->target_bias_level < SND_SOC_BIAS_STANDBY)
1164 d->target_bias_level = SND_SOC_BIAS_STANDBY;
1165 break;
1166 default:
1167 d->target_bias_level = SND_SOC_BIAS_ON;
1168 break;
1169 }
1170 }
1152 1171
1153 if (w->power == power) 1172 if (w->power == power)
1154 continue; 1173 continue;