aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaroslav Kysela <[email protected]>2020-12-08 19:12:33 +0100
committerMark Brown <[email protected]>2020-12-09 12:12:59 +0000
commit55d8e6a85bce21f748c42eedea63681219f70523 (patch)
treefab11ffc3a4b652d4714b8e50e31c628ac5ad73e
parent3cea33b6f2d7782d1be17c71509986f33ee93541 (diff)
ASoC: AMD Raven/Renoir - fix the PCI probe (PCI revision)
The Raven and Renoir ACP can be distinguished by the PCI revision. Let's do the check very early, otherwise the wrong probe code can be run. Link: https://lore.kernel.org/alsa-devel/[email protected]/ Cc: <[email protected]> Cc: Vijendar Mukunda <[email protected]> Cc: Mark Brown <[email protected]> Signed-off-by: Jaroslav Kysela <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--sound/soc/amd/raven/pci-acp3x.c4
-rw-r--r--sound/soc/amd/renoir/rn-pci-acp3x.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/sound/soc/amd/raven/pci-acp3x.c b/sound/soc/amd/raven/pci-acp3x.c
index a7de4e607961..24d0f955243d 100644
--- a/sound/soc/amd/raven/pci-acp3x.c
+++ b/sound/soc/amd/raven/pci-acp3x.c
@@ -118,6 +118,10 @@ static int snd_acp3x_probe(struct pci_dev *pci,
int ret, i;
u32 addr, val;
+ /* Raven device detection */
+ if (pci->revision != 0x00)
+ return -ENODEV;
+
if (pci_enable_device(pci)) {
dev_err(&pci->dev, "pci_enable_device failed\n");
return -ENODEV;
diff --git a/sound/soc/amd/renoir/rn-pci-acp3x.c b/sound/soc/amd/renoir/rn-pci-acp3x.c
index 877350f38a68..d9e6e49bff01 100644
--- a/sound/soc/amd/renoir/rn-pci-acp3x.c
+++ b/sound/soc/amd/renoir/rn-pci-acp3x.c
@@ -176,6 +176,10 @@ static int snd_rn_acp_probe(struct pci_dev *pci,
int ret, index;
u32 addr;
+ /* Renoir device check */
+ if (pci->revision != 0x01)
+ return -ENODEV;
+
if (pci_enable_device(pci)) {
dev_err(&pci->dev, "pci_enable_device failed\n");
return -ENODEV;