diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-04-12 20:51:37 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-04-13 13:00:21 -0400 |
commit | 9a841ebb9cac3f1b7253bb01c304f89b1af25aba (patch) | |
tree | 78c58c3731c814f40af21a7e3dfa890d5429ed4e /sound/soc/soc-core.c | |
parent | 01b07e2d84c887b432353ead846f4497a33b5f5d (diff) |
ASoC: Create card DAPM widgets early so they can be used in callbacks
This helps with things like setting up the initial state.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 1f114673e952..3b3a377d0874 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -1878,6 +1878,10 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) | |||
1878 | INIT_WORK(&card->deferred_resume_work, soc_resume_deferred); | 1878 | INIT_WORK(&card->deferred_resume_work, soc_resume_deferred); |
1879 | #endif | 1879 | #endif |
1880 | 1880 | ||
1881 | if (card->dapm_widgets) | ||
1882 | snd_soc_dapm_new_controls(&card->dapm, card->dapm_widgets, | ||
1883 | card->num_dapm_widgets); | ||
1884 | |||
1881 | /* initialise the sound card only once */ | 1885 | /* initialise the sound card only once */ |
1882 | if (card->probe) { | 1886 | if (card->probe) { |
1883 | ret = card->probe(card); | 1887 | ret = card->probe(card); |
@@ -1911,9 +1915,6 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) | |||
1911 | card->controls, | 1915 | card->controls, |
1912 | card->num_controls); | 1916 | card->num_controls); |
1913 | 1917 | ||
1914 | if (card->dapm_widgets) | ||
1915 | snd_soc_dapm_new_controls(&card->dapm, card->dapm_widgets, | ||
1916 | card->num_dapm_widgets); | ||
1917 | if (card->dapm_routes) | 1918 | if (card->dapm_routes) |
1918 | snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes, | 1919 | snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes, |
1919 | card->num_dapm_routes); | 1920 | card->num_dapm_routes); |