Skip to content

Commit

Permalink
ASoC: Intel: sof_sdw: starts non sdw BE id with the highest sdw BE id
Browse files Browse the repository at this point in the history
The soundwire links do not have their IDs as consecutive numbers, thus
the last link might have lower be_id than the previous one and this
leads to id collision with non SDW links.

For example,
create dai link SDW0-Playback-SimpleJack, id 0
create dai link SDW0-Capture-SmartMic, id 4
create dai link SDW0-Capture-SimpleJack, id 1
create dai link SDW2-Playback-SmartAmp, id 2
create dai link SDW2-Capture-SmartAmp, id 3
create dai link iDisp1, id 4
create dai link iDisp2, id 5
create dai link iDisp3, id 6

Reviewed-by: Chao Song <chao.song@linux.intel.com>
Co-developed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter 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/20240208165545.93811-25-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Bard Liao authored and Mark Brown committed Feb 8, 2024
1 parent 7fa43af commit 6b4c7d4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sound/soc/intel/boards/sof_sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1767,15 +1767,21 @@ static int sof_card_dai_links_create(struct snd_soc_card *card)
return codec_index;

for (j = 0; j < codec_info_list[codec_index].dai_num ; j++) {
int current_be_id;

ret = create_sdw_dailink(card, &link_index, dai_links,
sdw_be_num, adr_link,
codec_conf, codec_conf_num,
&be_id, &codec_conf_index,
&current_be_id, &codec_conf_index,
&ignore_pch_dmic, append_dai_type, i, j);
if (ret < 0) {
dev_err(dev, "failed to create dai link %d\n", link_index);
return ret;
}

/* Update the be_id to match the highest ID used for SDW link */
if (be_id < current_be_id)
be_id = current_be_id;
}

if (aggregation && endpoint->aggregated)
Expand Down

0 comments on commit 6b4c7d4

Please sign in to comment.