Skip to contentSkip to conversation

ASoC: AMD Raven/Renoir - fix the PCI probe (PCI revision)

PATCH Superseded Jaroslav Kysela 1 participant 1 message Dec 8, 2020

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jaroslav Kysela

author maintainer
#0 lore raw

PATCH 1/1 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.

---
 sound/soc/amd/raven/pci-acp3x.c     | 4 ++++
 sound/soc/amd/renoir/rn-pci-acp3x.c | 4 ++++
 2 files changed, 8 insertions(+)
sound/soc/amd/raven/pci-acp3x.c +4 -0
index 31b797c8bfe6..77f2d9389606 100644
@@ -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;
sound/soc/amd/renoir/rn-pci-acp3x.c +4 -0
index 60a3e2f442db..338b78c514ec 100644
@@ -188,6 +188,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;
Signature · 1 line
2.26.2