[PATCH 01/11] ASoC: SOF: amd: return -EINVAL for unknown PCI revision in acp7x suspend
From: Vijendar Mukunda
Date: Thu Sep 10 2026 - 09:26:43 EST
amd_sof_acp7x_suspend() is registered only for ACP7.B and ACP7.F
platforms. If an unexpected PCI revision reaches the switch statement
the default case previously fell through, leaving ACP_CONTROL
with a stale value (enable=false) before writing ZSC_DSP_CTRL=1.
Return -EINVAL instead to surface the programming error immediately.
Fixes: 1c9646f3180e ("ASoC: SOF: amd: add system and runtime PM ops for ACP7x")
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@xxxxxxx>
---
sound/soc/sof/amd/acp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c
index f89ad86260b4..688df7acd2e2 100644
--- a/sound/soc/sof/amd/acp.c
+++ b/sound/soc/sof/amd/acp.c
@@ -1197,7 +1197,8 @@ int amd_sof_acp7x_suspend(struct snd_sof_dev *sdev, u32 target_state)
enable = true;
break;
default:
- break;
+ dev_err(sdev->dev, "Unexpected PCI revision: 0x%x\n", acp_data->pci_rev);
+ return -EINVAL;
}
snd_sof_dsp_write(sdev, ACP_DSP_BAR, ACP_CONTROL, enable);
snd_sof_dsp_write(sdev, ACP_DSP_BAR, ACP7X_ZSC_DSP_CTRL, 1);
--
2.48.1