Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: Intel: sof_sdw: starts non sdw BE id with the highest sdw BE id

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>

authored by

Bard Liao and committed by
Mark Brown
6b4c7d4d 7fa43af5

+7 -1
+7 -1
sound/soc/intel/boards/sof_sdw.c
··· 1767 1767 return codec_index; 1768 1768 1769 1769 for (j = 0; j < codec_info_list[codec_index].dai_num ; j++) { 1770 + int current_be_id; 1771 + 1770 1772 ret = create_sdw_dailink(card, &link_index, dai_links, 1771 1773 sdw_be_num, adr_link, 1772 1774 codec_conf, codec_conf_num, 1773 - &be_id, &codec_conf_index, 1775 + &current_be_id, &codec_conf_index, 1774 1776 &ignore_pch_dmic, append_dai_type, i, j); 1775 1777 if (ret < 0) { 1776 1778 dev_err(dev, "failed to create dai link %d\n", link_index); 1777 1779 return ret; 1778 1780 } 1781 + 1782 + /* Update the be_id to match the highest ID used for SDW link */ 1783 + if (be_id < current_be_id) 1784 + be_id = current_be_id; 1779 1785 } 1780 1786 1781 1787 if (aggregation && endpoint->aggregated)