Skip to content

Commit 65fd664

Browse files
committed
ASoC: sdw_utils: subtract the endpoint that is not present
When asoc_sdw_count_sdw_endpoints() count the num_ends, it doesn't skip the unpresented endpoints. But, asoc_sdw_parse_sdw_endpoints() will skip the unpresented endpoints either by quirk or the SDCA function doesn't show up the endpoint. The endpoint number mismatches between count and parse and the machine driver will show up a warning about it. Fixes: 26ee34d ("ASoC: sdw_utils: Add codec_conf for every DAI") Closes: thesofproject#5620 Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
1 parent 3217d38 commit 65fd664

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sound/soc/sdw_utils/soc_sdw_utils.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,17 +1534,21 @@ int asoc_sdw_parse_sdw_endpoints(struct snd_soc_card *card,
15341534
* endpoint check is not necessary
15351535
*/
15361536
if (dai_info->quirk &&
1537-
!(dai_info->quirk_exclude ^ !!(dai_info->quirk & ctx->mc_quirk)))
1537+
!(dai_info->quirk_exclude ^ !!(dai_info->quirk & ctx->mc_quirk))) {
1538+
(*num_devs)--;
15381539
continue;
1540+
}
15391541
} else {
15401542
/* Check SDCA codec endpoint if there is no matching quirk */
15411543
ret = is_sdca_endpoint_present(dev, codec_info, adr_link, i, j);
15421544
if (ret < 0)
15431545
return ret;
15441546

15451547
/* The endpoint is not present, skip */
1546-
if (!ret)
1548+
if (!ret) {
1549+
(*num_devs)--;
15471550
continue;
1551+
}
15481552
}
15491553

15501554
dev_dbg(dev,

0 commit comments

Comments
 (0)