aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Goecke <goecke@upb.de>2007-09-10 04:46:52 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-10-12 18:03:16 -0400
commit346ca04d050ac48ceb8e4a6b1c76c2d7fd5d1a6a (patch)
treee25eb9141a7b859393417bf0dc157732bc89c57f
parent651472fbff71df39d3d734de31bca6e5412a688b (diff)
PCI: re-enable onboard sound on "MSI K8T Neo2-FIR"
On the "MSI K8T Neo2-FIR" board the BIOS disables the onboard soundcard, if a second PCI soundcard is present. This patch sets the korrect register bit to enable the onboard sound. Removed old code in /drivers/pci/quirks.c that only checks for the PCI-ID and fires on any Board with VIA 8237. New code in /arch/i386/pci/fixup.c checks the DMI-tables and only runs on the specific board. Signed-off-by: Johannes Goecke <goecke@upb.de> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--arch/x86/pci/fixup.c47
-rw-r--r--drivers/pci/quirks.c32
2 files changed, 47 insertions, 32 deletions
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
index c82cbf4c7226..6cff66dd0c91 100644
--- a/arch/x86/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
@@ -353,6 +353,53 @@ static void __devinit pci_fixup_video(struct pci_dev *pdev)
353} 353}
354DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video); 354DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video);
355 355
356
357static struct dmi_system_id __devinitdata msi_k8t_dmi_table[] = {
358 {
359 .ident = "MSI-K8T-Neo2Fir",
360 .matches = {
361 DMI_MATCH(DMI_SYS_VENDOR, "MSI"),
362 DMI_MATCH(DMI_PRODUCT_NAME, "MS-6702E"),
363 },
364 },
365 {}
366};
367
368/*
369 * The AMD-Athlon64 board MSI "K8T Neo2-FIR" disables the onboard sound
370 * card if a PCI-soundcard is added.
371 *
372 * The BIOS only gives options "DISABLED" and "AUTO". This code sets
373 * the corresponding register-value to enable the soundcard.
374 *
375 * The soundcard is only enabled, if the mainborad is identified
376 * via DMI-tables and the soundcard is detected to be off.
377 */
378static void __devinit pci_fixup_msi_k8t_onboard_sound(struct pci_dev *dev)
379{
380 unsigned char val;
381 if (!dmi_check_system(msi_k8t_dmi_table))
382 return; /* only applies to MSI K8T Neo2-FIR */
383
384 pci_read_config_byte(dev, 0x50, &val);
385 if (val & 0x40) {
386 pci_write_config_byte(dev, 0x50, val & (~0x40));
387
388 /* verify the change for status output */
389 pci_read_config_byte(dev, 0x50, &val);
390 if (val & 0x40)
391 printk(KERN_INFO "PCI: Detected MSI K8T Neo2-FIR, "
392 "can't enable onboard soundcard!\n");
393 else
394 printk(KERN_INFO "PCI: Detected MSI K8T Neo2-FIR, "
395 "enabled onboard soundcard.\n");
396 }
397}
398DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237,
399 pci_fixup_msi_k8t_onboard_sound);
400DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237,
401 pci_fixup_msi_k8t_onboard_sound);
402
356/* 403/*
357 * Some Toshiba laptops need extra code to enable their TI TSB43AB22/A. 404 * Some Toshiba laptops need extra code to enable their TI TSB43AB22/A.
358 * 405 *
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 3b0bb3268bbd..59d4da2734c1 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -925,38 +925,6 @@ static void __init quirk_eisa_bridge(struct pci_dev *dev)
925} 925}
926DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82375, quirk_eisa_bridge ); 926DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82375, quirk_eisa_bridge );
927 927
928/*
929 * On the MSI-K8T-Neo2Fir Board, the internal Soundcard is disabled
930 * when a PCI-Soundcard is added. The BIOS only gives Options
931 * "Disabled" and "AUTO". This Quirk Sets the corresponding
932 * Register-Value to enable the Soundcard.
933 *
934 * FIXME: Presently this quirk will run on anything that has an 8237
935 * which isn't correct, we need to check DMI tables or something in
936 * order to make sure it only runs on the MSI-K8T-Neo2Fir. Because it
937 * runs everywhere at present we suppress the printk output in most
938 * irrelevant cases.
939 */
940static void k8t_sound_hostbridge(struct pci_dev *dev)
941{
942 unsigned char val;
943
944 pci_read_config_byte(dev, 0x50, &val);
945 if (val == 0xc8) {
946 /* Assume it's probably a MSI-K8T-Neo2Fir */
947 printk(KERN_INFO "PCI: MSI-K8T-Neo2Fir, attempting to turn soundcard ON\n");
948 pci_write_config_byte(dev, 0x50, val & (~0x40));
949
950 /* Verify the Change for Status output */
951 pci_read_config_byte(dev, 0x50, &val);
952 if (val & 0x40)
953 printk(KERN_INFO "PCI: MSI-K8T-Neo2Fir, soundcard still off\n");
954 else
955 printk(KERN_INFO "PCI: MSI-K8T-Neo2Fir, soundcard on\n");
956 }
957}
958DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, k8t_sound_hostbridge);
959DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, k8t_sound_hostbridge);
960 928
961/* 929/*
962 * On ASUS P4B boards, the SMBus PCI Device within the ICH2/4 southbridge 930 * On ASUS P4B boards, the SMBus PCI Device within the ICH2/4 southbridge