Skip to contentSkip to conversation

ASoC: core: Only add platform DAI widgets once.

PATCH Applied Liam Girdwood 2 participants 11 messages Sep 13, 2013 – Sep 16, 2013

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

PATCH 1/1 ASoC: core: Only add platform DAI widgets once.

Currently platform CPU DAI widgets are created in soc_probe_platform and soc_probe_link_dais. Remove the extra call in soc_probe_link_dais().

---
 sound/soc/soc-core.c | 1 -
 1 file changed, 1 deletion(-)
sound/soc/soc-core.c +0 -1
index 8e86aba..09e341d 100644
@@ -1365,7 +1365,6 @@ static int soc_probe_link_dais(struct snd_soc_card *card, int num, int order)
 				return -ENODEV;
 
 			list_add(&cpu_dai->dapm.list, &card->dapm_list);
-			snd_soc_dapm_new_dai_widgets(&cpu_dai->dapm, cpu_dai);
 		}
 
 		if (cpu_dai->driver->probe) {
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 1/1 ASoC: trace: Make sure trace header doesnt depend on any headers

Fix build so that asoc trace event header doesn't depend on other headers.

---
 include/trace/events/asoc.h | 1 +
 1 file changed, 1 insertion(+)
include/trace/events/asoc.h +1 -0
index 5fc2dcd..03996b2 100644
@@ -14,6 +14,7 @@ struct snd_soc_codec;
 struct snd_soc_platform;
 struct snd_soc_card;
 struct snd_soc_dapm_widget;
+struct snd_soc_dapm_path;
 
 /*
  * Log register events
Signature · 1 line
1.8.1.2
maintainer Applied
#2 lore raw

Re: [PATCH] ASoC: trace: Make sure trace header doesnt depend on any headers

Quoted 1 line · Liam Girdwood

Fix build so that asoc trace event header doesn't depend on other headers.

Applied, thanks.

#3 lore raw

PATCH 1/1 ASoC: core utils: Dont set DMA params for BE substreams

In reply to Liam Girdwood

BE substreams dont require dummy DMA configs so dont set any.

---
 sound/soc/soc-utils.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
sound/soc/soc-utils.c +5 -1
index 29b211e..5e63365 100644
@@ -75,7 +75,11 @@ static const struct snd_pcm_hardware dummy_dma_hardware = {
 
 static int dummy_dma_open(struct snd_pcm_substream *substream)
 {
-	snd_soc_set_runtime_hwparams(substream, &dummy_dma_hardware);
+	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+
+	/* BE's dont need dummy params */
+	if (!rtd->dai_link->no_pcm)
+		snd_soc_set_runtime_hwparams(substream, &dummy_dma_hardware);
 
 	return 0;
 }
Signature · 1 line
1.8.1.2
maintainer Applied
#4 lore raw

Re: [PATCH] ASoC: core utils: Dont set DMA params for BE substreams

Quoted 1 line · Liam Girdwood

BE substreams dont require dummy DMA configs so dont set any.

Applied, thanks.

#5 lore raw

PATCH 1/1 ASoC: core: Add API for configuration of DAI FS

In reply to Liam Girdwood

Some codec drivers when running in slave mode require that FS is explicitly set by the machine driver as it may not be exactly BCLK/rate.

Extend the DAI API by adding :-

int snd_soc_dai_set_fs(struct snd_soc_dai *dai, unsigned int fs);

---
 include/sound/soc-dai.h |  3 +++
 sound/soc/soc-core.c    | 16 ++++++++++++++++
 2 files changed, 19 insertions(+)
include/sound/soc-dai.h +3 -0
index ae9a227..06d2ce5 100644
@@ -105,6 +105,8 @@ int snd_soc_dai_set_clkdiv(struct snd_soc_dai *dai,
 int snd_soc_dai_set_pll(struct snd_soc_dai *dai,
 	int pll_id, int source, unsigned int freq_in, unsigned int freq_out);
 
+int snd_soc_dai_set_dfs(struct snd_soc_dai *dai, unsigned int fs);
+
 /* Digital Audio interface formatting */
 int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt);
 
@@ -131,6 +133,7 @@ struct snd_soc_dai_ops {
 	int (*set_pll)(struct snd_soc_dai *dai, int pll_id, int source,
 		unsigned int freq_in, unsigned int freq_out);
 	int (*set_clkdiv)(struct snd_soc_dai *dai, int div_id, int div);
+	int (*set_dfs)(struct snd_soc_dai *dai, unsigned int fs);
 
 	/*
 	 * DAI format configuration
sound/soc/soc-core.c +16 -0
index 09e341d..90b86cc 100644
@@ -3380,6 +3380,22 @@ int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source,
 EXPORT_SYMBOL_GPL(snd_soc_codec_set_pll);
 
 /**
+ * snd_soc_dai_set_dfs - configure DAI FS.
+ * @dai: DAI
+ * @fs Ration of BCLK to Sample rate
+ *
+ * Configures the DAI for a preset FS.
+ */
+int snd_soc_dai_set_dfs(struct snd_soc_dai *dai, unsigned int fs)
+{
+	if (dai->driver && dai->driver->ops->set_dfs)
+		return dai->driver->ops->set_dfs(dai, fs);
+	else
+		return -EINVAL;
+}
+EXPORT_SYMBOL_GPL(snd_soc_dai_set_dfs);
+
+/**
  * snd_soc_dai_set_fmt - configure DAI hardware audio format.
  * @dai: DAI
  * @fmt: SND_SOC_DAIFMT_ format value.
Signature · 1 line
1.8.1.2
maintainer
#6 lore raw

Re: [PATCH] ASoC: core: Add API for configuration of DAI FS

Quoted 6 lines · Liam Girdwood

Some codec drivers when running in slave mode require that FS is explicitly set by the machine driver as it may not be exactly BCLK/rate.

Extend the DAI API by adding :-

int snd_soc_dai_set_fs(struct snd_soc_dai *dai, unsigned int fs);

I'm struggling to think of a better name for this right now but the _fs name is making me think of the MCLK/SYSCLK rate rather than the BCLK rate - lots of clocks get specified as a multiple of the sample rate so it's not jumping out which clock. The best I can come up with is _bclk_fs() but perhaps there are better ideas? Or should we pass in a clock ID (and provide standard defines for things like BCLK) so it can apply to any clock?

Though looking at your ACPI ID patch perhaps pwgen can give us some good ideas :)

#7 lore raw

Re: [PATCH] ASoC: core: Add API for configuration of DAI FS

Quoted 8 lines · Mark Brown
Quoted 6 lines · Liam Girdwood

Some codec drivers when running in slave mode require that FS is explicitly set by the machine driver as it may not be exactly BCLK/rate.

Extend the DAI API by adding :-

int snd_soc_dai_set_fs(struct snd_soc_dai *dai, unsigned int fs);

Quoted 8 lines

I'm struggling to think of a better name for this right now but the _fs name is making me think of the MCLK/SYSCLK rate rather than the BCLK rate - lots of clocks get specified as a multiple of the sample rate so it's not jumping out which clock. The best I can come up with is _bclk_fs() but perhaps there are better ideas? Or should we pass in a clock ID (and provide standard defines for things like BCLK) so it can apply to any clock?

My initial thought was for set_fs(), but this collides with a global FS macro :(

I'll change the naming so it's set_bclk() and the params to keep it in line with snd_soc_dai_set_sysclk().

Liam

maintainer
#8 lore raw

Re: [PATCH] ASoC: core: Add API for configuration of DAI FS

Quoted 2 lines · Liam Girdwood

I'll change the naming so it's set_bclk() and the params to keep it in line with snd_soc_dai_set_sysclk().

bclk_ratio()? Otherwise I bet people will just pass the absolute BCLK rate in (though perhaps that's actually easier for them...). We could also just create a standard define for set_sysclk() if we were going to do a straight rate.

#9 lore raw

Re: [PATCH] ASoC: core: Add API for configuration of DAI FS

Quoted 6 lines · Mark Brown
Quoted 2 lines · Liam Girdwood

I'll change the naming so it's set_bclk() and the params to keep it in line with snd_soc_dai_set_sysclk().

bclk_ratio()?

ok, that sounds best :)

Liam

maintainer Applied
#10 lore raw
In reply to Liam Girdwood
Quoted 2 lines · Liam Girdwood

Currently platform CPU DAI widgets are created in soc_probe_platform and soc_probe_link_dais. Remove the extra call in soc_probe_link_dais().

Applied, thanks.