Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 39891
b: refs/heads/master
c: 09d6029
h: refs/heads/master
i:
  39889: 9335844
  39887: e245577
v: v3
  • Loading branch information
Daniel Drake authored and Greg Kroah-Hartman committed Oct 18, 2006
1 parent 096075d commit 8c6e705
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9ef9977cabc1b2c1718ef6eb883caec8dcb80b4c
refs/heads/master: 09d6029f43ebbe7307854abdae204c25d711ff94
43 changes: 34 additions & 9 deletions trunk/drivers/pci/quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,11 +648,43 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_vi
* Some of the on-chip devices are actually '586 devices' so they are
* listed here.
*/

static int via_irq_fixup_needed = -1;

/*
* As some VIA hardware is available in PCI-card form, we need to restrict
* this quirk to VIA PCI hardware built onto VIA-based motherboards only.
* We try to locate a VIA southbridge before deciding whether the quirk
* should be applied.
*/
static const struct pci_device_id via_irq_fixup_tbl[] = {
{
.vendor = PCI_VENDOR_ID_VIA,
.device = PCI_ANY_ID,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
.class = PCI_CLASS_BRIDGE_ISA << 8,
.class_mask = 0xffff00,
},
{ 0, },
};

static void quirk_via_irq(struct pci_dev *dev)
{
u8 irq, new_irq;

new_irq = dev->irq & 0xf;
if (via_irq_fixup_needed == -1)
via_irq_fixup_needed = pci_dev_present(via_irq_fixup_tbl);

if (!via_irq_fixup_needed)
return;

new_irq = dev->irq;

/* Don't quirk interrupts outside the legacy IRQ range */
if (!new_irq || new_irq > 15)
return;

pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
if (new_irq != irq) {
printk(KERN_INFO "PCI: VIA IRQ fixup for %s, from %d to %d\n",
Expand All @@ -661,14 +693,7 @@ static void quirk_via_irq(struct pci_dev *dev)
pci_write_config_byte(dev, PCI_INTERRUPT_LINE, new_irq);
}
}
DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_0, quirk_via_irq);
DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, quirk_via_irq);
DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_2, quirk_via_irq);
DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, quirk_via_irq);
DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235_USB_2, quirk_via_irq);
DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686, quirk_via_irq);
DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_via_irq);
DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, quirk_via_irq);
DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_ANY_ID, quirk_via_irq);

/*
* VIA VT82C598 has its device ID settable and many BIOSes
Expand Down

0 comments on commit 8c6e705

Please sign in to comment.