blob: 42913f43feb0edca0015a1f2013c609cc361d802 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#include <linux/pci.h>
2#include <linux/acpi.h>
3#include <linux/init.h>
4#include <linux/irq.h>
5#include <asm/hw_irq.h>
6#include "pci.h"
7
8struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int domain, int busnum)
9{
10 if (domain != 0) {
11 printk(KERN_WARNING "PCI: Multiple domains not supported\n");
12 return NULL;
13 }
14
15 return pcibios_scan_root(busnum);
16}
17
18extern int pci_routeirq;
19static int __init pci_acpi_init(void)
20{
21 struct pci_dev *dev = NULL;
22
23 if (pcibios_scanned)
24 return 0;
25
26 if (acpi_noirq)
27 return 0;
28
29 printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n");
30 acpi_irq_penalty_init();
31 pcibios_scanned++;
32 pcibios_enable_irq = acpi_pci_irq_enable;
David Shaohua Li87bec662005-07-27 23:02:00 -040033 pcibios_disable_irq = acpi_pci_irq_disable;
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
35 if (pci_routeirq) {
36 /*
37 * PCI IRQ routing is set up by pci_enable_device(), but we
38 * also do it here in case there are still broken drivers that
39 * don't use pci_enable_device().
40 */
41 printk(KERN_INFO "PCI: Routing PCI interrupts for all devices because \"pci=routeirq\" specified\n");
42 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)
43 acpi_pci_irq_enable(dev);
44 } else
45 printk(KERN_INFO "PCI: If a device doesn't work, try \"pci=routeirq\". If it helps, post a report\n");
46
47#ifdef CONFIG_X86_IO_APIC
48 if (acpi_ioapic)
49 print_IO_APIC();
50#endif
51
52 return 0;
53}
54subsys_initcall(pci_acpi_init);