Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #include <linux/kernel.h> |
| 2 | #include <linux/init.h> |
| 3 | #include <linux/types.h> |
| 4 | #include <linux/pci.h> |
| 5 | |
Ralf Baechle | d534194 | 2011-06-10 15:30:21 +0100 | [diff] [blame^] | 6 | int __init pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | { |
| 8 | int irq; |
| 9 | |
| 10 | if (dev->bus->number == 0) { |
| 11 | switch (slot) { |
| 12 | case 4: return 5; /* eth0 */ |
| 13 | case 8: return 5; /* eth1 */ |
| 14 | case 6: return 2; /* PCI bridge */ |
| 15 | default: |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 16 | printk(KERN_ERR "PCI: Bad IRQ mapping request " |
| 17 | "for slot %d\n", slot); |
| 18 | return 2; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | } |
| 20 | } else { |
| 21 | switch (pin) { |
| 22 | case 0: irq = 2; break; |
| 23 | case 1: irq = 2; break; |
| 24 | case 2: irq = 2; break; |
| 25 | case 3: irq = 2; break; |
| 26 | case 4: irq = 2; break; |
| 27 | default: irq = -1; break; |
| 28 | } |
| 29 | } |
| 30 | return irq; |
| 31 | } |