Skip to content

Commit f6593e8

Browse files
bardliaoujfalusi
authored andcommitted
fixup! ASoC: soc_sdw_utils: skip the endpoint that doesn't present
The existing solution test the dai_info->quirk first and skip the endpoints that is not present according to the quirk. However, if the mc_quirk is not set and dai_info->quirk_exclude is set, then the endpoint will be skip. But we will only set the mc_quirk when the BIOS doesn't provide the right information. We don't want to skip the endpoint just because the mc_quirk is not set. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
1 parent 0d47242 commit f6593e8

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

sound/soc/sdw_utils/soc_sdw_utils.c

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,18 +1304,28 @@ int asoc_sdw_parse_sdw_endpoints(struct snd_soc_card *card,
13041304
dai_info = &codec_info->dais[adr_end->num];
13051305
soc_dai = asoc_sdw_find_dailink(soc_dais, adr_end);
13061306

1307-
if (dai_info->quirk &&
1308-
!(dai_info->quirk_exclude ^ !!(dai_info->quirk & ctx->mc_quirk)))
1309-
continue;
1310-
13111307
/*
1312-
* Skip the sdca endpoint presence check if machine quirk is set.
1313-
* In other words, quirk should have higher priority than the sdca
1314-
* properties in the BIOS.
1308+
* quirk should have higher priority than the sdca properties
1309+
* in the BIOS. We can't always check the DAI quirk because we
1310+
* will set the mc_quirk when the BIOS doesn't provide the right
1311+
* information. The endpoint will be skipped if the dai_info->
1312+
* quirk_exclude and mc_quirk are both not set if we always skip
1313+
* the endpoint according to the quirk information. We need to
1314+
* keep the endpoint if it is present in the BIOS. So, only
1315+
* check the DAI quirk when the mc_quirk is set or SDCA endpoint
1316+
* present check is not needed.
13151317
*/
1316-
if (check_sdca && !(dai_info->quirk & ctx->mc_quirk)) {
1317-
ret = is_sdca_endpoint_present(dev, codec_info,
1318-
adr_link, i, j);
1318+
if (dai_info->quirk & ctx->mc_quirk || !check_sdca) {
1319+
/*
1320+
* Check the endpoint if a matching quirk is set or SDCA
1321+
* endpoint check is not necessary
1322+
*/
1323+
if (dai_info->quirk &&
1324+
!(dai_info->quirk_exclude ^ !!(dai_info->quirk & ctx->mc_quirk)))
1325+
continue;
1326+
} else {
1327+
/* Check SDCA codec endpoint if there is no matching quirk */
1328+
ret = is_sdca_endpoint_present(dev, codec_info, adr_link, i, j);
13191329
if (ret < 0)
13201330
return ret;
13211331

0 commit comments

Comments
 (0)