[PATCH 2/9] ASoC: SOF: amd: select descriptor per PCI revision in acp7x probe
From: Vijendar Mukunda
Date: Tue Oct 13 2026 - 15:12:34 EST
Add a static acp7f_pci_id entry carrying the acp7f_desc descriptor.
Update acp7x_pci_probe() to check the config flag before the revision
switch and return the per-revision pci_device_id to sof_pci_probe()
rather than passing the table entry.
Remove driver_data from acp7x_pci_ids[] since the descriptor is now
selected in the probe callback.
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@xxxxxxx>
---
sound/soc/sof/amd/pci-acp7x.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/sound/soc/sof/amd/pci-acp7x.c b/sound/soc/sof/amd/pci-acp7x.c
index 5949aefe26bc3..7261377c615b7 100644
--- a/sound/soc/sof/amd/pci-acp7x.c
+++ b/sound/soc/sof/amd/pci-acp7x.c
@@ -68,23 +68,25 @@ static const struct sof_dev_desc acp7f_desc = {
.ops_init = sof_acp7x_ops_init,
};
+static const struct pci_device_id acp7f_pci_id = {
+ PCI_DEVICE(PCI_VENDOR_ID_AMD, ACP_PCI_DEV_ID),
+ .driver_data = (unsigned long)&acp7f_desc,
+};
+
static int acp7x_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
{
unsigned int flag;
+ flag = snd_amd_acp_find_config(pci);
+ if (flag != FLAG_AMD_SOF && flag != FLAG_AMD_SOF_ONLY_DMIC)
+ return -ENODEV;
+
switch (pci->revision) {
- case ACP7B_PCI_ID:
case ACP7F_PCI_ID:
- break;
+ return sof_pci_probe(pci, &acp7f_pci_id);
default:
return -ENODEV;
}
-
- flag = snd_amd_acp_find_config(pci);
- if (flag != FLAG_AMD_SOF && flag != FLAG_AMD_SOF_ONLY_DMIC)
- return -ENODEV;
-
- return sof_pci_probe(pci, pci_id);
}
static void acp7x_pci_remove(struct pci_dev *pci)
@@ -94,8 +96,7 @@ static void acp7x_pci_remove(struct pci_dev *pci)
/* PCI IDs */
static const struct pci_device_id acp7x_pci_ids[] = {
- { PCI_DEVICE(PCI_VENDOR_ID_AMD, ACP_PCI_DEV_ID),
- .driver_data = (unsigned long)&acp7f_desc},
+ { PCI_DEVICE(PCI_VENDOR_ID_AMD, ACP_PCI_DEV_ID) },
{ 0, }
};
MODULE_DEVICE_TABLE(pci, acp7x_pci_ids);
--
2.48.1