[d-kernel] [PATCH] ASoC: AMD: fix conflict use pci-acp driver for ES8336 codec

nickel на altlinux.org nickel на altlinux.org
Вт Мар 7 16:54:57 MSK 2023


From: Vasiliy Kovalev <kovalev at altlinux.org>

For a family of machines whose pci revision ID is 0x1 (renoir),
working with the es8336 codec is only available through the
snd-pci-acp3x driver (raven).

Now we will use a specific driver if there is an acpi device
detected as "ESSX8336" in the machine.

Fixes: 5d33d36f777903 ("ASoC: AMD: add ACP machine driver for ES8336")
Signed-off-by: Vasiliy Kovalev <kovalev at altlinux.org>
Signed-off-by: Nikolai Kostrigin <nickel at altlinux.org>
---
 sound/soc/amd/raven/pci-acp3x.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sound/soc/amd/raven/pci-acp3x.c b/sound/soc/amd/raven/pci-acp3x.c
index cdb8773b11f136..94e12a1483bb55 100644
--- a/sound/soc/amd/raven/pci-acp3x.c
+++ b/sound/soc/amd/raven/pci-acp3x.c
@@ -11,6 +11,7 @@
 #include <linux/interrupt.h>
 #include <linux/pm_runtime.h>
 #include <linux/delay.h>
+#include <sound/soc-acpi.h>
 
 #include "acp3x.h"
 
@@ -133,8 +134,11 @@ static int snd_acp3x_probe(struct pci_dev *pci,
 	int ret, i;
 	u32 addr, val;
 
+	dev_info(&pci->dev, "pci->revision = 0x%x\n", pci->revision);
 	/* Raven and lucienne device detection */
-	if (pci->revision != 0x00 && pci->revision != 0x01)
+	if (acpi_dev_get_first_match_dev("ESSX8336", NULL, -1))
+		dev_info(&pci->dev, "use pci-acp for ES8336 codec\n");
+	else if (pci->revision != 0x00)
 		return -ENODEV;
 
 	if (pci_enable_device(pci)) {
-- 
2.33.6



Подробная информация о списке рассылки devel-kernel