mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven 'Steve' Kendall <skend@chromium.org>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Takashi Iwai <tiwai@suse.com>,
	linux-sound@vger.kernel.org,
	 Steven 'Steve' Kendall <skend@chromium.org>
Subject: [PATCH] PCI: Override Intel Apollo Lake audio class on Gauteng W3S laptops [8086:5a98]
Date: Thu, 19 Nov 2026 00:52:19 +0000	[thread overview]
Message-ID: <20261119-gauteng-audio-class-set-v1-1-e81d6fd620ad@chromium.org> (raw)

Gauteng Education Dept MODEL-W3S laptops advertise PCI class 0x040300
to use the legacy HDA driver rather than the Audio DSP on the Intel
Apollo Lake audio controller ([8086:5a98]). However, this board uses an
I2S ES8336 codec with no analog HDA codec, and its firmware otherwise
sets up the hardware to enable the DSP.

Add a PCI header fixup for [8086:5a98] on Gauteng W3S systems to
override class 0x040300 to 0x040100 so the SOF driver can claim the
device. Notably this fixes the internal speakers and headphones but
not jack detection.

This patch and its initial changelog were generated by Gemini during
an interactive debugging session given dmesg, lspci and similar
dumps from Gauteng W3S and MODEL-W3S laptops. The resulting quirk
was reviewed and tested on physical MODEL-W3S hardware and on a W3S
with slightly different hardware.

Signed-off-by: Steven 'Steve' Kendall <skend@chromium.org>
---
 drivers/pci/quirks.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 7f1f47ea2ee4..908d038fa29a 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -754,6 +754,40 @@ DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_VENDOR_ID_SYNOPSYS, PCI_ANY_ID,
 			       PCI_CLASS_SERIAL_USB_XHCI, 0,
 			       quirk_synopsys_haps);
 
+/*
+ * Gauteng Education Dept MODEL-W3S laptops report PCI class 0x040300
+ * (PCI_CLASS_MULTIMEDIA_HD_AUDIO) on the Apollo Lake audio controller
+ * ([8086:5a98]) even though the Audio DSP (BAR 4), NHLT ACPI table, and I2S
+ * ESSX8336 codec are enabled and no analog HDA codec is present.
+ *
+ * Override the class to 0x040100 (PCI_CLASS_MULTIMEDIA_AUDIO << 8) so SOF can
+ * claim the device.
+ */
+static const struct dmi_system_id gauteng_w3s_dmi_table[] = {
+	{
+		.ident = "Gauteng Education Dept W3S",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Gauteng Education Dept"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "W3S"),
+		}
+	},
+	{}
+};
+
+static void quirk_gauteng_w3s_audio_class(struct pci_dev *pdev)
+{
+	u32 class = pdev->class;
+
+	if (dmi_check_system(gauteng_w3s_dmi_table)) {
+		pdev->class = PCI_CLASS_MULTIMEDIA_AUDIO << 8;
+		pci_info(pdev, FW_BUG "PCI class overridden (%#08x -> %#08x) so SOF driver can claim this instead of snd_hda_intel\n",
+			 class, pdev->class);
+	}
+}
+DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HDA_APL,
+			       PCI_CLASS_MULTIMEDIA_HD_AUDIO << 8, 0,
+			       quirk_gauteng_w3s_audio_class);
+
 /*
  * Let's make the southbridge information explicit instead of having to
  * worry about people probing the ACPI areas, for example.. (Yes, it

---
base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3
change-id: 20261119-gauteng-audio-class-set-256f769ca134

Best regards,
--  
Steven 'Steve' Kendall <skend@chromium.org>


             reply	other threads:[~2026-11-19  0:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19  0:52 Steven 'Steve' Kendall [this message]
2026-11-19 10:35 ` Pierre-Louis Bossart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261119-gauteng-audio-class-set-v1-1-e81d6fd620ad@chromium.org \
    --to=skend@chromium.org \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®