Skip to content

Commit 13d4767

Browse files
committed
ASoC: Intel: sof_sdw: append dai type to dai link name unconditionally
The dai_type is used to select function topologies. Since the topology stream name and DAI link name use partial matching, unconditionally appending the dai_type provides necessary selection metadata without breaking existing topologies. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
1 parent d2be53a commit 13d4767

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

sound/soc/intel/boards/sof_sdw.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -928,10 +928,16 @@ static int create_sdw_dailink(struct snd_soc_card *card,
928928
}
929929
}
930930

931+
/*
932+
* The dai_type is used to select function topologies. Since the topology stream name
933+
* and DAI link name use partial matching, unconditionally appending the dai_type provides
934+
* necessary selection metadata without breaking existing topologies. Although
935+
* ctx->append_dai_type is not checked here, we overwrite it to ensure consistency in case
936+
* it is referenced elsewhere.
937+
*/
938+
ctx->append_dai_type = true;
931939
for_each_pcm_streams(stream) {
932940
static const char * const sdw_stream_name[] = {
933-
"SDW%d-Playback",
934-
"SDW%d-Capture",
935941
"SDW%d-Playback-%s",
936942
"SDW%d-Capture-%s",
937943
};
@@ -959,15 +965,10 @@ static int create_sdw_dailink(struct snd_soc_card *card,
959965
}
960966

961967
/* create stream name according to first link id */
962-
if (ctx->append_dai_type)
963-
name = devm_kasprintf(dev, GFP_KERNEL,
964-
sdw_stream_name[stream + 2],
965-
ffs(sof_end->link_mask) - 1,
966-
type_strings[sof_end->dai_info->dai_type]);
967-
else
968-
name = devm_kasprintf(dev, GFP_KERNEL,
969-
sdw_stream_name[stream],
970-
ffs(sof_end->link_mask) - 1);
968+
name = devm_kasprintf(dev, GFP_KERNEL,
969+
sdw_stream_name[stream],
970+
ffs(sof_end->link_mask) - 1,
971+
type_strings[sof_end->dai_info->dai_type]);
971972
if (!name)
972973
return -ENOMEM;
973974

0 commit comments

Comments
 (0)