diff options
author | Xiang Xiao <xiaoxiang@xiaomi.com> | 2014-03-01 11:04:03 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-03-02 23:47:40 -0500 |
commit | 17282ba4310cdad05f172d4dc1ebcb63d0b5de98 (patch) | |
tree | 8d9c913148a3f28fd09630f10d60d4692f4675c2 /sound/soc/soc-dapm.c | |
parent | 57996358f4d679b2bc39d4cd15166bb89fc8d981 (diff) |
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.c | 37 |
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) | |||
1898 | 1898 | ||
1899 | trace_snd_soc_dapm_walk_done(card); | 1899 | trace_snd_soc_dapm_walk_done(card); |
1900 | 1900 | ||
1901 | /* Run all the bias changes in parallel */ | 1901 | /* Run card bias changes at first */ |
1902 | list_for_each_entry(d, &card->dapm_list, list) | 1902 | dapm_pre_sequence_async(&card->dapm, 0); |
1903 | async_schedule_domain(dapm_pre_sequence_async, d, | 1903 | /* Run other bias changes in parallel */ |
1904 | &async_domain); | 1904 | list_for_each_entry(d, &card->dapm_list, list) { |
1905 | if (d != &card->dapm) | ||
1906 | async_schedule_domain(dapm_pre_sequence_async, d, | ||
1907 | &async_domain); | ||
1908 | } | ||
1905 | async_synchronize_full_domain(&async_domain); | 1909 | async_synchronize_full_domain(&async_domain); |
1906 | 1910 | ||
1907 | list_for_each_entry(w, &down_list, power_list) { | 1911 | 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) | |||
1921 | dapm_seq_run(card, &up_list, event, true); | 1925 | dapm_seq_run(card, &up_list, event, true); |
1922 | 1926 | ||
1923 | /* Run all the bias changes in parallel */ | 1927 | /* Run all the bias changes in parallel */ |
1924 | list_for_each_entry(d, &card->dapm_list, list) | 1928 | list_for_each_entry(d, &card->dapm_list, list) { |
1925 | async_schedule_domain(dapm_post_sequence_async, d, | 1929 | if (d != &card->dapm) |
1926 | &async_domain); | 1930 | async_schedule_domain(dapm_post_sequence_async, d, |
1931 | &async_domain); | ||
1932 | } | ||
1927 | async_synchronize_full_domain(&async_domain); | 1933 | async_synchronize_full_domain(&async_domain); |
1934 | /* Run card bias changes at last */ | ||
1935 | dapm_post_sequence_async(&card->dapm, 0); | ||
1928 | 1936 | ||
1929 | /* do we need to notify any clients that DAPM event is complete */ | 1937 | /* do we need to notify any clients that DAPM event is complete */ |
1930 | list_for_each_entry(d, &card->dapm_list, list) { | 1938 | list_for_each_entry(d, &card->dapm_list, list) { |
@@ -4159,11 +4167,18 @@ void snd_soc_dapm_shutdown(struct snd_soc_card *card) | |||
4159 | struct snd_soc_dapm_context *dapm; | 4167 | struct snd_soc_dapm_context *dapm; |
4160 | 4168 | ||
4161 | list_for_each_entry(dapm, &card->dapm_list, list) { | 4169 | list_for_each_entry(dapm, &card->dapm_list, list) { |
4162 | soc_dapm_shutdown_dapm(dapm); | 4170 | if (dapm != &card->dapm) { |
4163 | if (dapm->bias_level == SND_SOC_BIAS_STANDBY) | 4171 | soc_dapm_shutdown_dapm(dapm); |
4164 | snd_soc_dapm_set_bias_level(dapm, | 4172 | if (dapm->bias_level == SND_SOC_BIAS_STANDBY) |
4165 | SND_SOC_BIAS_OFF); | 4173 | snd_soc_dapm_set_bias_level(dapm, |
4174 | SND_SOC_BIAS_OFF); | ||
4175 | } | ||
4166 | } | 4176 | } |
4177 | |||
4178 | soc_dapm_shutdown_dapm(&card->dapm); | ||
4179 | if (card->dapm.bias_level == SND_SOC_BIAS_STANDBY) | ||
4180 | snd_soc_dapm_set_bias_level(&card->dapm, | ||
4181 | SND_SOC_BIAS_OFF); | ||
4167 | } | 4182 | } |
4168 | 4183 | ||
4169 | /* Module information */ | 4184 | /* Module information */ |