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: Allow different devices on the same link

If the current code encounters a new type of device on a SoundWire
link, it will abort processing that link and move onto the next
link. However, there is no reason to disallow this setup, it would
appear this was being disallowed to work around issues introduced
by only the first endpoint on each link being checked, which is now
fixed.

The device type shouldn't determine which DAI link it is connected to,
the group ID and aggregation status should.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230808132013.889419-11-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Charles Keepax and committed by
Mark Brown
317dcdec f82742dd

+7 -15
+7 -15
sound/soc/intel/boards/sof_sdw.c
··· 1163 1163 static int fill_sdw_codec_dlc(struct device *dev, 1164 1164 const struct snd_soc_acpi_link_adr *adr_link, 1165 1165 struct snd_soc_dai_link_component *codec, 1166 - int codec_index, int adr_index, int dai_index) 1166 + int adr_index, int dai_index) 1167 1167 { 1168 1168 unsigned int sdw_version, unique_id, mfg_id, link_id, part_id, class_id; 1169 1169 u64 adr = adr_link->adr_d[adr_index].adr; 1170 + int codec_index; 1171 + 1172 + codec_index = find_codec_info_part(adr); 1173 + if (codec_index < 0) 1174 + return codec_index; 1170 1175 1171 1176 sdw_version = SDW_VERSION(adr); 1172 1177 link_id = SDW_DISCO_LINK_ID(adr); ··· 1373 1368 j = adr_index; 1374 1369 for (adr_link_next = adr_link; adr_link_next && adr_link_next->num_adr && 1375 1370 i < cpu_dai_num; adr_link_next++) { 1376 - int _codec_index = -1; 1377 - 1378 1371 /* skip the link excluded by this processed group */ 1379 1372 if (cpu_dai_id[i] != ffs(adr_link_next->mask) - 1) 1380 1373 continue; ··· 1380 1377 /* j reset after loop, adr_index only applies to first link */ 1381 1378 for (; j < adr_link_next->num_adr; j++) { 1382 1379 const struct snd_soc_acpi_endpoint *endpoints; 1383 - int codec_index; 1384 - u64 adr = adr_link_next->adr_d[j].adr; 1385 - 1386 - codec_index = find_codec_info_part(adr); 1387 - if (codec_index < 0) 1388 - return codec_index; 1389 - if (_codec_index != -1 && codec_index != _codec_index) { 1390 - dev_dbg(dev, "Different devices on the same sdw link\n"); 1391 - break; 1392 - } 1393 - _codec_index = codec_index; 1394 1380 1395 1381 endpoints = adr_link_next->adr_d[j].endpoints; 1396 1382 ··· 1395 1403 1396 1404 ret = fill_sdw_codec_dlc(dev, adr_link_next, 1397 1405 &codecs[codec_dlc_index], 1398 - codec_index, j, dai_index); 1406 + j, dai_index); 1399 1407 if (ret) 1400 1408 return ret; 1401 1409