From ab70671974379b398ec2ec182f4786b17d9d9384 Mon Sep 17 00:00:00 2001 From: Banajit Goswami Date: Fri, 10 Apr 2015 18:19:16 -0700 Subject: [PATCH] ASoC: dapm: Do not process cpu_dai widgets in bias changes Kernel 3.10 has cpu dai widgets in the list of card widgets in addition to platform and codec widgets. This is causing a delay in device switch because cpu dai widgets increase the number of widgets to be processed for bias changes by a factor of five, however they are not required to be processed. Skip processing of cpu dai widgets to keep the device switch latency at same level as in kernel 3.4. CRs-fixed: 699168 Change-Id: I2d7d9e34dabf2cd25ec5fdd3e58be0fc657c0f6c Signed-off-by: Damir Didjusto Signed-off-by: Banajit Goswami --- sound/soc/soc-dapm.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 58bca9a96b61..5c73bc21d41c 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -1783,6 +1783,8 @@ static int dapm_power_widgets(struct snd_soc_card *card, int event) LIST_HEAD(down_list); ASYNC_DOMAIN_EXCLUSIVE(async_domain); enum snd_soc_bias_level bias; + struct snd_soc_platform *p; + struct snd_soc_codec *c; lockdep_assert_held(&card->dapm_mutex); @@ -1865,7 +1867,9 @@ static int dapm_power_widgets(struct snd_soc_card *card, int event) dapm_pre_sequence_async(&card->dapm, 0); /* Run other bias changes in parallel */ list_for_each_entry(d, &card->dapm_list, list) { - if (d != &card->dapm) + p = snd_soc_dapm_to_platform(d); + c = snd_soc_dapm_to_codec(d); + if ((d != &card->dapm) && (c || p)) async_schedule_domain(dapm_pre_sequence_async, d, &async_domain); } @@ -1889,7 +1893,9 @@ static int dapm_power_widgets(struct snd_soc_card *card, int event) /* Run all the bias changes in parallel */ list_for_each_entry(d, &card->dapm_list, list) { - if (d != &card->dapm) + p = snd_soc_dapm_to_platform(d); + c = snd_soc_dapm_to_codec(d); + if ((d != &card->dapm) && (c || p)) async_schedule_domain(dapm_post_sequence_async, d, &async_domain); }