ASoC: makes CPU/Codec channel connection map more generic
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 13 Nov 2023 01:28:27 +0000 (01:28 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 27 Nov 2023 13:44:00 +0000 (13:44 +0000)
commit45cc50d13433a62f23b7b4af380497aae5e8ddc7
tree848a28bbfd7fe8ef6e1a81f2eca35f62914b90c3
parent74fc96e8d4b3a4f3ceb8d14c99f3e0ef70a0c381
ASoC: makes CPU/Codec channel connection map more generic

Current ASoC CPU:Codec = N:M connection is using connection mapping idea,
but it is used for N < M case only. We want to use it for any case.

By this patch, not only N:M connection, but all existing connection
(1:1, 1:N, N:N) will use same connection mapping. Then, because it will
use default mapping, no conversion patch is needed to exising drivers.

More over, CPU:Codec = N:M (N > M) also supported in the same time.

ch_maps array will has CPU/Codec index by this patch.

Image
CPU0 <---> Codec0
CPU1 <-+-> Codec1
CPU2 <-/

ch_map
ch_map[0].cpu = 0 ch_map[0].codec = 0
ch_map[1].cpu = 1 ch_map[1].codec = 1
ch_map[2].cpu = 2 ch_map[2].codec = 1

Link: https://lore.kernel.org/r/87fs6wuszr.wl-kuninori.morimoto.gx@renesas.com
Link: https://lore.kernel.org/r/878r7yqeo4.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tested-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/87ttpq4f2c.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc.h
sound/soc/intel/boards/sof_sdw.c
sound/soc/soc-core.c
sound/soc/soc-dapm.c
sound/soc/soc-pcm.c