summaryrefslogtreecommitdiff
path: root/sound/soc/generic/simple-card.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2021-04-01 07:15:33 +0300
committerMark Brown <broonie@kernel.org>2021-04-08 17:18:03 +0300
commit205eb17eddb473c3159743c7d3aaf68db37b7231 (patch)
tree98a000c800d40582042585e72640bb178ec35a8b /sound/soc/generic/simple-card.c
parentf2138aed231c88d5c4fa8d06aa15ad19685087c2 (diff)
downloadlinux-205eb17eddb473c3159743c7d3aaf68db37b7231.tar.xz
ASoC: simple-card-utils: share dummy DAI and reduce memory
Current simple-card / audio-graph creates 1xCPU + 1xCodec + 1xPlatform for all dai_link, but some of them is not needed. For example Platform is not needed for DPCM BE case. Moreover, we can share snd-soc-dummy DAI for CPU-dummy / dummy-Codec in DPCM. This patch adds dummy DAI and share it when DPCM case, I beliave it can contribute to reduce memory. By this patch, CPU-dummy / dummy-CPU are set at asoc_simple_init_priv(), thus, its settings are no longer needed at DPCM detecting timing on simple-card / audio-graph. Moreover, we can remove triky Platform settings code for DPCM BE, because un-needed Platform is not created. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87tuoqod22.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/generic/simple-card.c')
-rw-r--r--sound/soc/generic/simple-card.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 1fad570338b3..9132c0ea05af 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -141,9 +141,6 @@ static int simple_dai_link_of_dpcm(struct asoc_simple_priv *priv,
int is_single_links = 0;
/* Codec is dummy */
- codecs->of_node = NULL;
- codecs->dai_name = "snd-soc-dummy-dai";
- codecs->name = "snd-soc-dummy";
/* FE settings */
dai_link->dynamic = 1;
@@ -167,13 +164,11 @@ static int simple_dai_link_of_dpcm(struct asoc_simple_priv *priv,
goto out_put_node;
asoc_simple_canonicalize_cpu(dai_link, is_single_links);
+ asoc_simple_canonicalize_platform(dai_link);
} else {
struct snd_soc_codec_conf *cconf;
/* CPU is dummy */
- cpus->of_node = NULL;
- cpus->dai_name = "snd-soc-dummy-dai";
- cpus->name = "snd-soc-dummy";
/* BE settings */
dai_link->no_pcm = 1;
@@ -211,8 +206,6 @@ static int simple_dai_link_of_dpcm(struct asoc_simple_priv *priv,
simple_parse_convert(dev, np, &dai_props->adata);
simple_parse_mclk_fs(top, np, codec, dai_props, prefix);
- asoc_simple_canonicalize_platform(dai_link);
-
ret = asoc_simple_parse_tdm(np, dai);
if (ret)
goto out_put_node;
@@ -530,15 +523,12 @@ static int simple_count_dpcm(struct asoc_simple_priv *priv,
if (li->cpu) {
li->num[li->link].cpus = 1;
- li->num[li->link].codecs = 1;
li->num[li->link].platforms = 1;
li->link++; /* CPU-dummy */
li->dais++;
} else {
- li->num[li->link].cpus = 1;
li->num[li->link].codecs = 1;
- li->num[li->link].platforms = 1;
li->link++; /* dummy-Codec */
li->dais++;