Skip to content

Commit

Permalink
ASoC: AMD Raven/Renoir - fix the PCI probe (PCI revision)
Browse files Browse the repository at this point in the history
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/2e4587f8-f602-cf23-4845-fd27a32b1cfc@amd.com/
Cc: <stable@kernel.org>
Cc: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20201208181233.2745726-1-perex@perex.cz
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
perexg authored and broonie committed Dec 9, 2020
1 parent 3cea33b commit 55d8e6a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sound/soc/amd/raven/pci-acp3x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions sound/soc/amd/renoir/rn-pci-acp3x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 55d8e6a

Please sign in to comment.