From 036b1447b4a6516f28950f67c1e634b474ef5eb8 Mon Sep 17 00:00:00 2001 From: Bard Liao Date: Tue, 13 Jan 2026 20:35:37 +0800 Subject: [PATCH] ASoC: SOF: Intel: reset link_mask before adding new bits link_mask is set to hdev->info.link_mask at the beginning of hda_sdw_machine_select(). However, some SDW links may not have any peripheral connected. We should set the mask bits where at lease one peripheral is connected. Fixes: 5226d19d4cae ("ASoC: SOF: Intel: use sof_sdw as default SDW machine driver") Signed-off-by: Bard Liao --- sound/soc/sof/intel/hda.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index 762100f7547ff9..38756894e19f47 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -1300,7 +1300,7 @@ static struct snd_soc_acpi_mach *hda_sdw_machine_select(struct snd_sof_dev *sdev struct sof_intel_hda_dev *hdev; int link_index, link_num; int amp_index = 1; - u32 link_mask = 0; + u32 link_mask; int i; hdev = pdata->hw_pdata; @@ -1392,6 +1392,7 @@ static struct snd_soc_acpi_mach *hda_sdw_machine_select(struct snd_sof_dev *sdev return NULL; /* Get link mask and link number */ + link_mask = 0; for (i = 0; i < peripherals->num_peripherals; i++) link_mask |= BIT(peripherals->array[i]->bus->link_id);