Skip to contentSkip to conversation

ASoC: multi-comp: soc-core: Fix for machine given DAPM widgets

PATCH Applied Peter Ujfalusi 3 participants 3 messages Aug 5, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: multi-comp: soc-core: Fix for machine given DAPM widgets

Move the DAPM initialization after the machine driver has finished it's init (dai_link driver).
Since in machine init we can add DAPM widgets we need to take them into account as well.

---

Hello Liam, Mark!

With this patch the machine driver given DAPM routing will be functional with the multi-comp.
This patch also removes the need to call the snd_soc_dapm_sync from machine driver's init call, since it will be done by the core.

Please squash this patch to the core changes.

Thanks,
Peter

 sound/soc/soc-core.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
sound/soc/soc-core.c +4 -3
index a7c9a48..8afa271 100644
@@ -1324,9 +1324,6 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num)
 				return ret;
 			}
 		}
-		/* Make sure all DAPM widgets are instantiated */
-		snd_soc_dapm_new_widgets(codec);
-
 		/* mark codec as probed and add to card codec list */
 		codec->probed = 1;
 		list_add(&codec->card_list, &card->codec_dev_list);
@@ -1375,6 +1372,10 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num)
 		}
 	}
 
+	/* Make sure all DAPM widgets are instantiated */
+	snd_soc_dapm_new_widgets(codec);
+	snd_soc_dapm_sync(codec);
+
 	/* register the rtd device */
 	rtd->dev.init_name = rtd->dai_link->stream_name;
 	rtd->dev.release = rtd_release;
Signature · 1 line
1.7.2
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Peter Ujfalusi

Move the DAPM initialization after the machine driver has finished it's init (dai_link driver).
Since in machine init we can add DAPM widgets we need to take them into account as well.

but...

sound/soc/soc-core.c static int soc_probe_dai_link(struct snd_soc_card *card, int num) · line 1381

Quoted 11 lines
sound/soc/soc-core.c +4 -0
@@ -1375,6 +1372,10 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num)
 		}
 	}
 
+	/* Make sure all DAPM widgets are instantiated */
+	snd_soc_dapm_new_widgets(codec);
+	snd_soc_dapm_sync(codec);
+
 	/* register the rtd device */
 	rtd->dev.init_name = rtd->dai_link->stream_name;
 	rtd->dev.release = rtd_release;

...it'd be better to find a home for this that was per card rather than per link I guess, that way we only need to iterate through once during instantiation. A bit irrelevant though given that it's hardly a hot path.

#2 lore raw
Quoted 10 lines · Mark Brown
Quoted 6 lines · Peter Ujfalusi

Move the DAPM initialization after the machine driver has finished it's init (dai_link driver).
Since in machine init we can add DAPM widgets we need to take them into account as well.

Applied.

Quoted 6 lines

but...

Quoted 4 lines
(quoted diff) +0 -0
@@ -1375,6 +1372,10 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num)
 		}
 	}
 
Quoted 12 lines

sound/soc/soc-core.c static int soc_probe_dai_link(struct snd_soc_card *card, int num) · line 1381

Quoted 7 lines
sound/soc/soc-core.c +4 -0
+	/* Make sure all DAPM widgets are instantiated */
+	snd_soc_dapm_new_widgets(codec);
+	snd_soc_dapm_sync(codec);
+
 	/* register the rtd device */
 	rtd->dev.init_name = rtd->dai_link->stream_name;
 	rtd->dev.release = rtd_release;

...it'd be better to find a home for this that was per card rather than per link I guess, that way we only need to iterate through once during instantiation. A bit irrelevant though given that it's hardly a hot path.

Agreed, lets tackle that as an incremental patch after the merge.

Thanks

Liam

Signature · 3 lines
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk