mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
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> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com> Link: https://patch.msgid.link/20260515083043.1864426-1-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
bf628fa4d4
commit
c84179a1d3
|
|
@ -901,10 +901,16 @@ static int create_sdw_dailink(struct snd_soc_card *card,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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. Although
|
||||||
|
* ctx->append_dai_type is not checked here, we overwrite it to ensure consistency in case
|
||||||
|
* it is referenced elsewhere.
|
||||||
|
*/
|
||||||
|
ctx->append_dai_type = true;
|
||||||
for_each_pcm_streams(stream) {
|
for_each_pcm_streams(stream) {
|
||||||
static const char * const sdw_stream_name[] = {
|
static const char * const sdw_stream_name[] = {
|
||||||
"SDW%d-Playback",
|
|
||||||
"SDW%d-Capture",
|
|
||||||
"SDW%d-Playback-%s",
|
"SDW%d-Playback-%s",
|
||||||
"SDW%d-Capture-%s",
|
"SDW%d-Capture-%s",
|
||||||
};
|
};
|
||||||
|
|
@ -932,15 +938,10 @@ static int create_sdw_dailink(struct snd_soc_card *card,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create stream name according to first link id */
|
/* create stream name according to first link id */
|
||||||
if (ctx->append_dai_type)
|
name = devm_kasprintf(dev, GFP_KERNEL,
|
||||||
name = devm_kasprintf(dev, GFP_KERNEL,
|
sdw_stream_name[stream],
|
||||||
sdw_stream_name[stream + 2],
|
ffs(sof_end->link_mask) - 1,
|
||||||
ffs(sof_end->link_mask) - 1,
|
type_strings[sof_end->dai_info->dai_type]);
|
||||||
type_strings[sof_end->dai_info->dai_type]);
|
|
||||||
else
|
|
||||||
name = devm_kasprintf(dev, GFP_KERNEL,
|
|
||||||
sdw_stream_name[stream],
|
|
||||||
ffs(sof_end->link_mask) - 1);
|
|
||||||
if (!name)
|
if (!name)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user