Skip to content

Commit b33b340

Browse files
committed
ASoC: SOF: Intel: Fixes for find_acpi_adr_device() when some endpoints are missing
Bard Liao <yung-chuan.liao@linux.intel.com> says: To make sure find_acpi_adr_device can work well when some of the endpoints are missing and do not map 1:1 to codec_info_list.
2 parents 4e53116 + 1de6ddc commit b33b340

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

sound/soc/sof/intel/hda.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,8 +1133,7 @@ static void hda_generic_machine_select(struct snd_sof_dev *sdev,
11331133

11341134
#if IS_ENABLED(CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE)
11351135

1136-
static bool is_endpoint_present(struct sdw_slave *sdw_device,
1137-
struct asoc_sdw_codec_info *dai_info, int dai_type)
1136+
static bool is_endpoint_present(struct sdw_slave *sdw_device, int dai_type)
11381137
{
11391138
int i;
11401139

@@ -1145,7 +1144,7 @@ static bool is_endpoint_present(struct sdw_slave *sdw_device,
11451144
}
11461145

11471146
for (i = 0; i < sdw_device->sdca_data.num_functions; i++) {
1148-
if (dai_type == dai_info->dais[i].dai_type)
1147+
if (dai_type == asoc_sdw_get_dai_type(sdw_device->sdca_data.function[i].type))
11491148
return true;
11501149
}
11511150
dev_dbg(&sdw_device->dev, "Endpoint DAI type %d not found\n", dai_type);
@@ -1199,11 +1198,10 @@ static struct snd_soc_acpi_adr_device *find_acpi_adr_device(struct device *dev,
11991198
}
12001199
for (j = 0; j < codec_info_list[i].dai_num; j++) {
12011200
/* Check if the endpoint is present by the SDCA DisCo table */
1202-
if (!is_endpoint_present(sdw_device, &codec_info_list[i],
1203-
codec_info_list[i].dais[j].dai_type))
1201+
if (!is_endpoint_present(sdw_device, codec_info_list[i].dais[j].dai_type))
12041202
continue;
12051203

1206-
endpoints[ep_index].num = ep_index;
1204+
endpoints[ep_index].num = j;
12071205
if (codec_info_list[i].dais[j].dai_type == SOC_SDW_DAI_TYPE_AMP) {
12081206
/* Assume all amp are aggregated */
12091207
endpoints[ep_index].aggregated = 1;

0 commit comments

Comments
 (0)