Skip to contentSkip to conversation

ASoC: amd: ps: Add support for MSI Crosshair A16 HX

PATCH In review Sidharth Sharma 3 participants 4 messages May 17 – May 18

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ASoC: amd: ps: Add support for MSI Crosshair A16 HX

The MSI Crosshair A16 HX (D8WFKG) uses a Ryzen 9 8940HX processor, which identifies with ACP PCI revision 0x62. This revision is currently unlisted in the Pink Sardine driver, causing the probe to return -ENODEV.

Furthermore, the MSI BIOS lacks the necessary 'acp-audio-device-type' and '_WOV' ACPI entries required to automatically route the internal digital microphone array.

Add the 0x62 revision to the PCI validation switch block, and introduce a DMI quirk table to manually force the PDM configuration flag for this specific board, allowing the acp63-dmic-capture node to map correctly.

---
Changes in v2:
- Moved ACP62_PCI_REV definition from pci-ps.c to acp63.h for consistency.

 sound/soc/amd/ps/acp63.h  |  1 +
 sound/soc/amd/ps/pci-ps.c | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)
sound/soc/amd/ps/acp63.h +1 -0
index 62cb6bef1..4f955a817 100644
@@ -11,6 +11,7 @@
 #define ACP_DEVICE_ID 0x15E2
 #define ACP63_REG_START		0x1240000
 #define ACP63_REG_END		0x125C000
+#define ACP62_PCI_REV 		0x62
 #define ACP63_PCI_REV		0x63
 #define ACP70_PCI_REV		0x70
 #define ACP71_PCI_REV		0x71
sound/soc/amd/ps/pci-ps.c +19 -0
index 9751cf078..561921d4b 100644
@@ -17,10 +17,22 @@
 #include <linux/pm_runtime.h>
 #include <linux/iopoll.h>
 #include <linux/soundwire/sdw_amd.h>
+#include <linux/dmi.h>
 #include "../mach-config.h"
 
 #include "acp63.h"
 
+static const struct dmi_system_id acp63_dmic_quirk_table[] = {
+	{
+		.ident = "MSI Crosshair A16 HX",
+		.matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Crosshair A16 HX D8WFKG"),
+		}
+	},
+	{}
+};
+
 static void handle_acp70_sdw_wake_event(struct acp63_dev_data *adata)
 {
 	struct amd_sdw_manager *amd_manager;
@@ -436,6 +448,12 @@ static int get_acp63_device_config(struct pci_dev *pci, struct acp63_dev_data *a
 	if (dmic_en && wov_en)
 		is_dmic_dev = true;
 
+	/* fallback for msi firmware lacking standard acpi audio routing flags */
+	if (dmi_check_system(acp63_dmic_quirk_table)) {
+		is_dmic_dev = true;
+		acp_data->is_pdm_config = true;
+	}
+
 	if (acp_data->is_sdw_config) {
 		ret = acp_scan_sdw_devices(&pci->dev, ACP63_SDW_ADDR);
 		if (!ret && acp_data->info.link_mask)
@@ -587,6 +605,7 @@ static int snd_acp63_probe(struct pci_dev *pci,
 
 	/* ACP PCI revision id check for ACP6.3, ACP7.0 & ACP7.1 platforms */
 	switch (pci->revision) {
+	case ACP62_PCI_REV:
 	case ACP63_PCI_REV:
 	case ACP70_PCI_REV:
 	case ACP71_PCI_REV:
Signature · 1 line
2.53.0
maintainer
#1 lore raw
Quoted 6 lines · Sidharth Sharma

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

The MSI Crosshair A16 HX (D8WFKG) uses a Ryzen 9 8940HX processor, which identifies with ACP PCI revision 0x62. This revision is currently unlisted in the Pink Sardine driver, causing the probe to return -ENODEV.

Quoted 7 lines

Furthermore, the MSI BIOS lacks the necessary 'acp-audio-device-type' and '_WOV' ACPI entries required to automatically route the internal digital microphone array.

Add the 0x62 revision to the PCI validation switch block, and introduce a DMI quirk table to manually force the PDM configuration flag for this specific board, allowing the acp63-dmic-capture node to map correctly.

For ACP platform with PCI revision id:0x62, required support is included in YC base driver i.e sound/soc/amd/yc folder. i.e any new platform support based on ACP6.2 should be included in YC folder.
This patch should be dropped.

Quoted 73 lines

---
Changes in v2:
- Moved ACP62_PCI_REV definition from pci-ps.c to acp63.h for consistency.

 sound/soc/amd/ps/acp63.h  |  1 +
 sound/soc/amd/ps/pci-ps.c | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)
sound/soc/amd/ps/acp63.h +1 -0
index 62cb6bef1..4f955a817 100644
@@ -11,6 +11,7 @@
 #define ACP_DEVICE_ID 0x15E2
 #define ACP63_REG_START                0x1240000
 #define ACP63_REG_END          0x125C000
+#define ACP62_PCI_REV          0x62
 #define ACP63_PCI_REV          0x63
 #define ACP70_PCI_REV          0x70
 #define ACP71_PCI_REV          0x71
sound/soc/amd/ps/pci-ps.c +19 -1
index 9751cf078..561921d4b 100644
@@ -17,10 +17,22 @@
 #include <linux/pm_runtime.h>
 #include <linux/iopoll.h>
 #include <linux/soundwire/sdw_amd.h>
+#include <linux/dmi.h>
 #include "../mach-config.h"
 
 #include "acp63.h"
 
+static const struct dmi_system_id acp63_dmic_quirk_table[] = {
+       {
+               .ident = "MSI Crosshair A16 HX",
+               .matches = {
+                       DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "Crosshair A16 HX D8WFKG"),
+               }
+       },
+       {}
+};
+
 static void handle_acp70_sdw_wake_event(struct acp63_dev_data *adata)
 {
        struct amd_sdw_manager *amd_manager;
@@ -436,6 +448,12 @@ static int get_acp63_device_config(struct pci_dev *pci, struct acp63_dev_data *a
        if (dmic_en && wov_en)
                is_dmic_dev = true;
 
+       /* fallback for msi firmware lacking standard acpi audio routing flags */
+       if (dmi_check_system(acp63_dmic_quirk_table)) {
+               is_dmic_dev = true;
+               acp_data->is_pdm_config = true;
+       }
+
        if (acp_data->is_sdw_config) {
                ret = acp_scan_sdw_devices(&pci->dev, ACP63_SDW_ADDR);
                if (!ret && acp_data->info.link_mask)
@@ -587,6 +605,7 @@ static int snd_acp63_probe(struct pci_dev *pci,
 
        /* ACP PCI revision id check for ACP6.3, ACP7.0 & ACP7.1 platforms */
        switch (pci->revision) {
+       case ACP62_PCI_REV:
        case ACP63_PCI_REV:
        case ACP70_PCI_REV:
        case ACP71_PCI_REV:
--

2.53.0

maintainer
#2 lore raw
In reply to Sidharth Sharma

sound/soc/amd/ps/pci-ps.c static int snd_acp63_probe(struct pci_dev *pci, · line 611

Quoted 12 lines · Sidharth Sharma

The MSI Crosshair A16 HX (D8WFKG) uses a Ryzen 9 8940HX processor, which identifies with ACP PCI revision 0x62. This revision is currently unlisted in the Pink Sardine driver, causing the probe to return -ENODEV.

sound/soc/amd/ps/pci-ps.c +1 -0
@@ -587,6 +605,7 @@ static int snd_acp63_probe(struct pci_dev *pci,
 
 	/* ACP PCI revision id check for ACP6.3, ACP7.0 & ACP7.1 platforms */
 	switch (pci->revision) {
+	case ACP62_PCI_REV:
 	case ACP63_PCI_REV:
 	case ACP70_PCI_REV:
 	case ACP71_PCI_REV:

Don't we also need an update to acp_hw_init_ops()?

maintainer
#3 lore raw
Quoted 6 lines · Mark Brown
Quoted 5 lines · Sidharth Sharma

The MSI Crosshair A16 HX (D8WFKG) uses a Ryzen 9 8940HX processor, which identifies with ACP PCI revision 0x62. This revision is currently unlisted in the Pink Sardine driver, causing the probe to return -ENODEV.

(quoted diff) +0 -0
@@ -587,6 +605,7 @@ static int snd_acp63_probe(struct pci_dev *pci,
 
Quoted 7 lines

sound/soc/amd/ps/pci-ps.c static int snd_acp63_probe(struct pci_dev *pci, · line 611

Quoted 6 lines
sound/soc/amd/ps/pci-ps.c +1 -0
  	/* ACP PCI revision id check for ACP6.3, ACP7.0 & ACP7.1 platforms */
  	switch (pci->revision) {
+	case ACP62_PCI_REV:
  	case ACP63_PCI_REV:
  	case ACP70_PCI_REV:
  	case ACP71_PCI_REV:

Don't we also need an update to acp_hw_init_ops()?

This patch should be dropped. ACP PCI rev id:0x62 support is included in sound/soc/amd/yc folder.  Code changes related to any new platform addition for ACP PCI rev id 0x62 should be included in yc folder.