OSDN Git Service

ASoC: simple-card-utils: share dummy DAI and reduce memory
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 1 Apr 2021 04:15:33 +0000 (13:15 +0900)
committerMark Brown <broonie@kernel.org>
Thu, 8 Apr 2021 14:18:03 +0000 (15:18 +0100)
commit205eb17eddb473c3159743c7d3aaf68db37b7231
tree98a000c800d40582042585e72640bb178ec35a8b
parentf2138aed231c88d5c4fa8d06aa15ad19685087c2
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>
include/sound/simple_card_utils.h
sound/soc/generic/audio-graph-card.c
sound/soc/generic/simple-card-utils.c
sound/soc/generic/simple-card.c