* [PATCH v4 0/5] ASoC: amd: yc: do not bind the ACP when no DMIC is wired
@ 2026-12-03 18:30 MuXian Chen
2026-12-03 18:30 ` [PATCH v4 1/5] ASoC: amd: yc: stop the shared IRQ before tearing down platform devices MuXian Chen
` (4 more replies)
0 siblings, 5 replies; 9+ messages in thread
From: MuXian Chen @ 2026-12-03 18:30 UTC (permalink / raw)
To: Vijendar Mukunda, Venkata Prasad Potturu, Liam Girdwood,
Mark Brown, Jaroslav Kysela, Takashi Iwai
Cc: linux-sound, linux-kernel, Mario Limonciello
The ACP6x function is present on every Yellow Carp platform, including
boards where nothing is wired behind it: no DMIC array, no I2S codec and
no SoundWire peripheral. Firmware does not say so. The ACPI node
carries no consumer description, and the _WOV method on some boards is a
template that unconditionally returns 1, so the driver cannot tell
"present" from "used".
Binding the function on such a board has no upside and a real cost: the
probe path runs acp6x_init() and the runtime suspend path then gates the
audio clock (ACP_CLKMUX_SEL = 0) in acp6x_deinit(). The block shares
that clock domain with the HDA controller on the same PCI segment, and
HDA can end up with
snd_hda_intel 0000:06:00.6: CORB reset timeout#2, CORBRP = 65535
sometimes without recovering. This is the regression analysed in
https://gitlab.freedesktop.org/drm/amd/-/work_items/5529, which contains
the amd-s2idle reports for df4148a5a3cf with and without the commit on
this exact platform.
This series makes the existing board list -- already maintained for the
machine driver -- the signal for "a consumer is wired", and declines the
device when neither the list nor the AcpDmicConnected property says so.
Nothing is enabled, mapped or initialized and no register in the shared
clock domain is written; the PCI core suspends the function after the
failed probe. Boards in the list behave exactly as before.
Patch 1 is an independent use-after-free fix in the teardown path and
can be applied on its own.
Patches 2 and 3 are refactoring only. Patch 4 makes the probe decline
unlisted boards. Patch 5 adds a read-only module parameter for boards
the list gets wrong; it can be dropped if it is not wanted.
Tested on a MECHREVO JIAOLONG (rev 0x62), which has no DMIC consumer:
two s2idle cycles, no CORB errors, onboard HDA and playback unaffected.
Changes in v4:
- rebased onto the ASoC for-next tree (7595ea9); the board list carries
the entries added since v3, and the patches were compile-tested
against that tree
MuXian Chen (5):
ASoC: amd: yc: stop the shared IRQ before tearing down platform
devices
ASoC: amd: yc: share the ACP6x DMIC board list
ASoC: amd: yc: ask the firmware once about the ACP DMIC path
ASoC: amd: yc: refuse the ACP function when no DMIC is wired
ASoC: amd: yc: allow forcing the ACP DMIC decision
sound/soc/amd/yc/Makefile | 2 +-
sound/soc/amd/yc/acp6x-mach.c | 1028 +------------------------------
sound/soc/amd/yc/acp6x-quirks.c | 897 +++++++++++++++++++++++++++
sound/soc/amd/yc/acp6x.h | 1 +
sound/soc/amd/yc/pci-acp6x.c | 30 +
5 files changed, 939 insertions(+), 1019 deletions(-)
create mode 100644 sound/soc/amd/yc/acp6x-quirks.c
--
2.56.1
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH v4 1/5] ASoC: amd: yc: stop the shared IRQ before tearing down platform devices 2026-12-03 18:30 [PATCH v4 0/5] ASoC: amd: yc: do not bind the ACP when no DMIC is wired MuXian Chen @ 2026-12-03 18:30 ` MuXian Chen 2026-12-04 5:13 ` Mukunda,Vijendar 2026-12-03 18:30 ` [PATCH v4 2/5] ASoC: amd: yc: share the ACP6x DMIC board list MuXian Chen ` (3 subsequent siblings) 4 siblings, 1 reply; 9+ messages in thread From: MuXian Chen @ 2026-12-03 18:30 UTC (permalink / raw) To: Vijendar Mukunda, Venkata Prasad Potturu, Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai Cc: linux-sound, linux-kernel, Mario Limonciello The IRQ handler dereferences adata->pdev[0], which is freed by platform_device_unregister(). The IRQ is released only afterwards via devres, so a spurious interrupt in that window dereferences freed memory: BUG: kernel NULL pointer dereference, address: 0x10 RIP: acp6x_irq_handler Disable the interrupts and release the IRQ before unregistering the platform devices, and return IRQ_NONE if the drvdata has already been cleared. Signed-off-by: MuXian Chen <a18165943161@gmail.com> --- sound/soc/amd/yc/pci-acp6x.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sound/soc/amd/yc/pci-acp6x.c b/sound/soc/amd/yc/pci-acp6x.c index baf2baeb9952..a961e38c25ef 100644 --- a/sound/soc/amd/yc/pci-acp6x.c +++ b/sound/soc/amd/yc/pci-acp6x.c @@ -133,6 +133,8 @@ static irqreturn_t acp6x_irq_handler(int irq, void *dev_id) val = acp6x_readl(adata->acp6x_base + ACP_EXTERNAL_INTR_STAT); if (val & BIT(PDM_DMA_STAT)) { yc_pdm_data = dev_get_drvdata(&adata->pdev[0]->dev); + if (!yc_pdm_data) + return IRQ_NONE; acp6x_writel(BIT(PDM_DMA_STAT), adata->acp6x_base + ACP_EXTERNAL_INTR_STAT); if (yc_pdm_data->capture_stream) snd_pcm_period_elapsed(yc_pdm_data->capture_stream); @@ -355,6 +357,13 @@ static void snd_acp6x_remove(struct pci_dev *pci) int ret, index; adata = pci_get_drvdata(pci); + + /* Stop the shared IRQ before the platform devices it dereferences + * are unregistered. + */ + acp6x_disable_interrupts(adata->acp6x_base); + devm_free_irq(&pci->dev, pci->irq, adata); + if (adata->acp6x_audio_mode == ACP6x_PDM_MODE) { for (index = 0; index < ACP6x_DEVS; index++) platform_device_unregister(adata->pdev[index]); -- 2.56.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v4 1/5] ASoC: amd: yc: stop the shared IRQ before tearing down platform devices 2026-12-03 18:30 ` [PATCH v4 1/5] ASoC: amd: yc: stop the shared IRQ before tearing down platform devices MuXian Chen @ 2026-12-04 5:13 ` Mukunda,Vijendar 0 siblings, 0 replies; 9+ messages in thread From: Mukunda,Vijendar @ 2026-12-04 5:13 UTC (permalink / raw) To: MuXian Chen, Venkata Prasad Potturu, Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai Cc: linux-sound, linux-kernel, Mario Limonciello On 12/4/26 00:00, MuXian Chen wrote: > [You don't often get email from a18165943161@gmail.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] > > The IRQ handler dereferences adata->pdev[0], which is freed by > platform_device_unregister(). The IRQ is released only afterwards via > devres, so a spurious interrupt in that window dereferences freed > memory: > > BUG: kernel NULL pointer dereference, address: 0x10 > RIP: acp6x_irq_handler > > Disable the interrupts and release the IRQ before unregistering the > platform devices, and return IRQ_NONE if the drvdata has already been > cleared. > > Signed-off-by: MuXian Chen <a18165943161@gmail.com> > --- > sound/soc/amd/yc/pci-acp6x.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/sound/soc/amd/yc/pci-acp6x.c b/sound/soc/amd/yc/pci-acp6x.c > index baf2baeb9952..a961e38c25ef 100644 > --- a/sound/soc/amd/yc/pci-acp6x.c > +++ b/sound/soc/amd/yc/pci-acp6x.c > @@ -133,6 +133,8 @@ static irqreturn_t acp6x_irq_handler(int irq, void *dev_id) > val = acp6x_readl(adata->acp6x_base + ACP_EXTERNAL_INTR_STAT); > if (val & BIT(PDM_DMA_STAT)) { > yc_pdm_data = dev_get_drvdata(&adata->pdev[0]->dev); > + if (!yc_pdm_data) > + return IRQ_NONE; ACP uses line-based level-triggered interrupts. ACP_EXTERNAL_INTR_STAT is a write-1-to-clear register; until that write happens the interrupt line stays asserted. Returning IRQ_NONE here leaves PDM_DMA_STAT latched in hardware, the level remains high, and the GIC re-presents the interrupt immediately. The handler fires again, sees !yc_pdm_data again, returns IRQ_NONE again -- this spins until the kernel detects "nobody cared" and hard-disables the IRQ. The fix must clear the status bit before returning, and return IRQ_HANDLED since the interrupt did originate from this device: if (!yc_pdm_data) { acp6x_writel(BIT(PDM_DMA_STAT), adata->acp6x_base + ACP_EXTERNAL_INTR_STAT); return IRQ_HANDLED; } > acp6x_writel(BIT(PDM_DMA_STAT), adata->acp6x_base + ACP_EXTERNAL_INTR_STAT); > if (yc_pdm_data->capture_stream) > snd_pcm_period_elapsed(yc_pdm_data->capture_stream); > @@ -355,6 +357,13 @@ static void snd_acp6x_remove(struct pci_dev *pci) > int ret, index; > > adata = pci_get_drvdata(pci); > + > + /* Stop the shared IRQ before the platform devices it dereferences > + * are unregistered. > + */ > + acp6x_disable_interrupts(adata->acp6x_base); > + devm_free_irq(&pci->dev, pci->irq, adata); > + With the remove reordering in place the !yc_pdm_data path in the IRQ handler is dead code for the teardown race. The sequence is now: 1. acp6x_disable_interrupts() -- masks HW interrupt generation 2. devm_free_irq() -- releases the IRQ; synchronize_irq() inside ensures any in-flight handler has returned before this call returns 3. platform_device_unregister() -- tears down pdev and clears drvdata After step 2 no handler can run. drvdata is only cleared in step 3. So the handler can never observe !yc_pdm_data due to this race. If the guard is kept as a defensive check for other scenarios (e.g. a pdev whose probe failed and left drvdata NULL), it still must clear ACP_EXTERNAL_INTR_STAT before returning, as described in the previous comment, otherwise a level-triggered IRQ storm results. devm_free_irq() is not needed here. The IRQ was registered with devm_request_irq() in snd_acp6x_probe(), so devres already holds the release action. Calling devm_free_irq() removes that action from the devres list prematurely and breaks the devres ownership model -- the IRQ lifecycle should be managed entirely by devres. acp6x_disable_interrupts() is sufficient to prevent the ACP block from generating new interrupts before platform_device_unregister() is called. devres will release the IRQ automatically during the normal unwind. > if (adata->acp6x_audio_mode == ACP6x_PDM_MODE) { > for (index = 0; index < ACP6x_DEVS; index++) > platform_device_unregister(adata->pdev[index]); > -- > 2.56.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v4 2/5] ASoC: amd: yc: share the ACP6x DMIC board list 2026-12-03 18:30 [PATCH v4 0/5] ASoC: amd: yc: do not bind the ACP when no DMIC is wired MuXian Chen 2026-12-03 18:30 ` [PATCH v4 1/5] ASoC: amd: yc: stop the shared IRQ before tearing down platform devices MuXian Chen @ 2026-12-03 18:30 ` MuXian Chen 2026-12-04 6:07 ` Mukunda,Vijendar 2026-12-03 18:30 ` [PATCH v4 3/5] ASoC: amd: yc: ask the firmware once about the ACP DMIC path MuXian Chen ` (2 subsequent siblings) 4 siblings, 1 reply; 9+ messages in thread From: MuXian Chen @ 2026-12-03 18:30 UTC (permalink / raw) To: Vijendar Mukunda, Venkata Prasad Potturu, Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai Cc: linux-sound, linux-kernel, Mario Limonciello The board list in acp6x-mach.c is the only reliable indication that a platform actually wires the ACP DMIC path; firmware is not usable for that (some boards ship a _WOV template that unconditionally returns 1). Move it to a separate source file linked into snd-pci-acp6x and expose snd_acp6x_platform_has_dmic(), which folds in the _WOV and AcpDmicConnected checks with the same precedence the machine driver used. The machine driver now calls the helper instead of carrying its own copy of the decision logic. No functional change. Signed-off-by: MuXian Chen <a18165943161@gmail.com> --- sound/soc/amd/yc/Makefile | 2 +- sound/soc/amd/yc/acp6x-mach.c | 1029 +------------------------------ sound/soc/amd/yc/acp6x-quirks.c | 884 ++++++++++++++++++++++++++ sound/soc/amd/yc/acp6x.h | 1 + 4 files changed, 897 insertions(+), 1019 deletions(-) create mode 100644 sound/soc/amd/yc/acp6x-quirks.c diff --git a/sound/soc/amd/yc/Makefile b/sound/soc/amd/yc/Makefile index 7a0a3a410b2d..be8ffc7bf230 100644 --- a/sound/soc/amd/yc/Makefile +++ b/sound/soc/amd/yc/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0+ # Yellow Carp platform Support -snd-pci-acp6x-y := pci-acp6x.o +snd-pci-acp6x-y := pci-acp6x.o acp6x-quirks.o snd-acp6x-pdm-dma-y := acp6x-pdm-dma.o snd-soc-acp6x-mach-y := acp6x-mach.o diff --git a/sound/soc/amd/yc/acp6x-mach.c b/sound/soc/amd/yc/acp6x-mach.c index 505d481173ce..d5dca8bc36ba 100644 --- a/sound/soc/amd/yc/acp6x-mach.c +++ b/sound/soc/amd/yc/acp6x-mach.c @@ -11,8 +11,7 @@ #include <sound/pcm.h> #include <sound/pcm_params.h> #include <linux/io.h> -#include <linux/dmi.h> -#include <linux/acpi.h> +#include <linux/pci.h> #include "acp6x.h" @@ -44,1032 +43,26 @@ static struct snd_soc_card acp6x_card = { .num_links = 1, }; -static const struct dmi_system_id yc_acp_quirk_table[] = { - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire AG14-22P"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Lecoo"), - DMI_MATCH(DMI_PRODUCT_NAME, "Bellator N176"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), - DMI_MATCH(DMI_PRODUCT_NAME, "HP Laptop 15-fc0xxx"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), - DMI_MATCH(DMI_PRODUCT_NAME, "OMEN Gaming Laptop 16-ap0xxx"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5525"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21D0"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21D1"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21D2"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21D3"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21D4"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21D5"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21CF"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21CG"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21CQ"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21CR"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21CM"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21CN"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21CH"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21CJ"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21CK"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21CL"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21EF"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21EM"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21EN"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21HY"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21J0"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21J5"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21J6"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21JN"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21M1"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21M3"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21M4"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21M5"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21M6"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "21ME"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "82QF"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "82TL"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "82UG"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "82UU"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "82V2"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "82YM"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "83AS"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "83BS"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "83HN"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "83L3"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "83N6"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "83Q2"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "83Q3"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "83UU"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "84CS"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "83VD"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "RB"), - DMI_MATCH(DMI_PRODUCT_NAME, "Nitro ANV15-41"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "RB"), - DMI_MATCH(DMI_PRODUCT_NAME, "Nitro AN16-41"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "RB"), - DMI_MATCH(DMI_PRODUCT_NAME, "Nitro AN17-41"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "83J2"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), - DMI_MATCH(DMI_PRODUCT_NAME, "83J3"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_MATCH(DMI_PRODUCT_NAME, "UM5302TA"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_MATCH(DMI_PRODUCT_NAME, "M5402RA"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_MATCH(DMI_PRODUCT_NAME, "M5602RA"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_MATCH(DMI_PRODUCT_NAME, "M6400RC"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_MATCH(DMI_PRODUCT_NAME, "M3402RA"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_MATCH(DMI_PRODUCT_NAME, "M6500RC"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_MATCH(DMI_PRODUCT_NAME, "M6500RE"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_MATCH(DMI_PRODUCT_NAME, "M6501RM"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_MATCH(DMI_PRODUCT_NAME, "E1404FA"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_MATCH(DMI_PRODUCT_NAME, "E1504FA"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_MATCH(DMI_PRODUCT_NAME, "M7600RE"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_MATCH(DMI_PRODUCT_NAME, "M3502RA"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), - DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 15 B7ED"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), - DMI_MATCH(DMI_PRODUCT_NAME, "Crosshair A17 HX D8WFKG"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), - DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 15 C7VE"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), - DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 15 C7VF"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), - DMI_MATCH(DMI_PRODUCT_NAME, "Alpha 17 C7VF"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), - DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 17 D7VEK"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), - DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 17 D7VF"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), - DMI_MATCH(DMI_PRODUCT_NAME, "Vector A16 HX A8WHG"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), - DMI_MATCH(DMI_PRODUCT_NAME, "Crosshair A16 HX D7WFKG"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International Co., Ltd."), - DMI_MATCH(DMI_PRODUCT_NAME, "Crosshair A16 HX D8WGKG"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), - DMI_EXACT_MATCH(DMI_BOARD_NAME, "MS-184L"), - DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Crosshair A18 HX A8WGKG"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), - DMI_MATCH(DMI_PRODUCT_NAME, "Raider A18 HX A7VHG"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), - DMI_MATCH(DMI_PRODUCT_NAME, "Vector A16 HX A8WIG"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), - DMI_MATCH(DMI_PRODUCT_NAME, "Raider A18 HX A9WJG"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Alienware"), - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m15 R7 AMD"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Alienware"), - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m17 R5 AMD"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Alienware"), - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m18 R1 AMD"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "TIMI"), - DMI_MATCH(DMI_PRODUCT_NAME, "Redmi Book Pro 14 2022"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "TIMI"), - DMI_MATCH(DMI_PRODUCT_NAME, "Redmi Book Pro 15 2022"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "TIMI"), - DMI_MATCH(DMI_PRODUCT_NAME, "Xiaomi Book Pro 14 2022"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "TIMI"), - DMI_MATCH(DMI_PRODUCT_NAME, "Redmi G 2022"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Razer"), - DMI_MATCH(DMI_PRODUCT_NAME, "Blade 14 (2022) - RZ09-0427"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "RB"), - DMI_MATCH(DMI_PRODUCT_NAME, "Swift SFA16-41"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "RB"), - DMI_MATCH(DMI_PRODUCT_NAME, "Nitro AN515-46"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "IRBIS"), - DMI_MATCH(DMI_PRODUCT_NAME, "15NBC1011"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_MATCH(DMI_PRODUCT_NAME, "ASUS EXPERTBOOK PM1503CDA"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), - DMI_MATCH(DMI_PRODUCT_NAME, "OMEN by HP Gaming Laptop 16z-n000"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), - DMI_MATCH(DMI_PRODUCT_NAME, "Victus by HP Gaming Laptop 15-fb1xxx"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), - DMI_MATCH(DMI_PRODUCT_NAME, "Victus by HP Gaming Laptop 15-fb2xxx"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), - DMI_MATCH(DMI_BOARD_NAME, "8A42"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), - DMI_MATCH(DMI_BOARD_NAME, "8A43"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), - DMI_MATCH(DMI_BOARD_NAME, "8A44"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), - DMI_MATCH(DMI_BOARD_NAME, "8A22"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), - DMI_MATCH(DMI_BOARD_NAME, "8D22"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), - DMI_MATCH(DMI_BOARD_NAME, "8A3E"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), - DMI_MATCH(DMI_BOARD_NAME, "8A7F"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), - DMI_MATCH(DMI_BOARD_NAME, "8A81"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), - DMI_MATCH(DMI_BOARD_NAME, "8B27"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), - DMI_MATCH(DMI_BOARD_NAME, "8B2F"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), - DMI_MATCH(DMI_BOARD_NAME, "8BD6"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), - DMI_MATCH(DMI_BOARD_NAME, "8DC2"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), - DMI_MATCH(DMI_BOARD_NAME, "8EE3"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), - DMI_MATCH(DMI_BOARD_NAME, "8EE4"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), - DMI_MATCH(DMI_BOARD_NAME, "8E35"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), - DMI_MATCH(DMI_BOARD_NAME, "8F06"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), - DMI_MATCH(DMI_PRODUCT_NAME, "Victus by HP Laptop 16-e1xxx"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "MECHREVO"), - DMI_MATCH(DMI_BOARD_NAME, "MRID6"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "MDC"), - DMI_MATCH(DMI_BOARD_NAME, "Herbag_MDU"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "MDC"), - DMI_MATCH(DMI_BOARD_NAME, "Herbag2_MDU"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "System76"), - DMI_MATCH(DMI_PRODUCT_VERSION, "pang12"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "System76"), - DMI_MATCH(DMI_PRODUCT_VERSION, "pang13"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), - DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 15 C7UCX"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "HONOR"), - DMI_MATCH(DMI_PRODUCT_NAME, "GOH-X"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "RB"), - DMI_MATCH(DMI_BOARD_NAME, "XyloD5_RBU"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_MATCH(DMI_PRODUCT_NAME, "Vivobook_ASUSLaptop M6501RR_M6501RR"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_MATCH(DMI_PRODUCT_NAME, "ASUS EXPERTBOOK BM1503CDA"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_MATCH(DMI_BOARD_NAME, "PM1503CDA"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_MATCH(DMI_BOARD_NAME, "BM1403CDA"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), - DMI_MATCH(DMI_PRODUCT_NAME, "Thin A15 B7VF"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), - DMI_MATCH(DMI_PRODUCT_NAME, "Thin A15 B7VE"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), - DMI_MATCH(DMI_PRODUCT_NAME, "Thin A15 B7UC"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_MATCH(DMI_PRODUCT_NAME, "M7601RM"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), - DMI_MATCH(DMI_BOARD_NAME, "MS-17LN"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_MATCH(DMI_BOARD_NAME, "PM1403CDA"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_MATCH(DMI_PRODUCT_NAME, "Vivobook_ASUSLaptop M6500RE_M6500RE"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "XIAOMI"), - DMI_MATCH(DMI_BOARD_NAME, "TM2423"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "XIAOMI"), - DMI_MATCH(DMI_BOARD_NAME, "TM2422"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), - DMI_MATCH(DMI_PRODUCT_NAME, "HP 255R 15.6 inch G10 Notebook PC"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), - DMI_MATCH(DMI_PRODUCT_NAME, "TUF Gaming A16 FA607NUQ"), - } - }, - { - .driver_data = &acp6x_card, - .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "GIGABYTE"), - DMI_MATCH(DMI_PRODUCT_NAME, "GIGABYTE EAGLE 9MJ"), - } - }, - {} -}; static int acp6x_probe(struct platform_device *pdev) { - const struct dmi_system_id *dmi_id; - struct snd_soc_card *card; - struct acpi_device *adev; - acpi_handle handle; - acpi_integer dmic_status; + struct pci_dev *pci = to_pci_dev(pdev->dev.parent); + struct snd_soc_card *card = &acp6x_card; int ret; - bool is_dmic_enable, wov_en; - - /* IF WOV entry not found, enable dmic based on AcpDmicConnected entry*/ - is_dmic_enable = false; - wov_en = true; - /* check the parent device's firmware node has _DSD or not */ - adev = ACPI_COMPANION(pdev->dev.parent); - if (adev) { - const union acpi_object *obj; - - if (!acpi_dev_get_property(adev, "AcpDmicConnected", ACPI_TYPE_INTEGER, &obj) && - obj->integer.value == 1) - is_dmic_enable = true; - } - - handle = ACPI_HANDLE(pdev->dev.parent); - ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status); - if (!ACPI_FAILURE(ret)) { - wov_en = dmic_status; - if (!wov_en) - goto check_dmi_entry; - } else { - /* Incase of ACPI method read failure then jump to check_dmi_entry */ - goto check_dmi_entry; - } - if (is_dmic_enable) - platform_set_drvdata(pdev, &acp6x_card); - -check_dmi_entry: - /* check for any DMI overrides */ - dmi_id = dmi_first_match(yc_acp_quirk_table); - if (dmi_id) - platform_set_drvdata(pdev, dmi_id->driver_data); - - card = platform_get_drvdata(pdev); - if (!card) + if (!snd_acp6x_platform_has_dmic(pci)) return -ENODEV; - dev_info(&pdev->dev, "Enabling ACP DMIC support via %s", dmi_id ? "DMI" : "ACPI"); + + platform_set_drvdata(pdev, card); + dev_info(&pdev->dev, "Enabling ACP DMIC support\n"); acp6x_card.dev = &pdev->dev; ret = devm_snd_soc_register_card(&pdev->dev, card); - if (ret) { + if (ret) return dev_err_probe(&pdev->dev, ret, - "snd_soc_register_card(%s) failed\n", - card->name); - } + "snd_soc_register_card(%s) failed\n", + card->name); + return 0; } diff --git a/sound/soc/amd/yc/acp6x-quirks.c b/sound/soc/amd/yc/acp6x-quirks.c new file mode 100644 index 000000000000..9c551af43ad7 --- /dev/null +++ b/sound/soc/amd/yc/acp6x-quirks.c @@ -0,0 +1,884 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * AMD Yellow Carp (ACP6x) platform quirks. + * + * The ACP block shares the audio clock domain with the HDA controller, so it + * must only be initialized on boards that actually use its DMIC path. That + * cannot be derived from firmware alone: some boards ship a template _WOV + * method that unconditionally returns 1, and others describe nothing at all. + * The boards that are known to wire the DMIC are listed below. + * + * The object is linked into snd-pci-acp6x, which owns the device and makes + * the decision; the machine driver receives the result through platform data. + */ + +#include <linux/acpi.h> +#include <linux/dmi.h> +#include <linux/pci.h> + +#include "acp6x.h" + +static const struct dmi_system_id yc_acp_quirk_table[] = { + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire AG14-22P"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Lecoo"), + DMI_MATCH(DMI_PRODUCT_NAME, "Bellator N176"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), + DMI_MATCH(DMI_PRODUCT_NAME, "HP Laptop 15-fc0xxx"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), + DMI_MATCH(DMI_PRODUCT_NAME, "OMEN Gaming Laptop 16-ap0xxx"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Dell Inc."), + DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5525"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21D0"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21D1"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21D2"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21D3"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21D4"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21D5"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21CF"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21CG"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21CQ"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21CR"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21CM"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21CN"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21CH"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21CJ"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21CK"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21CL"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21EF"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21EM"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21EN"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21HY"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21J0"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21J5"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21J6"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21JN"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21M1"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21M3"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21M4"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21M5"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21M6"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "21ME"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "82QF"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "82TL"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "82UG"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "82UU"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "82V2"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "82YM"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "83AS"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "83BS"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "83HN"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "83L3"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "83N6"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "83Q2"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "83Q3"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "83UU"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "84CS"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "83VD"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "RB"), + DMI_MATCH(DMI_PRODUCT_NAME, "Nitro ANV15-41"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "RB"), + DMI_MATCH(DMI_PRODUCT_NAME, "Nitro AN16-41"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "RB"), + DMI_MATCH(DMI_PRODUCT_NAME, "Nitro AN17-41"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "83J2"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "83J3"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "UM5302TA"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "M5402RA"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "M5602RA"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "M6400RC"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "M3402RA"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "M6500RC"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "M6500RE"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "M6501RM"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "E1404FA"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "E1504FA"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "M7600RE"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "M3502RA"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), + DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 15 B7ED"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), + DMI_MATCH(DMI_PRODUCT_NAME, "Crosshair A17 HX D8WFKG"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), + DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 15 C7VE"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), + DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 15 C7VF"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), + DMI_MATCH(DMI_PRODUCT_NAME, "Alpha 17 C7VF"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), + DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 17 D7VEK"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), + DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 17 D7VF"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), + DMI_MATCH(DMI_PRODUCT_NAME, "Vector A16 HX A8WHG"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), + DMI_MATCH(DMI_PRODUCT_NAME, "Crosshair A16 HX D7WFKG"), + } + }, + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International Co., Ltd."), + DMI_MATCH(DMI_PRODUCT_NAME, "Crosshair A16 HX D8WGKG"), + } + }, + { + .matches = { + DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), + DMI_EXACT_MATCH(DMI_BOARD_NAME, "MS-184L"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Crosshair A18 HX A8WGKG"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), + DMI_MATCH(DMI_PRODUCT_NAME, "Raider A18 HX A7VHG"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), + DMI_MATCH(DMI_PRODUCT_NAME, "Vector A16 HX A8WIG"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), + DMI_MATCH(DMI_PRODUCT_NAME, "Raider A18 HX A9WJG"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Alienware"), + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m15 R7 AMD"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Alienware"), + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m17 R5 AMD"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Alienware"), + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m18 R1 AMD"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "TIMI"), + DMI_MATCH(DMI_PRODUCT_NAME, "Redmi Book Pro 14 2022"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "TIMI"), + DMI_MATCH(DMI_PRODUCT_NAME, "Redmi Book Pro 15 2022"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "TIMI"), + DMI_MATCH(DMI_PRODUCT_NAME, "Xiaomi Book Pro 14 2022"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "TIMI"), + DMI_MATCH(DMI_PRODUCT_NAME, "Redmi G 2022"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Razer"), + DMI_MATCH(DMI_PRODUCT_NAME, "Blade 14 (2022) - RZ09-0427"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "RB"), + DMI_MATCH(DMI_PRODUCT_NAME, "Swift SFA16-41"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "RB"), + DMI_MATCH(DMI_PRODUCT_NAME, "Nitro AN515-46"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "IRBIS"), + DMI_MATCH(DMI_PRODUCT_NAME, "15NBC1011"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "ASUS EXPERTBOOK PM1503CDA"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), + DMI_MATCH(DMI_PRODUCT_NAME, "OMEN by HP Gaming Laptop 16z-n000"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), + DMI_MATCH(DMI_PRODUCT_NAME, "Victus by HP Gaming Laptop 15-fb1xxx"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), + DMI_MATCH(DMI_PRODUCT_NAME, "Victus by HP Gaming Laptop 15-fb2xxx"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), + DMI_MATCH(DMI_BOARD_NAME, "8A42"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), + DMI_MATCH(DMI_BOARD_NAME, "8A43"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), + DMI_MATCH(DMI_BOARD_NAME, "8A44"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), + DMI_MATCH(DMI_BOARD_NAME, "8A22"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), + DMI_MATCH(DMI_BOARD_NAME, "8D22"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), + DMI_MATCH(DMI_BOARD_NAME, "8A3E"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), + DMI_MATCH(DMI_BOARD_NAME, "8A7F"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), + DMI_MATCH(DMI_BOARD_NAME, "8A81"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), + DMI_MATCH(DMI_BOARD_NAME, "8B27"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), + DMI_MATCH(DMI_BOARD_NAME, "8B2F"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), + DMI_MATCH(DMI_BOARD_NAME, "8BD6"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), + DMI_MATCH(DMI_BOARD_NAME, "8DC2"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), + DMI_MATCH(DMI_BOARD_NAME, "8EE3"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), + DMI_MATCH(DMI_BOARD_NAME, "8EE4"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), + DMI_MATCH(DMI_BOARD_NAME, "8E35"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), + DMI_MATCH(DMI_BOARD_NAME, "8F06"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), + DMI_MATCH(DMI_PRODUCT_NAME, "Victus by HP Laptop 16-e1xxx"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "MECHREVO"), + DMI_MATCH(DMI_BOARD_NAME, "MRID6"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "MDC"), + DMI_MATCH(DMI_BOARD_NAME, "Herbag_MDU"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "MDC"), + DMI_MATCH(DMI_BOARD_NAME, "Herbag2_MDU"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "System76"), + DMI_MATCH(DMI_PRODUCT_VERSION, "pang12"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "System76"), + DMI_MATCH(DMI_PRODUCT_VERSION, "pang13"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), + DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 15 C7UCX"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "HONOR"), + DMI_MATCH(DMI_PRODUCT_NAME, "GOH-X"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "RB"), + DMI_MATCH(DMI_BOARD_NAME, "XyloD5_RBU"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "Vivobook_ASUSLaptop M6501RR_M6501RR"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "ASUS EXPERTBOOK BM1503CDA"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_BOARD_NAME, "PM1503CDA"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_BOARD_NAME, "BM1403CDA"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), + DMI_MATCH(DMI_PRODUCT_NAME, "Thin A15 B7VF"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), + DMI_MATCH(DMI_PRODUCT_NAME, "Thin A15 B7VE"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), + DMI_MATCH(DMI_PRODUCT_NAME, "Thin A15 B7UC"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "M7601RM"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), + DMI_MATCH(DMI_BOARD_NAME, "MS-17LN"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_BOARD_NAME, "PM1403CDA"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "Vivobook_ASUSLaptop M6500RE_M6500RE"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "XIAOMI"), + DMI_MATCH(DMI_BOARD_NAME, "TM2423"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "XIAOMI"), + DMI_MATCH(DMI_BOARD_NAME, "TM2422"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), + DMI_MATCH(DMI_PRODUCT_NAME, "HP 255R 15.6 inch G10 Notebook PC"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), + DMI_MATCH(DMI_PRODUCT_NAME, "TUF Gaming A16 FA607NUQ"), + } + }, + { + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "GIGABYTE"), + DMI_MATCH(DMI_PRODUCT_NAME, "GIGABYTE EAGLE 9MJ"), + } + }, + {} +}; + +/** + * snd_acp6x_platform_has_dmic - Check whether the platform uses the ACP DMIC. + * @pci: the ACP PCI function. + * + * Firmware is only trusted for a positive verdict: _WOV that evaluates to + * zero, a missing method or a failed evaluation all fall back to the board + * list, while the AcpDmicConnected property can enable the path on its own. + * Anything else means "no consumer", and the caller must leave the block + * untouched. + * + * Return: true if the ACP DMIC path is wired on this platform. + */ +bool snd_acp6x_platform_has_dmic(struct pci_dev *pci) +{ + struct acpi_device *adev = ACPI_COMPANION(&pci->dev); + const union acpi_object *obj; + acpi_integer wov; + + if (!ACPI_HANDLE(&pci->dev) || + acpi_evaluate_integer(ACPI_HANDLE(&pci->dev), "_WOV", NULL, &wov) || + !wov) + return !!dmi_first_match(yc_acp_quirk_table); + + if (adev && !acpi_dev_get_property(adev, "AcpDmicConnected", + ACPI_TYPE_INTEGER, &obj) && + obj->integer.value == 1) + return true; + + return !!dmi_first_match(yc_acp_quirk_table); +} +EXPORT_SYMBOL_GPL(snd_acp6x_platform_has_dmic); diff --git a/sound/soc/amd/yc/acp6x.h b/sound/soc/amd/yc/acp6x.h index 2de7d1edf00b..ae022bfaf7d7 100644 --- a/sound/soc/amd/yc/acp6x.h +++ b/sound/soc/amd/yc/acp6x.h @@ -107,4 +107,5 @@ static inline void acp6x_writel(u32 val, void __iomem *base_addr) } int snd_amd_acp_find_config(struct pci_dev *pci); +bool snd_acp6x_platform_has_dmic(struct pci_dev *pci); -- 2.56.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v4 2/5] ASoC: amd: yc: share the ACP6x DMIC board list 2026-12-03 18:30 ` [PATCH v4 2/5] ASoC: amd: yc: share the ACP6x DMIC board list MuXian Chen @ 2026-12-04 6:07 ` Mukunda,Vijendar 2026-12-05 13:36 ` MuXian Chen 0 siblings, 1 reply; 9+ messages in thread From: Mukunda,Vijendar @ 2026-12-04 6:07 UTC (permalink / raw) To: MuXian Chen, Venkata Prasad Potturu, Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai Cc: linux-sound, linux-kernel, Mario Limonciello On 12/4/26 00:00, MuXian Chen wrote: > [You don't often get email from a18165943161@gmail.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] > > The board list in acp6x-mach.c is the only reliable indication that a > platform actually wires the ACP DMIC path; firmware is not usable for > that (some boards ship a _WOV template that unconditionally returns 1). > > Move it to a separate source file linked into snd-pci-acp6x and expose > snd_acp6x_platform_has_dmic(), which folds in the _WOV and > AcpDmicConnected checks with the same precedence the machine driver > used. The machine driver now calls the helper instead of carrying its > own copy of the decision logic. > > No functional change. > > Signed-off-by: MuXian Chen <a18165943161@gmail.com> > --- > sound/soc/amd/yc/Makefile | 2 +- > sound/soc/amd/yc/acp6x-mach.c | 1029 +------------------------------ > sound/soc/amd/yc/acp6x-quirks.c | 884 ++++++++++++++++++++++++++ > sound/soc/amd/yc/acp6x.h | 1 + > 4 files changed, 897 insertions(+), 1019 deletions(-) > create mode 100644 sound/soc/amd/yc/acp6x-quirks.c > > diff --git a/sound/soc/amd/yc/Makefile b/sound/soc/amd/yc/Makefile > index 7a0a3a410b2d..be8ffc7bf230 100644 > --- a/sound/soc/amd/yc/Makefile > +++ b/sound/soc/amd/yc/Makefile > @@ -1,6 +1,6 @@ > # SPDX-License-Identifier: GPL-2.0+ > # Yellow Carp platform Support > -snd-pci-acp6x-y := pci-acp6x.o > +snd-pci-acp6x-y := pci-acp6x.o acp6x-quirks.o acp6x-quirks.c carries the DMI board list and the ACPI _WOV / AcpDmicConnected policy logic. That is machine-driver territory: the correct place for it is snd-soc-acp6x-mach (acp6x-mach.c), where this logic lived before the patch. Linking it into snd-pci-acp6x creates a layering inversion: the low-level PCI hardware driver now contains board-level policy that the machine driver then queries via a cross-module export. The PCI driver should expose hardware capabilities; decisions about which boards wire the DMIC path belong in the machine driver that makes the registration decision. Move acp6x-quirks.c into snd-soc-acp6x-mach instead, and keep snd_acp6x_platform_has_dmic() as a file-local helper called directly from acp6x_probe(), removing the need for EXPORT_SYMBOL_GPL. > snd-acp6x-pdm-dma-y := acp6x-pdm-dma.o > snd-soc-acp6x-mach-y := acp6x-mach.o > > diff --git a/sound/soc/amd/yc/acp6x-mach.c b/sound/soc/amd/yc/acp6x-mach.c > index 505d481173ce..d5dca8bc36ba 100644 > --- a/sound/soc/amd/yc/acp6x-mach.c > +++ b/sound/soc/amd/yc/acp6x-mach.c > @@ -11,8 +11,7 @@ > #include <sound/pcm.h> > #include <sound/pcm_params.h> > #include <linux/io.h> > -#include <linux/dmi.h> > -#include <linux/acpi.h> > +#include <linux/pci.h> > > #include "acp6x.h" > > @@ -44,1032 +43,26 @@ static struct snd_soc_card acp6x_card = { > .num_links = 1, > }; > > -static const struct dmi_system_id yc_acp_quirk_table[] = { > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), > - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire AG14-22P"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "Lecoo"), > - DMI_MATCH(DMI_PRODUCT_NAME, "Bellator N176"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > - DMI_MATCH(DMI_PRODUCT_NAME, "HP Laptop 15-fc0xxx"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > - DMI_MATCH(DMI_PRODUCT_NAME, "OMEN Gaming Laptop 16-ap0xxx"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "Dell Inc."), > - DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5525"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21D0"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21D1"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21D2"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21D3"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21D4"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21D5"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21CF"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21CG"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21CQ"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21CR"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21CM"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21CN"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21CH"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21CJ"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21CK"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21CL"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21EF"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21EM"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21EN"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21HY"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21J0"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21J5"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21J6"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21JN"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21M1"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21M3"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21M4"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21M5"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21M6"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "21ME"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "82QF"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "82TL"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "82UG"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "82UU"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "82V2"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "82YM"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "83AS"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "83BS"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "83HN"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "83L3"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "83N6"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "83Q2"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "83Q3"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "83UU"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "84CS"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "83VD"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "RB"), > - DMI_MATCH(DMI_PRODUCT_NAME, "Nitro ANV15-41"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "RB"), > - DMI_MATCH(DMI_PRODUCT_NAME, "Nitro AN16-41"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "RB"), > - DMI_MATCH(DMI_PRODUCT_NAME, "Nitro AN17-41"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "83J2"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > - DMI_MATCH(DMI_PRODUCT_NAME, "83J3"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > - DMI_MATCH(DMI_PRODUCT_NAME, "UM5302TA"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > - DMI_MATCH(DMI_PRODUCT_NAME, "M5402RA"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > - DMI_MATCH(DMI_PRODUCT_NAME, "M5602RA"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > - DMI_MATCH(DMI_PRODUCT_NAME, "M6400RC"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > - DMI_MATCH(DMI_PRODUCT_NAME, "M3402RA"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > - DMI_MATCH(DMI_PRODUCT_NAME, "M6500RC"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > - DMI_MATCH(DMI_PRODUCT_NAME, "M6500RE"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > - DMI_MATCH(DMI_PRODUCT_NAME, "M6501RM"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > - DMI_MATCH(DMI_PRODUCT_NAME, "E1404FA"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > - DMI_MATCH(DMI_PRODUCT_NAME, "E1504FA"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > - DMI_MATCH(DMI_PRODUCT_NAME, "M7600RE"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > - DMI_MATCH(DMI_PRODUCT_NAME, "M3502RA"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > - DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 15 B7ED"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > - DMI_MATCH(DMI_PRODUCT_NAME, "Crosshair A17 HX D8WFKG"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > - DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 15 C7VE"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > - DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 15 C7VF"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > - DMI_MATCH(DMI_PRODUCT_NAME, "Alpha 17 C7VF"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > - DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 17 D7VEK"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > - DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 17 D7VF"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > - DMI_MATCH(DMI_PRODUCT_NAME, "Vector A16 HX A8WHG"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > - DMI_MATCH(DMI_PRODUCT_NAME, "Crosshair A16 HX D7WFKG"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International Co., Ltd."), > - DMI_MATCH(DMI_PRODUCT_NAME, "Crosshair A16 HX D8WGKG"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > - DMI_EXACT_MATCH(DMI_BOARD_NAME, "MS-184L"), > - DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Crosshair A18 HX A8WGKG"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > - DMI_MATCH(DMI_PRODUCT_NAME, "Raider A18 HX A7VHG"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > - DMI_MATCH(DMI_PRODUCT_NAME, "Vector A16 HX A8WIG"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > - DMI_MATCH(DMI_PRODUCT_NAME, "Raider A18 HX A9WJG"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "Alienware"), > - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m15 R7 AMD"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "Alienware"), > - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m17 R5 AMD"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "Alienware"), > - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m18 R1 AMD"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "TIMI"), > - DMI_MATCH(DMI_PRODUCT_NAME, "Redmi Book Pro 14 2022"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "TIMI"), > - DMI_MATCH(DMI_PRODUCT_NAME, "Redmi Book Pro 15 2022"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "TIMI"), > - DMI_MATCH(DMI_PRODUCT_NAME, "Xiaomi Book Pro 14 2022"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "TIMI"), > - DMI_MATCH(DMI_PRODUCT_NAME, "Redmi G 2022"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "Razer"), > - DMI_MATCH(DMI_PRODUCT_NAME, "Blade 14 (2022) - RZ09-0427"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "RB"), > - DMI_MATCH(DMI_PRODUCT_NAME, "Swift SFA16-41"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "RB"), > - DMI_MATCH(DMI_PRODUCT_NAME, "Nitro AN515-46"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "IRBIS"), > - DMI_MATCH(DMI_PRODUCT_NAME, "15NBC1011"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > - DMI_MATCH(DMI_PRODUCT_NAME, "ASUS EXPERTBOOK PM1503CDA"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > - DMI_MATCH(DMI_PRODUCT_NAME, "OMEN by HP Gaming Laptop 16z-n000"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > - DMI_MATCH(DMI_PRODUCT_NAME, "Victus by HP Gaming Laptop 15-fb1xxx"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > - DMI_MATCH(DMI_PRODUCT_NAME, "Victus by HP Gaming Laptop 15-fb2xxx"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > - DMI_MATCH(DMI_BOARD_NAME, "8A42"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > - DMI_MATCH(DMI_BOARD_NAME, "8A43"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > - DMI_MATCH(DMI_BOARD_NAME, "8A44"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > - DMI_MATCH(DMI_BOARD_NAME, "8A22"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > - DMI_MATCH(DMI_BOARD_NAME, "8D22"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > - DMI_MATCH(DMI_BOARD_NAME, "8A3E"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > - DMI_MATCH(DMI_BOARD_NAME, "8A7F"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > - DMI_MATCH(DMI_BOARD_NAME, "8A81"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > - DMI_MATCH(DMI_BOARD_NAME, "8B27"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > - DMI_MATCH(DMI_BOARD_NAME, "8B2F"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > - DMI_MATCH(DMI_BOARD_NAME, "8BD6"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > - DMI_MATCH(DMI_BOARD_NAME, "8DC2"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > - DMI_MATCH(DMI_BOARD_NAME, "8EE3"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > - DMI_MATCH(DMI_BOARD_NAME, "8EE4"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > - DMI_MATCH(DMI_BOARD_NAME, "8E35"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > - DMI_MATCH(DMI_BOARD_NAME, "8F06"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > - DMI_MATCH(DMI_PRODUCT_NAME, "Victus by HP Laptop 16-e1xxx"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "MECHREVO"), > - DMI_MATCH(DMI_BOARD_NAME, "MRID6"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "MDC"), > - DMI_MATCH(DMI_BOARD_NAME, "Herbag_MDU"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "MDC"), > - DMI_MATCH(DMI_BOARD_NAME, "Herbag2_MDU"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "System76"), > - DMI_MATCH(DMI_PRODUCT_VERSION, "pang12"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "System76"), > - DMI_MATCH(DMI_PRODUCT_VERSION, "pang13"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > - DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 15 C7UCX"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "HONOR"), > - DMI_MATCH(DMI_PRODUCT_NAME, "GOH-X"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "RB"), > - DMI_MATCH(DMI_BOARD_NAME, "XyloD5_RBU"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > - DMI_MATCH(DMI_PRODUCT_NAME, "Vivobook_ASUSLaptop M6501RR_M6501RR"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > - DMI_MATCH(DMI_PRODUCT_NAME, "ASUS EXPERTBOOK BM1503CDA"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > - DMI_MATCH(DMI_BOARD_NAME, "PM1503CDA"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > - DMI_MATCH(DMI_BOARD_NAME, "BM1403CDA"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > - DMI_MATCH(DMI_PRODUCT_NAME, "Thin A15 B7VF"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > - DMI_MATCH(DMI_PRODUCT_NAME, "Thin A15 B7VE"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > - DMI_MATCH(DMI_PRODUCT_NAME, "Thin A15 B7UC"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > - DMI_MATCH(DMI_PRODUCT_NAME, "M7601RM"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > - DMI_MATCH(DMI_BOARD_NAME, "MS-17LN"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > - DMI_MATCH(DMI_BOARD_NAME, "PM1403CDA"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > - DMI_MATCH(DMI_PRODUCT_NAME, "Vivobook_ASUSLaptop M6500RE_M6500RE"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "XIAOMI"), > - DMI_MATCH(DMI_BOARD_NAME, "TM2423"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "XIAOMI"), > - DMI_MATCH(DMI_BOARD_NAME, "TM2422"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), > - DMI_MATCH(DMI_PRODUCT_NAME, "HP 255R 15.6 inch G10 Notebook PC"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > - DMI_MATCH(DMI_PRODUCT_NAME, "TUF Gaming A16 FA607NUQ"), > - } > - }, > - { > - .driver_data = &acp6x_card, > - .matches = { > - DMI_MATCH(DMI_BOARD_VENDOR, "GIGABYTE"), > - DMI_MATCH(DMI_PRODUCT_NAME, "GIGABYTE EAGLE 9MJ"), > - } > - }, > - {} > -}; > > static int acp6x_probe(struct platform_device *pdev) > { > - const struct dmi_system_id *dmi_id; > - struct snd_soc_card *card; > - struct acpi_device *adev; > - acpi_handle handle; > - acpi_integer dmic_status; > + struct pci_dev *pci = to_pci_dev(pdev->dev.parent); > + struct snd_soc_card *card = &acp6x_card; > int ret; > - bool is_dmic_enable, wov_en; > - > - /* IF WOV entry not found, enable dmic based on AcpDmicConnected entry*/ > - is_dmic_enable = false; > - wov_en = true; > - /* check the parent device's firmware node has _DSD or not */ > - adev = ACPI_COMPANION(pdev->dev.parent); > - if (adev) { > - const union acpi_object *obj; > - > - if (!acpi_dev_get_property(adev, "AcpDmicConnected", > ACPI_TYPE_INTEGER, &obj) && > - obj->integer.value == 1) > - is_dmic_enable = true; > - } > - > - handle = ACPI_HANDLE(pdev->dev.parent); > - ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status); > - if (!ACPI_FAILURE(ret)) { > - wov_en = dmic_status; > - if (!wov_en) > - goto check_dmi_entry; > - } else { > - /* Incase of ACPI method read failure then jump to check_dmi_entry */ > - goto check_dmi_entry; > - } > > - if (is_dmic_enable) > - platform_set_drvdata(pdev, &acp6x_card); > - > -check_dmi_entry: > - /* check for any DMI overrides */ > - dmi_id = dmi_first_match(yc_acp_quirk_table); > - if (dmi_id) > - platform_set_drvdata(pdev, dmi_id->driver_data); > - > - card = platform_get_drvdata(pdev); > - if (!card) > + if (!snd_acp6x_platform_has_dmic(pci)) > return -ENODEV; > - dev_info(&pdev->dev, "Enabling ACP DMIC support via %s", dmi_id ? > "DMI" : "ACPI"); > + > + platform_set_drvdata(pdev, card); > + dev_info(&pdev->dev, "Enabling ACP DMIC support\n"); > acp6x_card.dev = &pdev->dev; > > ret = devm_snd_soc_register_card(&pdev->dev, card); > - if (ret) { > + if (ret) > return dev_err_probe(&pdev->dev, ret, > - "snd_soc_register_card(%s) failed\n", > - card->name); > - } > + "snd_soc_register_card(%s) failed\n", > + card->name); > + > return 0; > } > > diff --git a/sound/soc/amd/yc/acp6x-quirks.c b/sound/soc/amd/yc/acp6x-quirks.c > new file mode 100644 > index 000000000000..9c551af43ad7 > --- /dev/null > +++ b/sound/soc/amd/yc/acp6x-quirks.c > @@ -0,0 +1,884 @@ > +// SPDX-License-Identifier: GPL-2.0+ > +/* > + * AMD Yellow Carp (ACP6x) platform quirks. > + * > + * The ACP block shares the audio clock domain with the HDA controller, so it > + * must only be initialized on boards that actually use its DMIC path. That > + * cannot be derived from firmware alone: some boards ship a template _WOV > + * method that unconditionally returns 1, and others describe nothing at all. > + * The boards that are known to wire the DMIC are listed below. > + * > + * The object is linked into snd-pci-acp6x, which owns the device and makes > + * the decision; the machine driver receives the result through platform data. > + */ > + > +#include <linux/acpi.h> > +#include <linux/dmi.h> > +#include <linux/pci.h> snd_acp6x_platform_has_dmic() takes a struct pci_dev *, so the machine driver must now include linux/pci.h and handle a PCI object it did not previously need. The original code used pdev->dev.parent (the platform device's parent, which is the PCI device) without ever including linux/pci.h or touching struct pci_dev directly. If the helper is moved back into the machine driver as suggested above, this include and the PCI type dependency disappear entirely. > + > +#include "acp6x.h" > + > +static const struct dmi_system_id yc_acp_quirk_table[] = { > + { > + .matches = { > + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), > + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire AG14-22P"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Lecoo"), > + DMI_MATCH(DMI_PRODUCT_NAME, "Bellator N176"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > + DMI_MATCH(DMI_PRODUCT_NAME, "HP Laptop 15-fc0xxx"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > + DMI_MATCH(DMI_PRODUCT_NAME, "OMEN Gaming Laptop 16-ap0xxx"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Dell Inc."), > + DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5525"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21D0"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21D1"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21D2"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21D3"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21D4"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21D5"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21CF"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21CG"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21CQ"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21CR"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21CM"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21CN"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21CH"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21CJ"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21CK"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21CL"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21EF"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21EM"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21EN"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21HY"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21J0"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21J5"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21J6"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21JN"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21M1"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21M3"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21M4"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21M5"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21M6"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "21ME"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "82QF"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "82TL"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "82UG"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "82UU"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "82V2"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "82YM"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "83AS"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "83BS"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "83HN"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "83L3"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "83N6"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "83Q2"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "83Q3"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "83UU"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "84CS"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "83VD"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "RB"), > + DMI_MATCH(DMI_PRODUCT_NAME, "Nitro ANV15-41"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "RB"), > + DMI_MATCH(DMI_PRODUCT_NAME, "Nitro AN16-41"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "RB"), > + DMI_MATCH(DMI_PRODUCT_NAME, "Nitro AN17-41"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "83J2"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), > + DMI_MATCH(DMI_PRODUCT_NAME, "83J3"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > + DMI_MATCH(DMI_PRODUCT_NAME, "UM5302TA"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > + DMI_MATCH(DMI_PRODUCT_NAME, "M5402RA"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > + DMI_MATCH(DMI_PRODUCT_NAME, "M5602RA"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > + DMI_MATCH(DMI_PRODUCT_NAME, "M6400RC"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > + DMI_MATCH(DMI_PRODUCT_NAME, "M3402RA"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > + DMI_MATCH(DMI_PRODUCT_NAME, "M6500RC"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > + DMI_MATCH(DMI_PRODUCT_NAME, "M6500RE"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > + DMI_MATCH(DMI_PRODUCT_NAME, "M6501RM"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > + DMI_MATCH(DMI_PRODUCT_NAME, "E1404FA"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > + DMI_MATCH(DMI_PRODUCT_NAME, "E1504FA"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > + DMI_MATCH(DMI_PRODUCT_NAME, "M7600RE"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > + DMI_MATCH(DMI_PRODUCT_NAME, "M3502RA"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > + DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 15 B7ED"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > + DMI_MATCH(DMI_PRODUCT_NAME, "Crosshair A17 HX D8WFKG"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > + DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 15 C7VE"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > + DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 15 C7VF"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > + DMI_MATCH(DMI_PRODUCT_NAME, "Alpha 17 C7VF"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > + DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 17 D7VEK"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > + DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 17 D7VF"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > + DMI_MATCH(DMI_PRODUCT_NAME, "Vector A16 HX A8WHG"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > + DMI_MATCH(DMI_PRODUCT_NAME, "Crosshair A16 HX D7WFKG"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International Co., Ltd."), > + DMI_MATCH(DMI_PRODUCT_NAME, "Crosshair A16 HX D8WGKG"), > + } > + }, > + { > + .matches = { > + DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > + DMI_EXACT_MATCH(DMI_BOARD_NAME, "MS-184L"), > + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Crosshair A18 HX A8WGKG"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > + DMI_MATCH(DMI_PRODUCT_NAME, "Raider A18 HX A7VHG"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > + DMI_MATCH(DMI_PRODUCT_NAME, "Vector A16 HX A8WIG"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > + DMI_MATCH(DMI_PRODUCT_NAME, "Raider A18 HX A9WJG"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Alienware"), > + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m15 R7 AMD"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Alienware"), > + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m17 R5 AMD"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Alienware"), > + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m18 R1 AMD"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "TIMI"), > + DMI_MATCH(DMI_PRODUCT_NAME, "Redmi Book Pro 14 2022"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "TIMI"), > + DMI_MATCH(DMI_PRODUCT_NAME, "Redmi Book Pro 15 2022"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "TIMI"), > + DMI_MATCH(DMI_PRODUCT_NAME, "Xiaomi Book Pro 14 2022"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "TIMI"), > + DMI_MATCH(DMI_PRODUCT_NAME, "Redmi G 2022"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Razer"), > + DMI_MATCH(DMI_PRODUCT_NAME, "Blade 14 (2022) - RZ09-0427"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "RB"), > + DMI_MATCH(DMI_PRODUCT_NAME, "Swift SFA16-41"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "RB"), > + DMI_MATCH(DMI_PRODUCT_NAME, "Nitro AN515-46"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "IRBIS"), > + DMI_MATCH(DMI_PRODUCT_NAME, "15NBC1011"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > + DMI_MATCH(DMI_PRODUCT_NAME, "ASUS EXPERTBOOK PM1503CDA"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > + DMI_MATCH(DMI_PRODUCT_NAME, "OMEN by HP Gaming Laptop 16z-n000"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > + DMI_MATCH(DMI_PRODUCT_NAME, "Victus by HP Gaming Laptop 15-fb1xxx"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > + DMI_MATCH(DMI_PRODUCT_NAME, "Victus by HP Gaming Laptop 15-fb2xxx"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > + DMI_MATCH(DMI_BOARD_NAME, "8A42"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > + DMI_MATCH(DMI_BOARD_NAME, "8A43"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > + DMI_MATCH(DMI_BOARD_NAME, "8A44"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > + DMI_MATCH(DMI_BOARD_NAME, "8A22"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > + DMI_MATCH(DMI_BOARD_NAME, "8D22"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > + DMI_MATCH(DMI_BOARD_NAME, "8A3E"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > + DMI_MATCH(DMI_BOARD_NAME, "8A7F"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > + DMI_MATCH(DMI_BOARD_NAME, "8A81"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > + DMI_MATCH(DMI_BOARD_NAME, "8B27"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > + DMI_MATCH(DMI_BOARD_NAME, "8B2F"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > + DMI_MATCH(DMI_BOARD_NAME, "8BD6"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > + DMI_MATCH(DMI_BOARD_NAME, "8DC2"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > + DMI_MATCH(DMI_BOARD_NAME, "8EE3"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > + DMI_MATCH(DMI_BOARD_NAME, "8EE4"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > + DMI_MATCH(DMI_BOARD_NAME, "8E35"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > + DMI_MATCH(DMI_BOARD_NAME, "8F06"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), > + DMI_MATCH(DMI_PRODUCT_NAME, "Victus by HP Laptop 16-e1xxx"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "MECHREVO"), > + DMI_MATCH(DMI_BOARD_NAME, "MRID6"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "MDC"), > + DMI_MATCH(DMI_BOARD_NAME, "Herbag_MDU"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "MDC"), > + DMI_MATCH(DMI_BOARD_NAME, "Herbag2_MDU"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "System76"), > + DMI_MATCH(DMI_PRODUCT_VERSION, "pang12"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "System76"), > + DMI_MATCH(DMI_PRODUCT_VERSION, "pang13"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > + DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 15 C7UCX"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "HONOR"), > + DMI_MATCH(DMI_PRODUCT_NAME, "GOH-X"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "RB"), > + DMI_MATCH(DMI_BOARD_NAME, "XyloD5_RBU"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > + DMI_MATCH(DMI_PRODUCT_NAME, "Vivobook_ASUSLaptop M6501RR_M6501RR"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > + DMI_MATCH(DMI_PRODUCT_NAME, "ASUS EXPERTBOOK BM1503CDA"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > + DMI_MATCH(DMI_BOARD_NAME, "PM1503CDA"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > + DMI_MATCH(DMI_BOARD_NAME, "BM1403CDA"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > + DMI_MATCH(DMI_PRODUCT_NAME, "Thin A15 B7VF"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > + DMI_MATCH(DMI_PRODUCT_NAME, "Thin A15 B7VE"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > + DMI_MATCH(DMI_PRODUCT_NAME, "Thin A15 B7UC"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > + DMI_MATCH(DMI_PRODUCT_NAME, "M7601RM"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), > + DMI_MATCH(DMI_BOARD_NAME, "MS-17LN"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > + DMI_MATCH(DMI_BOARD_NAME, "PM1403CDA"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > + DMI_MATCH(DMI_PRODUCT_NAME, "Vivobook_ASUSLaptop M6500RE_M6500RE"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "XIAOMI"), > + DMI_MATCH(DMI_BOARD_NAME, "TM2423"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "XIAOMI"), > + DMI_MATCH(DMI_BOARD_NAME, "TM2422"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), > + DMI_MATCH(DMI_PRODUCT_NAME, "HP 255R 15.6 inch G10 Notebook PC"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), > + DMI_MATCH(DMI_PRODUCT_NAME, "TUF Gaming A16 FA607NUQ"), > + } > + }, > + { > + .matches = { > + DMI_MATCH(DMI_BOARD_VENDOR, "GIGABYTE"), > + DMI_MATCH(DMI_PRODUCT_NAME, "GIGABYTE EAGLE 9MJ"), > + } > + }, > + {} > +}; > + > +/** > + * snd_acp6x_platform_has_dmic - Check whether the platform uses the ACP DMIC. > + * @pci: the ACP PCI function. > + * > + * Firmware is only trusted for a positive verdict: _WOV that evaluates to > + * zero, a missing method or a failed evaluation all fall back to the board > + * list, while the AcpDmicConnected property can enable the path on its own. > + * Anything else means "no consumer", and the caller must leave the block > + * untouched. > + * > + * Return: true if the ACP DMIC path is wired on this platform. > + */ > +bool snd_acp6x_platform_has_dmic(struct pci_dev *pci) > +{ > + struct acpi_device *adev = ACPI_COMPANION(&pci->dev); > + const union acpi_object *obj; > + acpi_integer wov; > + > + if (!ACPI_HANDLE(&pci->dev) || > + acpi_evaluate_integer(ACPI_HANDLE(&pci->dev), "_WOV", NULL, &wov) || > + !wov) The original acp6x_probe() treats _WOV == 0 as a hard negative verdict: wov_en = dmic_status; /* dmic_status = 0 */ if (!wov_en) return -ENODEV; /* returns before check_dmi_entry */ The DMI table is never consulted when _WOV evaluates to zero; the driver exits immediately. This is intentional: _WOV returning 0 means the firmware explicitly reports no WOV/DMIC capability. The new code conflates _WOV == 0 with _WOV evaluation failure: if (!ACPI_HANDLE(...) || acpi_evaluate_integer(...) || !wov) return !!dmi_first_match(yc_acp_quirk_table); When _WOV == 0 the new code falls through to a DMI lookup, which can return true. A board with _WOV == 0 that also appears in the DMI table will now get DMIC enabled, whereas before it was hard-disabled. This is a functional change and contradicts the "No functional change" claim in the commit message. Split the conditions so that _WOV == 0 retains the hard-negative behaviour: if (!ACPI_HANDLE(&pci->dev) || acpi_evaluate_integer(ACPI_HANDLE(&pci->dev), "_WOV", NULL, &wov)) return !!dmi_first_match(yc_acp_quirk_table); if (!wov) return false; /* _WOV explicitly says no DMIC */ > + return !!dmi_first_match(yc_acp_quirk_table); > + > + if (adev && !acpi_dev_get_property(adev, "AcpDmicConnected", > + ACPI_TYPE_INTEGER, &obj) && > + obj->integer.value == 1) > + return true; > + > + return !!dmi_first_match(yc_acp_quirk_table); dmi_first_match(yc_acp_quirk_table) is called twice. Hoist it to the top of the function: bool dmi_has_dmic = !!dmi_first_match(yc_acp_quirk_table); and return dmi_has_dmic at both fallback sites. The table walk runs once instead of potentially twice. > +} > +EXPORT_SYMBOL_GPL(snd_acp6x_platform_has_dmic); > diff --git a/sound/soc/amd/yc/acp6x.h b/sound/soc/amd/yc/acp6x.h > index 2de7d1edf00b..ae022bfaf7d7 100644 > --- a/sound/soc/amd/yc/acp6x.h > +++ b/sound/soc/amd/yc/acp6x.h > @@ -107,4 +107,5 @@ static inline void acp6x_writel(u32 val, void > __iomem *base_addr) > } > > int snd_amd_acp_find_config(struct pci_dev *pci); > +bool snd_acp6x_platform_has_dmic(struct pci_dev *pci); > > -- > 2.56.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v4 2/5] ASoC: amd: yc: share the ACP6x DMIC board list 2026-12-04 6:07 ` Mukunda,Vijendar @ 2026-12-05 13:36 ` MuXian Chen 0 siblings, 0 replies; 9+ messages in thread From: MuXian Chen @ 2026-12-05 13:36 UTC (permalink / raw) To: Vijendar Mukunda Cc: linux-sound, linux-kernel, Mark Brown, Liam Girdwood, Mario Limonciello, Venkata Prasad Potturu Hi Vijendar, Thanks for the careful review. Let me explain why the check has to happen before the PCI driver binds, because that is the part that makes the placement look wrong. acp6x_init() is not a passive step: it powers the block up, takes it out of reset and selects the audio clock (ACP_CLKMUX_SEL = 3). The damage to HDA happens on the other end, when acp6x_deinit() runs from the runtime suspend path and gates that same clock (ACP_CLKMUX_SEL = 0). That is the CORB timeout described in the cover letter. The machine driver probes only after snd_acp6x_probe() has created the platform devices, which is after acp6x_init(). A check placed in acp6x_probe() would therefore run after the hardware has already been touched, and returning -ENODEV there cannot undo it: the block stays initialized and the next runtime suspend gates the shared clock anyway. The bind decision is the only point where not touching the hardware at all is still an option. That is also why the table lives next to the device rather than next to the card registration: it answers "does this board wire the DMIC path", which is a platform property of the PCI function, not a decision about which card to build. Note that the final state of the series does not export anything: patch 3 evaluates the predicate once in snd_acp6x_probe() and passes a bool to the machine device through platform data, so there is no cross-module export left and the machine driver does not query the PCI driver at all. If you would still prefer the policy to live in the machine driver, the alternative is to keep the PCI driver from initializing until the machine driver asks for it - a small power-up callback invoked from acp6x_probe() once the board list matches. That is a larger change (init timing, error paths, PDM DMA dependency) and I would rather not fold it into this series unless you think it is required. Thanks, MuXian ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v4 3/5] ASoC: amd: yc: ask the firmware once about the ACP DMIC path 2026-12-03 18:30 [PATCH v4 0/5] ASoC: amd: yc: do not bind the ACP when no DMIC is wired MuXian Chen 2026-12-03 18:30 ` [PATCH v4 1/5] ASoC: amd: yc: stop the shared IRQ before tearing down platform devices MuXian Chen 2026-12-03 18:30 ` [PATCH v4 2/5] ASoC: amd: yc: share the ACP6x DMIC board list MuXian Chen @ 2026-12-03 18:30 ` MuXian Chen 2026-12-03 18:30 ` [PATCH v4 4/5] ASoC: amd: yc: refuse the ACP function when no DMIC is wired MuXian Chen 2026-12-03 18:30 ` [PATCH v4 5/5] ASoC: amd: yc: allow forcing the ACP DMIC decision MuXian Chen 4 siblings, 0 replies; 9+ messages in thread From: MuXian Chen @ 2026-12-03 18:30 UTC (permalink / raw) To: Vijendar Mukunda, Venkata Prasad Potturu, Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai Cc: linux-sound, linux-kernel, Mario Limonciello The machine driver used to evaluate _WOV on its own, after the PCI driver had already initialized the block. Have the PCI driver run the check once during probe and hand the resulting flag to the machine device through platform data, following the convention used by the other ACP platform drivers. The machine driver now only reads the flag, so _WOV is evaluated once per boot and the two drivers cannot reach different conclusions. No functional change. Signed-off-by: MuXian Chen <a18165943161@gmail.com> --- sound/soc/amd/yc/acp6x-mach.c | 5 ++--- sound/soc/amd/yc/acp6x-quirks.c | 1 - sound/soc/amd/yc/pci-acp6x.c | 10 ++++++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/sound/soc/amd/yc/acp6x-mach.c b/sound/soc/amd/yc/acp6x-mach.c index d5dca8bc36ba..e8d1ab2eae2d 100644 --- a/sound/soc/amd/yc/acp6x-mach.c +++ b/sound/soc/amd/yc/acp6x-mach.c @@ -11,7 +11,6 @@ #include <sound/pcm.h> #include <sound/pcm_params.h> #include <linux/io.h> -#include <linux/pci.h> #include "acp6x.h" @@ -46,11 +45,11 @@ static struct snd_soc_card acp6x_card = { static int acp6x_probe(struct platform_device *pdev) { - struct pci_dev *pci = to_pci_dev(pdev->dev.parent); + const bool *dmic = pdev->dev.platform_data; struct snd_soc_card *card = &acp6x_card; int ret; - if (!snd_acp6x_platform_has_dmic(pci)) + if (!dmic || !*dmic) return -ENODEV; platform_set_drvdata(pdev, card); diff --git a/sound/soc/amd/yc/acp6x-quirks.c b/sound/soc/amd/yc/acp6x-quirks.c index 9c551af43ad7..4fabb38b0427 100644 --- a/sound/soc/amd/yc/acp6x-quirks.c +++ b/sound/soc/amd/yc/acp6x-quirks.c @@ -881,4 +881,3 @@ bool snd_acp6x_platform_has_dmic(struct pci_dev *pci) return !!dmi_first_match(yc_acp_quirk_table); } -EXPORT_SYMBOL_GPL(snd_acp6x_platform_has_dmic); diff --git a/sound/soc/amd/yc/pci-acp6x.c b/sound/soc/amd/yc/pci-acp6x.c index a961e38c25ef..c987f6c365af 100644 --- a/sound/soc/amd/yc/pci-acp6x.c +++ b/sound/soc/amd/yc/pci-acp6x.c @@ -20,6 +20,7 @@ struct acp6x_dev_data { void __iomem *acp6x_base; struct resource *res; bool acp6x_audio_mode; + bool dmic; struct platform_device *pdev[ACP6x_DEVS]; }; @@ -152,6 +153,7 @@ static int snd_acp6x_probe(struct pci_dev *pci, int val = 0x00; u32 addr; unsigned int irqflags, flag; + bool has_dmic; int ret; irqflags = IRQF_SHARED; @@ -171,6 +173,8 @@ static int snd_acp6x_probe(struct pci_dev *pci, dev_dbg(&pci->dev, "acp6x pci device not found\n"); return -ENODEV; } + has_dmic = snd_acp6x_platform_has_dmic(pci); + if (pci_enable_device(pci)) { dev_err(&pci->dev, "pci_enable_device failed\n"); return -ENODEV; @@ -195,6 +199,7 @@ static int snd_acp6x_probe(struct pci_dev *pci, ret = -ENOMEM; goto release_regions; } + adata->dmic = has_dmic; pci_set_master(pci); pci_set_drvdata(pci, adata); ret = acp6x_init(adata->acp6x_base); @@ -249,6 +254,11 @@ static int snd_acp6x_probe(struct pci_dev *pci, pdevinfo[2].name = "acp_yc_mach"; pdevinfo[2].id = 0; pdevinfo[2].parent = &pci->dev; + /* The flag lives as long as the PCI device, which outlives the + * platform devices unregistered in ->remove(). + */ + pdevinfo[2].data = &adata->dmic; + pdevinfo[2].size_data = sizeof(adata->dmic); for (index = 0; index < ACP6x_DEVS; index++) { adata->pdev[index] = -- 2.56.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v4 4/5] ASoC: amd: yc: refuse the ACP function when no DMIC is wired 2026-12-03 18:30 [PATCH v4 0/5] ASoC: amd: yc: do not bind the ACP when no DMIC is wired MuXian Chen ` (2 preceding siblings ...) 2026-12-03 18:30 ` [PATCH v4 3/5] ASoC: amd: yc: ask the firmware once about the ACP DMIC path MuXian Chen @ 2026-12-03 18:30 ` MuXian Chen 2026-12-03 18:30 ` [PATCH v4 5/5] ASoC: amd: yc: allow forcing the ACP DMIC decision MuXian Chen 4 siblings, 0 replies; 9+ messages in thread From: MuXian Chen @ 2026-12-03 18:30 UTC (permalink / raw) To: Vijendar Mukunda, Venkata Prasad Potturu, Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai Cc: linux-sound, linux-kernel, Mario Limonciello An ACP6x function is present on every Yellow Carp platform, including boards where nothing is wired behind it: no DMIC array, no I2S codec and no SoundWire peripheral. Firmware does not say so. The ACPI node carries no consumer description, and the _WOV method on some boards is a template that unconditionally returns 1, so the driver cannot tell "present" from "used". Binding the function on such a board has no upside and a real cost: the probe path runs acp6x_init() and the runtime suspend path then gates the audio clock (ACP_CLKMUX_SEL = 0) in acp6x_deinit(). The ACP block shares that clock domain with the HDA controller on the same PCI segment, and HDA can end up with snd_hda_intel 0000:06:00.6: CORB reset timeout#2, CORBRP = 65535 sometimes without recovering. This is the regression analysed in the work item below. Refuse the device instead, so that nothing is enabled, mapped or initialized and no register in the shared clock domain is written. The PCI core suspends the function after the failed probe, which leaves it in the state firmware configured. Boards in the list keep binding and registering the DMIC card as before. Link: https://gitlab.freedesktop.org/drm/amd/-/work_items/5529 Tested on a MECHREVO JIAOLONG (rev 0x62): two s2idle cycles, no CORB errors, onboard HDA and playback unaffected. Signed-off-by: MuXian Chen <a18165943161@gmail.com> --- sound/soc/amd/yc/pci-acp6x.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sound/soc/amd/yc/pci-acp6x.c b/sound/soc/amd/yc/pci-acp6x.c index c987f6c365af..5566b860ee12 100644 --- a/sound/soc/amd/yc/pci-acp6x.c +++ b/sound/soc/amd/yc/pci-acp6x.c @@ -175,6 +175,17 @@ static int snd_acp6x_probe(struct pci_dev *pci, } has_dmic = snd_acp6x_platform_has_dmic(pci); + if (!has_dmic) { + /* + * Nothing consumes the ACP on this board: no DMIC array, no + * I2S codec, no SoundWire peripheral. Binding the function + * would only invite acp6x_init() and the shared clock gating + * in acp6x_deinit(), so decline the device instead. + */ + dev_info(&pci->dev, "no ACP consumer, not binding\n"); + return -ENODEV; + } + if (pci_enable_device(pci)) { dev_err(&pci->dev, "pci_enable_device failed\n"); return -ENODEV; -- 2.56.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v4 5/5] ASoC: amd: yc: allow forcing the ACP DMIC decision 2026-12-03 18:30 [PATCH v4 0/5] ASoC: amd: yc: do not bind the ACP when no DMIC is wired MuXian Chen ` (3 preceding siblings ...) 2026-12-03 18:30 ` [PATCH v4 4/5] ASoC: amd: yc: refuse the ACP function when no DMIC is wired MuXian Chen @ 2026-12-03 18:30 ` MuXian Chen 4 siblings, 0 replies; 9+ messages in thread From: MuXian Chen @ 2026-12-03 18:30 UTC (permalink / raw) To: Vijendar Mukunda, Venkata Prasad Potturu, Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai Cc: linux-sound, linux-kernel, Mario Limonciello Board detection can be wrong in both directions: a board may wire the DMIC without being listed, and a listed board may have it disabled in firmware. Follow the snd-intel-dspcfg.dsp_driver convention and add a read-only module parameter so the decision can be overridden from the kernel command line or modprobe.d: snd_pci_acp6x.dmic=0 auto (default) snd_pci_acp6x.dmic=1 force the DMIC path on snd_pci_acp6x.dmic=2 force it off The override is applied inside snd_acp6x_platform_has_dmic(), so the flag handed to the machine driver already reflects it. Forcing it on initializes a block that shares its clock domain with HDA; that is the caller's choice and may break HDA on boards that do not wire it. Signed-off-by: MuXian Chen <a18165943161@gmail.com> --- sound/soc/amd/yc/acp6x-quirks.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sound/soc/amd/yc/acp6x-quirks.c b/sound/soc/amd/yc/acp6x-quirks.c index 4fabb38b0427..7d181cf1149a 100644 --- a/sound/soc/amd/yc/acp6x-quirks.c +++ b/sound/soc/amd/yc/acp6x-quirks.c @@ -18,6 +18,17 @@ #include "acp6x.h" +enum acp6x_dmic_mode { + ACP6X_DMIC_AUTO = 0, + ACP6X_DMIC_ON, + ACP6X_DMIC_OFF, + ACP6X_DMIC_LAST = ACP6X_DMIC_OFF, +}; + +static int dmic; +module_param(dmic, int, 0444); +MODULE_PARM_DESC(dmic, "Force the ACP DMIC path (0=auto, 1=on, 2=off)"); + static const struct dmi_system_id yc_acp_quirk_table[] = { { .matches = { @@ -869,6 +880,9 @@ bool snd_acp6x_platform_has_dmic(struct pci_dev *pci) const union acpi_object *obj; acpi_integer wov; + if (dmic > ACP6X_DMIC_AUTO && dmic <= ACP6X_DMIC_LAST) + return dmic == ACP6X_DMIC_ON; + if (!ACPI_HANDLE(&pci->dev) || acpi_evaluate_integer(ACPI_HANDLE(&pci->dev), "_WOV", NULL, &wov) || !wov) -- 2.56.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-12-05 13:36 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2026-12-03 18:30 [PATCH v4 0/5] ASoC: amd: yc: do not bind the ACP when no DMIC is wired MuXian Chen 2026-12-03 18:30 ` [PATCH v4 1/5] ASoC: amd: yc: stop the shared IRQ before tearing down platform devices MuXian Chen 2026-12-04 5:13 ` Mukunda,Vijendar 2026-12-03 18:30 ` [PATCH v4 2/5] ASoC: amd: yc: share the ACP6x DMIC board list MuXian Chen 2026-12-04 6:07 ` Mukunda,Vijendar 2026-12-05 13:36 ` MuXian Chen 2026-12-03 18:30 ` [PATCH v4 3/5] ASoC: amd: yc: ask the firmware once about the ACP DMIC path MuXian Chen 2026-12-03 18:30 ` [PATCH v4 4/5] ASoC: amd: yc: refuse the ACP function when no DMIC is wired MuXian Chen 2026-12-03 18:30 ` [PATCH v4 5/5] ASoC: amd: yc: allow forcing the ACP DMIC decision MuXian Chen
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®