Skip to contentSkip to conversation

ASoC: Create card DAPM widgets early so they can be used in callbacks

PATCH In review Mark Brown 2 participants 2 messages Apr 13, 2011

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 ASoC: Create card DAPM widgets early so they can be used in callbacks

This helps with things like setting up the initial state.

---
 sound/soc/soc-core.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
sound/soc/soc-core.c +4 -3
index f75f139..ef0689b 100644
@@ -1868,6 +1868,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);
@@ -1901,9 +1905,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);
Signature · 1 line
1.7.4.1