Skip to contentSkip to conversation

ASoC: utils: Add internal call to determine if DAI is dummy.

PATCH Applied Liam Girdwood 3 participants 5 messages Jan 8, 2014

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

PATCH 1/2 ASoC: utils: Add internal call to determine if DAI is dummy.

Provide a quick way to tell if a DAI is a dummy DAI or a regular DAI. This is for internal DAPM usage only and is used to determe whether to insert a DAI link connection into the DAPM graph.

---
 include/sound/soc-dai.h | 2 ++
 sound/soc/soc-utils.c   | 7 +++++++
 2 files changed, 9 insertions(+)
include/sound/soc-dai.h +2 -0
index 243d3b6..71f27c4 100644
@@ -123,6 +123,8 @@ int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate);
 int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute,
 			     int direction);
 
+int snd_soc_dai_is_dummy(struct snd_soc_dai *dai);
+
 struct snd_soc_dai_ops {
 	/*
 	 * DAI clocking configuration, all optional.
sound/soc/soc-utils.c +7 -0
index 6ebdfd9..7f22ca3 100644
@@ -119,6 +119,13 @@ static struct snd_soc_dai_driver dummy_dai = {
 	 },
 };
 
+int snd_soc_dai_is_dummy(struct snd_soc_dai *dai)
+{
+	if (dai->driver == &dummy_dai)
+		return 1;
+	return 0;
+}
+
 static int snd_soc_dummy_probe(struct platform_device *pdev)
 {
 	int ret;
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 2/2 ASoC: DAPM: Automatically connect DAI link widgets in DAPM graph.

Connect the DAPM graph through each BE DAI link to the componnent(s) on the other side of the BE DAI link. This allows the graph to be walked on both sides of the link when graph changes are made.

---
 include/sound/soc-dapm.h |  1 +
 sound/soc/soc-core.c     |  1 +
 sound/soc/soc-dapm.c     | 49 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 51 insertions(+)
include/sound/soc-dapm.h +1 -0
index 2037c45..a5de124 100644
@@ -411,6 +411,7 @@ int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm,
 int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
 				 struct snd_soc_dai *dai);
 int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card);
+void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card);
 int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
 			 const struct snd_soc_pcm_stream *params,
 			 struct snd_soc_dapm_widget *source,
sound/soc/soc-core.c +1 -0
index 03c779e..a391665 100644
@@ -1728,6 +1728,7 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
 	}
 
 	snd_soc_dapm_link_dai_widgets(card);
+	snd_soc_dapm_connect_dai_link_widgets(card);
 
 	if (card->controls)
 		snd_soc_add_card_controls(card, card->controls, card->num_controls);
sound/soc/soc-dapm.c +49 -0

55 lines not on this page · raw message

Signature · 1 line
1.8.3.2
#2 lore raw
In reply to Liam Girdwood

At Wed, 8 Jan 2014 10:40:18 +0000,

Quoted 3 lines · Liam Girdwood

Provide a quick way to tell if a DAI is a dummy DAI or a regular DAI. This is for internal DAPM usage only and is used to determe whether to

determine?

Quoted 13 lines

insert a DAI link connection into the DAPM graph.

---
 include/sound/soc-dai.h | 2 ++
 sound/soc/soc-utils.c   | 7 +++++++
 2 files changed, 9 insertions(+)
include/sound/soc-dai.h +0 -0
index 243d3b6..71f27c4 100644

include/sound/soc-dai.h int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); · line 126

Quoted 4 lines
include/sound/soc-dai.h +1 -0
@@ -123,6 +123,8 @@ int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate);
 int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute,
 			     int direction);
 
+int snd_soc_dai_is_dummy(struct snd_soc_dai *dai);

Better to use bool.

Quoted 9 lines
include/sound/soc-dai.h +1 -0
+
 struct snd_soc_dai_ops {
 	/*
 	 * DAI clocking configuration, all optional.
sound/soc/soc-utils.c +0 -0
index 6ebdfd9..7f22ca3 100644

sound/soc/soc-utils.c static struct snd_soc_dai_driver dummy_dai = { · line 127

Quoted 9 lines
sound/soc/soc-utils.c +6 -0
@@ -119,6 +119,13 @@ static struct snd_soc_dai_driver dummy_dai = {
 	 },
 };
 
+int snd_soc_dai_is_dummy(struct snd_soc_dai *dai)
+{
+	if (dai->driver == &dummy_dai)
+		return 1;
+	return 0;
+}

No need for EXPORT_SYMBOL since it's for internal use only, or just forgotten?

Takashi

Quoted 12 lines
sound/soc/soc-utils.c +1 -0
+
 static int snd_soc_dummy_probe(struct platform_device *pdev)
 {
 	int ret;
Signature · 6 lines
1.8.3.2

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
#3 lore raw
Quoted 14 lines · Takashi Iwai

At Wed, 8 Jan 2014 10:40:18 +0000,

Quoted 12 lines · Liam Girdwood
include/sound/soc-dai.h +1 -0
+
 struct snd_soc_dai_ops {
 	/*
 	 * DAI clocking configuration, all optional.
sound/soc/soc-utils.c +0 -0
index 6ebdfd9..7f22ca3 100644
@@ -119,6 +119,13 @@ static struct snd_soc_dai_driver dummy_dai = {
 	 },
 };
 
Quoted 9 lines

sound/soc/soc-utils.c static struct snd_soc_dai_driver dummy_dai = { · line 127

Quoted 6 lines
sound/soc/soc-utils.c +6 -0
+int snd_soc_dai_is_dummy(struct snd_soc_dai *dai)
+{
+	if (dai->driver == &dummy_dai)
+		return 1;
+	return 0;
+}

No need for EXPORT_SYMBOL since it's for internal use only, or just forgotten?

No need for the EXPORT_SYMBOL as the core soc-*.c files are linked into the same module and it's for internal use only.

Liam

maintainer Applied
#4 lore raw
In reply to Liam Girdwood
Quoted 3 lines · Liam Girdwood

Provide a quick way to tell if a DAI is a dummy DAI or a regular DAI. This is for internal DAPM usage only and is used to determe whether to insert a DAI link connection into the DAPM graph.

Applied both, thanks (with the spelling fixed).