mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 22:14:03 +02:00
ASoC: amd: acp: fix ffs() operator precedence for SoundWire link ID
ffs(link_mask - 1) computes ffs on (link_mask - 1) instead of
subtracting 1 from the result of ffs(link_mask). For a typical
power-of-2 link_mask this returns the wrong link ID, causing cpu_pin_id
lookup to select the incorrect SoundWire manager.
Fix the operator precedence to ffs(link_mask) - 1 in both
acp-sdw-sof-mach.c and acp-sdw-legacy-mach.c.
Fixes: 6d8348ddc5 ("ASoC: amd: acp: refactor SoundWire machine driver code")
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Link: https://patch.msgid.link/20260910161728.1452808-4-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
0b7d55d3a9
commit
27098aaf28
|
|
@ -217,7 +217,7 @@ static int create_sdw_dailink(struct snd_soc_card *card,
|
|||
|
||||
switch (amd_ctx->acp_rev) {
|
||||
case ACP63_PCI_REV:
|
||||
ret = get_acp63_cpu_pin_id(ffs(soc_end->link_mask - 1),
|
||||
ret = get_acp63_cpu_pin_id(ffs(soc_end->link_mask) - 1,
|
||||
*be_id, &cpu_pin_id, dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
@ -225,7 +225,7 @@ static int create_sdw_dailink(struct snd_soc_card *card,
|
|||
case ACP70_PCI_REV:
|
||||
case ACP71_PCI_REV:
|
||||
case ACP72_PCI_REV:
|
||||
ret = get_acp70_cpu_pin_id(ffs(soc_end->link_mask - 1),
|
||||
ret = get_acp70_cpu_pin_id(ffs(soc_end->link_mask) - 1,
|
||||
*be_id, &cpu_pin_id, dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ static int create_sdw_dailink(struct snd_soc_card *card,
|
|||
}
|
||||
switch (amd_ctx->acp_rev) {
|
||||
case ACP63_PCI_REV:
|
||||
ret = get_acp63_cpu_pin_id(ffs(sof_end->link_mask - 1),
|
||||
ret = get_acp63_cpu_pin_id(ffs(sof_end->link_mask) - 1,
|
||||
*be_id, &cpu_pin_id, dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
@ -140,7 +140,7 @@ static int create_sdw_dailink(struct snd_soc_card *card,
|
|||
case ACP70_PCI_REV:
|
||||
case ACP71_PCI_REV:
|
||||
case ACP72_PCI_REV:
|
||||
ret = get_acp70_cpu_pin_id(ffs(sof_end->link_mask - 1),
|
||||
ret = get_acp70_cpu_pin_id(ffs(sof_end->link_mask) - 1,
|
||||
*be_id, &cpu_pin_id, dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user