[alsa-devel] [PATCH] 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().
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- sound/soc/soc-core.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 8e86aba..09e341d 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -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) {
Fix build so that asoc trace event header doesn't depend on other headers.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- include/trace/events/asoc.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/include/trace/events/asoc.h b/include/trace/events/asoc.h index 5fc2dcd..03996b2 100644 --- a/include/trace/events/asoc.h +++ b/include/trace/events/asoc.h @@ -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
BE substreams dont require dummy DMA configs so dont set any.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- sound/soc/soc-utils.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/sound/soc/soc-utils.c b/sound/soc/soc-utils.c index 29b211e..5e63365 100644 --- a/sound/soc/soc-utils.c +++ b/sound/soc/soc-utils.c @@ -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; }
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);
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- include/sound/soc-dai.h | 3 +++ sound/soc/soc-core.c | 16 ++++++++++++++++ 2 files changed, 19 insertions(+)
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index ae9a227..06d2ce5 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -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 diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 09e341d..90b86cc 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -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.
On Fri, Sep 13, 2013 at 06:09:48PM +0100, Liam Girdwood wrote:
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 :)
On Fri, 2013-09-13 at 18:26 +0100, Mark Brown wrote:
On Fri, Sep 13, 2013 at 06:09:48PM +0100, Liam Girdwood wrote:
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?
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
On Mon, Sep 16, 2013 at 11:28:29AM +0100, Liam Girdwood wrote:
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.
On Mon, 2013-09-16 at 12:05 +0100, Mark Brown wrote:
On Mon, Sep 16, 2013 at 11:28:29AM +0100, Liam Girdwood wrote:
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
On Fri, Sep 13, 2013 at 06:09:45PM +0100, Liam Girdwood wrote:
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.
participants (2)
-
Liam Girdwood
-
Mark Brown