ASoC: intel: sof_sdw: Add simple DAI link creation helper
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Fri, 15 Sep 2023 07:56:09 +0000 (15:56 +0800)
committerMark Brown <broonie@kernel.org>
Fri, 15 Sep 2023 12:27:25 +0000 (13:27 +0100)
commitb359760d95eecaabd081c1c2cd58e0a15fe5a68c
tree77e834b6699e91b457f37a14778528b7888c92fe
parentfc46ecf34782c0d3ec8224ce6003a2631f8a93f1
ASoC: intel: sof_sdw: Add simple DAI link creation helper

The code contains a fair amount of state tracking and one part of that
is keeping track of which entry in the large global cpus
snd_soc_dai_link_component array is currently in use. Add a helper
function to allocate a simple DAI link, this simplifies the
code slightly and moves us in the direction of eliminating the need for
the large global cpus array. This does slightly increase the number of
allocations done, but this is probe time and the code already does a
large number of allocations so this increase is small over all.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230915075611.1619548-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/sof_sdw.c