From: Mark Brown Date: Mon, 4 Apr 2011 12:05:11 +0000 (+0900) Subject: ASoC: Force all DAPM contexts into the same bias state X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=52ba67bf85889828b3766207fa43ce7159c84c78;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git ASoC: Force all DAPM contexts into the same bias state Currently we allow all DAPM contexts to determine their own bias level. While this should in general work in most situations and will deliver the lowest possible power it causes problems for our integration with the card bias level as we're calling the card bias level functions for each DAPM context even though they're card wide but don't say which CODEC we're calling them for. Mitigate against this by forcing everything to be in the same state. Signed-off-by: Mark Brown Acked-by: Liam Girdwood --- diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 567645c0308b..68879209b315 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -1101,6 +1101,15 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event) } } + /* Force all contexts in the card to the same bias state */ + power = 0; + list_for_each_entry(d, &card->dapm_list, list) + if (d->dev_power) + power = 1; + list_for_each_entry(d, &card->dapm_list, list) + d->dev_power = power; + + /* Run all the bias changes in parallel */ list_for_each_entry(d, &dapm->card->dapm_list, list) async_schedule_domain(dapm_pre_sequence_async, d,