diff options
| author | Mark Brown <broonie@kernel.org> | 2026-04-06 13:23:33 +0100 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-04-06 13:23:33 +0100 |
| commit | b33b340e22abaac0cba50f5efadf96ee65913e9d (patch) | |
| tree | 22ddbbeab3ef45841ca7c33a7292bc29c7ac3ddf | |
| parent | 4e53116437e919c4b9a9d95fb73ae14fe0cfc8f9 (diff) | |
| parent | 1de6ddcddc954a69f96b1c23205e03ddd603e3c8 (diff) | |
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.
| -rw-r--r-- | sound/soc/sof/intel/hda.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index c0cc7d3ce526..8a240dcb7fcb 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -1133,8 +1133,7 @@ static void hda_generic_machine_select(struct snd_sof_dev *sdev, #if IS_ENABLED(CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE) -static bool is_endpoint_present(struct sdw_slave *sdw_device, - struct asoc_sdw_codec_info *dai_info, int dai_type) +static bool is_endpoint_present(struct sdw_slave *sdw_device, int dai_type) { int i; @@ -1145,7 +1144,7 @@ static bool is_endpoint_present(struct sdw_slave *sdw_device, } for (i = 0; i < sdw_device->sdca_data.num_functions; i++) { - if (dai_type == dai_info->dais[i].dai_type) + if (dai_type == asoc_sdw_get_dai_type(sdw_device->sdca_data.function[i].type)) return true; } 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, } for (j = 0; j < codec_info_list[i].dai_num; j++) { /* Check if the endpoint is present by the SDCA DisCo table */ - if (!is_endpoint_present(sdw_device, &codec_info_list[i], - codec_info_list[i].dais[j].dai_type)) + if (!is_endpoint_present(sdw_device, codec_info_list[i].dais[j].dai_type)) continue; - endpoints[ep_index].num = ep_index; + endpoints[ep_index].num = j; if (codec_info_list[i].dais[j].dai_type == SOC_SDW_DAI_TYPE_AMP) { /* Assume all amp are aggregated */ endpoints[ep_index].aggregated = 1; |
