Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion sound/soc/sof/intel/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -1392,17 +1392,26 @@ static struct snd_soc_acpi_mach *hda_sdw_machine_select(struct snd_sof_dev *sdev
return NULL;

/* Get link mask and link number */
for (i = 0; i < peripherals->num_peripherals; i++)
for (i = 0; i < peripherals->num_peripherals; i++) {
if (peripherals->array[i]->status == SDW_SLAVE_UNATTACHED)
continue;
link_mask |= BIT(peripherals->array[i]->bus->link_id);
}

if (!link_mask)
return NULL;
Comment on lines +1401 to +1402

link_num = hweight32(link_mask);

/* An empty adr_link is needed to terminate the adr_link loop */
links = devm_kcalloc(sdev->dev, link_num + 1, sizeof(*links), GFP_KERNEL);
if (!links)
return NULL;

/* Generate snd_soc_acpi_link_adr struct for each peripheral reported by the ACPI table */
for (i = 0; i < peripherals->num_peripherals; i++) {
if (peripherals->array[i]->status == SDW_SLAVE_UNATTACHED)
continue;
/* link_index = the number of used links below the current link */
link_index = hweight32(link_mask & (BIT(peripherals->array[i]->bus->link_id) - 1));
links[link_index].adr_d = find_acpi_adr_device(sdev->dev, peripherals->array[i],
Expand Down
Loading