summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorMark Brown2011-04-13 02:51:37 +0200
committerMark Brown2011-04-13 19:00:21 +0200
commit9a841ebb9cac3f1b7253bb01c304f89b1af25aba (patch)
tree78c58c3731c814f40af21a7e3dfa890d5429ed4e /sound/soc/soc-core.c
parentASoC: Move WM8915 FLL operations onto the CODEC (diff)
downloadkernel-qcow2-linux-9a841ebb9cac3f1b7253bb01c304f89b1af25aba.tar.gz
kernel-qcow2-linux-9a841ebb9cac3f1b7253bb01c304f89b1af25aba.tar.xz
kernel-qcow2-linux-9a841ebb9cac3f1b7253bb01c304f89b1af25aba.zip
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.c7
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)
INIT_WORK(&card->deferred_resume_work, soc_resume_deferred);
#endif
+ if (card->dapm_widgets)
+ snd_soc_dapm_new_controls(&card->dapm, card->dapm_widgets,
+ card->num_dapm_widgets);
+
/* initialise the sound card only once */
if (card->probe) {
ret = card->probe(card);
@@ -1911,9 +1915,6 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
card->controls,
card->num_controls);
- if (card->dapm_widgets)
- snd_soc_dapm_new_controls(&card->dapm, card->dapm_widgets,
- card->num_dapm_widgets);
if (card->dapm_routes)
snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes,
card->num_dapm_routes);