2 * drivers/pci/setup-irq.c
4 * Extruded from code written by
5 * Dave Rusling (david.rusling@reo.mts.dec.com)
6 * David Mosberger (davidm@cs.arizona.edu)
7 * David Miller (davem@redhat.com)
9 * Support routines for initializing a PCI subsystem.
13 #include <linux/kernel.h>
14 #include <linux/pci.h>
15 #include <linux/errno.h>
16 #include <linux/ioport.h>
17 #include <linux/cache.h>
19 void __weak
pcibios_update_irq(struct pci_dev
*dev
, int irq
)
21 dev_dbg(&dev
->dev
, "assigning IRQ %02d\n", irq
);
22 pci_write_config_byte(dev
, PCI_INTERRUPT_LINE
, irq
);
25 static void pdev_fixup_irq(struct pci_dev
*dev
,
26 u8 (*swizzle
)(struct pci_dev
*, u8
*),
27 int (*map_irq
)(const struct pci_dev
*, u8
, u8
))
32 /* If this device is not on the primary bus, we need to figure out
33 which interrupt pin it will come in on. We know which slot it
34 will come in on 'cos that slot is where the bridge is. Each
35 time the interrupt line passes through a PCI-PCI bridge we must
36 apply the swizzle function. */
38 pci_read_config_byte(dev
, PCI_INTERRUPT_PIN
, &pin
);
39 /* Cope with illegal. */
44 /* Follow the chain of bridges, swizzling as we go. */
45 slot
= (*swizzle
)(dev
, &pin
);
47 irq
= (*map_irq
)(dev
, slot
, pin
);
53 dev_dbg(&dev
->dev
, "fixup irq: got %d\n", dev
->irq
);
55 /* Always tell the device, so the driver knows what is
56 the real IRQ to use; the device does not use it. */
57 pcibios_update_irq(dev
, irq
);
60 void pci_fixup_irqs(u8 (*swizzle
)(struct pci_dev
*, u8
*),
61 int (*map_irq
)(const struct pci_dev
*, u8
, u8
))
63 struct pci_dev
*dev
= NULL
;
66 pdev_fixup_irq(dev
, swizzle
, map_irq
);
This page took 0.032966 seconds and 5 git commands to generate.