ASoC: Intel: sof_sdw: add controls and dapm widgets in codec_info
authorBard Liao <yung-chuan.liao@linux.intel.com>
Thu, 9 May 2024 16:34:15 +0000 (11:34 -0500)
committerMark Brown <broonie@kernel.org>
Fri, 10 May 2024 06:11:48 +0000 (07:11 +0100)
commit70d470f05f0b5bb8dea67915cac6ed6308120a89
tree2c5e487a620f8f1891e6a91f73cf68fe17bccf2e
parent01c266af92f4d24d44939e7d21c36e898caaa18f
ASoC: Intel: sof_sdw: add controls and dapm widgets in codec_info

Currently, we add card controls and dapm widgets one by one in the
codec_info->dais->rtd_init callback. Duplicated controls and dapm
widgets will be added if there are more than one types of amps in the
dai link. Moving it to sof_sdw_rtd_init() and only add the
controls/widgets of the first codec dai can avoid the duplications.

Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.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/20240509163418.67746-16-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/sof_sdw.c
sound/soc/intel/boards/sof_sdw_common.h