ASoC: Intel: add get_codec_dai_by_name helper function
authorBard Liao <yung-chuan.liao@linux.intel.com>
Thu, 8 Feb 2024 16:55:31 +0000 (10:55 -0600)
committerMark Brown <broonie@kernel.org>
Thu, 8 Feb 2024 21:23:09 +0000 (21:23 +0000)
commit4ca5ba58f15ae5a9ad1fa7a5f0d0e50b03b36614
treef3e1c3f4b8a8a7525c766202aea0a64fa7f0c41f
parent9f3763b3628def09440f1f0405cc127104c31634
ASoC: Intel: add get_codec_dai_by_name helper function

Currently, we assume the codecs in a dai link are all the same.
So that we get codec dai with snd_soc_rtd_to_codec(rtd, 0) in dai_links
->init callback. However, a link can include different codecs.
For example, a 4 speakers link can consist of rt712 and rt1316.
Therefore, we need to select the codec dai by name in the dai link.

Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20240208165545.93811-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/sof_board_helpers.c
sound/soc/intel/boards/sof_board_helpers.h