diff options
author | Bard Liao <yung-chuan.liao@linux.intel.com> | 2024-05-09 19:34:15 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-05-10 09:11:48 +0300 |
commit | 70d470f05f0b5bb8dea67915cac6ed6308120a89 (patch) | |
tree | 2c5e487a620f8f1891e6a91f73cf68fe17bccf2e /sound/soc/intel/boards/sof_sdw_common.h | |
parent | 01c266af92f4d24d44939e7d21c36e898caaa18f (diff) | |
download | linux-70d470f05f0b5bb8dea67915cac6ed6308120a89.tar.xz |
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>
Diffstat (limited to 'sound/soc/intel/boards/sof_sdw_common.h')
-rw-r--r-- | sound/soc/intel/boards/sof_sdw_common.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/soc/intel/boards/sof_sdw_common.h b/sound/soc/intel/boards/sof_sdw_common.h index 94657dd210f5..a8ba39bd5fd8 100644 --- a/sound/soc/intel/boards/sof_sdw_common.h +++ b/sound/soc/intel/boards/sof_sdw_common.h @@ -86,6 +86,10 @@ struct sof_sdw_dai_info { const char *dai_name; const int dai_type; const int dailink[2]; /* dailink id for each direction */ + const struct snd_kcontrol_new *controls; + const int num_controls; + const struct snd_soc_dapm_widget *widgets; + const int num_widgets; int (*init)(struct snd_soc_card *card, struct snd_soc_dai_link *dai_links, struct sof_sdw_codec_info *info, |