summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorXiang Xiao <xiaoxiang@xiaomi.com>2014-03-02 00:04:03 +0800
committerMark Brown <broonie@linaro.org>2014-03-03 12:47:40 +0800
commit17282ba4310cdad05f172d4dc1ebcb63d0b5de98 (patch)
tree8d9c913148a3f28fd09630f10d60d4692f4675c2 /sound/soc/soc-dapm.c
parent57996358f4d679b2bc39d4cd15166bb89fc8d981 (diff)
downloadlinux-stable-17282ba4310cdad05f172d4dc1ebcb63d0b5de98.tar.gz
linux-stable-17282ba4310cdad05f172d4dc1ebcb63d0b5de98.tar.bz2
linux-stable-17282ba4310cdad05f172d4dc1ebcb63d0b5de98.zip
ASoC: dapm: Reorder the bias update sequence
The new sequence ensure that dapm_pre_sequence_async work on the card before all codecs and dapm_post_sequence_async work on the card after all codecs. So the machine driver could utilize the determinate sequence to do the gloabl setup and teardown in the right place. Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c37
1 files changed, 26 insertions, 11 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index d856e7c4c631..77743e51420a 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1898,10 +1898,14 @@ static int dapm_power_widgets(struct snd_soc_card *card, int event)
trace_snd_soc_dapm_walk_done(card);
- /* Run all the bias changes in parallel */
- list_for_each_entry(d, &card->dapm_list, list)
- async_schedule_domain(dapm_pre_sequence_async, d,
- &async_domain);
+ /* Run card bias changes at first */
+ 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)
+ async_schedule_domain(dapm_pre_sequence_async, d,
+ &async_domain);
+ }
async_synchronize_full_domain(&async_domain);
list_for_each_entry(w, &down_list, power_list) {
@@ -1921,10 +1925,14 @@ static int dapm_power_widgets(struct snd_soc_card *card, int event)
dapm_seq_run(card, &up_list, event, true);
/* Run all the bias changes in parallel */
- list_for_each_entry(d, &card->dapm_list, list)
- async_schedule_domain(dapm_post_sequence_async, d,
- &async_domain);
+ list_for_each_entry(d, &card->dapm_list, list) {
+ if (d != &card->dapm)
+ async_schedule_domain(dapm_post_sequence_async, d,
+ &async_domain);
+ }
async_synchronize_full_domain(&async_domain);
+ /* Run card bias changes at last */
+ dapm_post_sequence_async(&card->dapm, 0);
/* do we need to notify any clients that DAPM event is complete */
list_for_each_entry(d, &card->dapm_list, list) {
@@ -4159,11 +4167,18 @@ void snd_soc_dapm_shutdown(struct snd_soc_card *card)
struct snd_soc_dapm_context *dapm;
list_for_each_entry(dapm, &card->dapm_list, list) {
- soc_dapm_shutdown_dapm(dapm);
- if (dapm->bias_level == SND_SOC_BIAS_STANDBY)
- snd_soc_dapm_set_bias_level(dapm,
- SND_SOC_BIAS_OFF);
+ if (dapm != &card->dapm) {
+ soc_dapm_shutdown_dapm(dapm);
+ if (dapm->bias_level == SND_SOC_BIAS_STANDBY)
+ snd_soc_dapm_set_bias_level(dapm,
+ SND_SOC_BIAS_OFF);
+ }
}
+
+ soc_dapm_shutdown_dapm(&card->dapm);
+ if (card->dapm.bias_level == SND_SOC_BIAS_STANDBY)
+ snd_soc_dapm_set_bias_level(&card->dapm,
+ SND_SOC_BIAS_OFF);
}
/* Module information */