Skip to contentSkip to conversation

PCI: PCI quirk for Asus A8V and A8V Deluxe motherboards

PATCH New bjd 1 participant 1 message Feb 12, 2006 PCI

lore
Share & tools
lore

bjd

author
#0 lore raw

PATCH 1/1 PCI: PCI quirk for Asus A8V and A8V Deluxe motherboards

From: Bauke Jan Douma <[email protected]>

On ASUS A8V and A8V Deluxe boards, the onboard AC97 audio controller and MC97 modem controller are deactivated when a second PCI soundcard is present. This patch enables them.

---

When a PCI soundcard is present in an Asus A8V or A8V Deluxe system, the BIOS will disable the onboard AC97 and MC97 devices. This patch enables them. The soundcard now works on my A8V Deluxe, shows up in lspci output, in /proc/asound/cards, has mixer controls, plays audio.
Patch is against 2.6.15 proper.

drivers/pci/quirks.c renamed from drivers/pci/quirks.c.orig +36 -0
@@ -1074,6 +1074,42 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_S
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_963,		quirk_sis_96x_smbus );
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI,	PCI_DEVICE_ID_SI_LPC,		quirk_sis_96x_smbus );
 
+/*
+ * On ASUS A8V and A8V Deluxe boards, the onboard AC97 audio controller
+ * and MC97 modem controller are disabled when a second PCI soundcard is
+ * present. This patch, tweaking the VT8237 ISA bridge, enables them.
+ * -- bjd
+ */
+static int __initdata asus_hides_ac97 = 0;
+
+static void __init asus_hides_ac97_device(struct pci_dev *dev)
+{
+	if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_ASUSTEK)) {
+		if (dev->device == PCI_DEVICE_ID_VIA_8237)
+				asus_hides_ac97 = 1;
+			}
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8237, asus_hides_ac97_device );
+
+static void __init asus_hides_ac97_lpc(struct pci_dev *dev)
+{
+	u8 val;
+	
+	if (likely(!asus_hides_ac97))
+		return;
+
+	pci_read_config_byte(dev, 0x50, &val);
+	if (val & 0xc0) {
+		pci_write_config_byte(dev, 0x50, val & (~0xc0));
+		pci_read_config_byte(dev, 0x50, &val);
+		if (val & 0xc0)
+			printk(KERN_INFO "PCI: onboard AC97/MC97 devices continue to play 'hide and seek'! 0x%x\n", val);
+		else
+			printk(KERN_INFO "PCI: enabled onboard AC97/MC97 devices\n");
+	}
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA,	PCI_DEVICE_ID_VIA_8237,	asus_hides_ac97_lpc );
+
 #ifdef CONFIG_X86_IO_APIC
 static void __init quirk_alder_ioapic(struct pci_dev *pdev)
 {