Skip to content

Commit f792733

Browse files
bardliaobroonie
authored andcommitted
ASoC: sdw_utils: add component_name string to dai_info
Currently the sdw machine driver uses different way to get the component name from the DAI name for different codecs in the rtd_init callback. It means that we need to rely on the rtd_init callback to get the component name. Add an optional component string to the asoc_sdw_dai_info struct allows the machine driver to get the component name directly. The commit adds the component names for the AMP dais for the preparation to set card->components string for combined speaker configs. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Shuming Fan <shumingf@realtek.com> Link: https://patch.msgid.link/20250625140430.311865-2-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 86731a2 commit f792733

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

include/sound/soc_sdw_utils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ struct asoc_sdw_codec_info;
4646
struct asoc_sdw_dai_info {
4747
const bool direction[2]; /* playback & capture support */
4848
const char *dai_name;
49+
const char *component_name;
4950
const int dai_type;
5051
const int dailink[2]; /* dailink id for each direction */
5152
const struct snd_kcontrol_new *controls;

sound/soc/sdw_utils/soc_sdw_utils.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
135135
{
136136
.direction = {true, false},
137137
.dai_name = "rt712-sdca-aif2",
138+
.component_name = "rt712",
138139
.dai_type = SOC_SDW_DAI_TYPE_AMP,
139140
.dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID},
140141
.init = asoc_sdw_rt_amp_init,
@@ -275,6 +276,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
275276
{
276277
.direction = {true, false},
277278
.dai_name = "rt1320-aif1",
279+
.component_name = "rt1320",
278280
.dai_type = SOC_SDW_DAI_TYPE_AMP,
279281
.dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID},
280282
.init = asoc_sdw_rt_amp_init,
@@ -409,6 +411,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
409411
{
410412
.direction = {true, false},
411413
.dai_name = "rt722-sdca-aif2",
414+
.component_name = "rt722",
412415
.dai_type = SOC_SDW_DAI_TYPE_AMP,
413416
/* No feedback capability is provided by rt722-sdca codec driver*/
414417
.dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID},
@@ -438,6 +441,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
438441
{
439442
.direction = {true, true},
440443
.dai_name = "max98373-aif1",
444+
.component_name = "mx8373",
441445
.dai_type = SOC_SDW_DAI_TYPE_AMP,
442446
.dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_AMP_IN_DAI_ID},
443447
.init = asoc_sdw_maxim_init,
@@ -456,6 +460,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
456460
{
457461
.direction = {true, false},
458462
.dai_name = "max98363-aif1",
463+
.component_name = "mx8363",
459464
.dai_type = SOC_SDW_DAI_TYPE_AMP,
460465
.dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID},
461466
.init = asoc_sdw_maxim_init,
@@ -491,6 +496,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
491496
{
492497
.direction = {true, false},
493498
.dai_name = "cs35l56-sdw1",
499+
.component_name = "cs35l56",
494500
.dai_type = SOC_SDW_DAI_TYPE_AMP,
495501
.dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID},
496502
.init = asoc_sdw_cs_amp_init,
@@ -516,6 +522,7 @@ struct asoc_sdw_codec_info codec_info_list[] = {
516522
{
517523
.direction = {true, false},
518524
.dai_name = "cs35l56-sdw1",
525+
.component_name = "cs35l56",
519526
.dai_type = SOC_SDW_DAI_TYPE_AMP,
520527
.dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID},
521528
.init = asoc_sdw_cs_amp_init,

0 commit comments

Comments
 (0)