Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] ASoC: omap-abe-twl6040: No need to register DMIC routes seperatly
@ 2014-03-08 18:16 Lars-Peter Clausen
  2014-03-08 18:16 ` [PATCH 2/3] ASoC: rx51: Convert to table based control and DAPM setup Lars-Peter Clausen
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Lars-Peter Clausen @ 2014-03-08 18:16 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: Peter Ujfalusi, alsa-devel, Lars-Peter Clausen, Grazvydas Ignotas,
	Jarkko Nikula

When using table based DAPM setup there is no need to register DAPM elements for
different sub-components separately. The widgets will be registered before the
first sub-component is initialized, the routes are only added after the last
sub-component has been initialized, meaning everything will be available when it
is needed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/omap/omap-abe-twl6040.c | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c
index ebb1390..5011bfa 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -163,6 +163,10 @@ static const struct snd_soc_dapm_route audio_map[] = {
 
 	{"AFML", NULL, "Line In"},
 	{"AFMR", NULL, "Line In"},
+
+	/* DMIC routing */
+	{"DMic", NULL, "Digital Mic"},
+	{"Digital Mic", NULL, "Digital Mic1 Bias"},
 };
 
 static int omap_abe_twl6040_init(struct snd_soc_pcm_runtime *rtd)
@@ -196,20 +200,6 @@ static int omap_abe_twl6040_init(struct snd_soc_pcm_runtime *rtd)
 	return ret;
 }
 
-static const struct snd_soc_dapm_route dmic_audio_map[] = {
-	{"DMic", NULL, "Digital Mic"},
-	{"Digital Mic", NULL, "Digital Mic1 Bias"},
-};
-
-static int omap_abe_dmic_init(struct snd_soc_pcm_runtime *rtd)
-{
-	struct snd_soc_codec *codec = rtd->codec;
-	struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-	return snd_soc_dapm_add_routes(dapm, dmic_audio_map,
-				ARRAY_SIZE(dmic_audio_map));
-}
-
 /* Digital audio interface glue - connects codec <--> CPU */
 static struct snd_soc_dai_link abe_twl6040_dai_links[] = {
 	{
@@ -229,7 +219,6 @@ static struct snd_soc_dai_link abe_twl6040_dai_links[] = {
 		.codec_dai_name = "dmic-hifi",
 		.platform_name = "omap-pcm-audio",
 		.codec_name = "dmic-codec",
-		.init = omap_abe_dmic_init,
 		.ops = &omap_abe_dmic_ops,
 	},
 };
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-03-10 12:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-08 18:16 [PATCH 1/3] ASoC: omap-abe-twl6040: No need to register DMIC routes seperatly Lars-Peter Clausen
2014-03-08 18:16 ` [PATCH 2/3] ASoC: rx51: Convert to table based control and DAPM setup Lars-Peter Clausen
2014-03-08 18:16 ` [PATCH 3/3] ASoC: omap3pandora: Convert to table based " Lars-Peter Clausen
2014-03-10  8:13 ` [PATCH 1/3] ASoC: omap-abe-twl6040: No need to register DMIC routes seperatly Peter Ujfalusi
2014-03-10  8:18   ` Lars-Peter Clausen
2014-03-10  9:12     ` Mark Brown
2014-03-10  9:24       ` Lars-Peter Clausen
2014-03-10 10:10         ` Mark Brown
2014-03-10 10:27           ` Lars-Peter Clausen
2014-03-10 11:05             ` Mark Brown
2014-03-10 11:29               ` Lars-Peter Clausen
2014-03-10 12:09                 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox