diff options
Diffstat (limited to 'arch/arm/mach-ixp4xx/avila-pci.c')
-rw-r--r-- | arch/arm/mach-ixp4xx/avila-pci.c | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/arch/arm/mach-ixp4xx/avila-pci.c b/arch/arm/mach-ixp4xx/avila-pci.c index 08d65dcdb5fe..845e1b500548 100644 --- a/arch/arm/mach-ixp4xx/avila-pci.c +++ b/arch/arm/mach-ixp4xx/avila-pci.c | |||
@@ -22,40 +22,45 @@ | |||
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/irq.h> | 23 | #include <linux/irq.h> |
24 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
25 | |||
26 | #include <asm/mach/pci.h> | 25 | #include <asm/mach/pci.h> |
27 | #include <asm/irq.h> | 26 | #include <asm/irq.h> |
28 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
29 | #include <asm/mach-types.h> | 28 | #include <asm/mach-types.h> |
30 | 29 | ||
30 | #define AVILA_MAX_DEV 4 | ||
31 | #define LOFT_MAX_DEV 6 | ||
32 | #define IRQ_LINES 4 | ||
33 | |||
34 | /* PCI controller GPIO to IRQ pin mappings */ | ||
35 | #define INTA 11 | ||
36 | #define INTB 10 | ||
37 | #define INTC 9 | ||
38 | #define INTD 8 | ||
39 | |||
31 | void __init avila_pci_preinit(void) | 40 | void __init avila_pci_preinit(void) |
32 | { | 41 | { |
33 | set_irq_type(IRQ_AVILA_PCI_INTA, IRQ_TYPE_LEVEL_LOW); | 42 | set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW); |
34 | set_irq_type(IRQ_AVILA_PCI_INTB, IRQ_TYPE_LEVEL_LOW); | 43 | set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW); |
35 | set_irq_type(IRQ_AVILA_PCI_INTC, IRQ_TYPE_LEVEL_LOW); | 44 | set_irq_type(IXP4XX_GPIO_IRQ(INTC), IRQ_TYPE_LEVEL_LOW); |
36 | set_irq_type(IRQ_AVILA_PCI_INTD, IRQ_TYPE_LEVEL_LOW); | 45 | set_irq_type(IXP4XX_GPIO_IRQ(INTD), IRQ_TYPE_LEVEL_LOW); |
37 | |||
38 | ixp4xx_pci_preinit(); | 46 | ixp4xx_pci_preinit(); |
39 | } | 47 | } |
40 | 48 | ||
41 | static int __init avila_map_irq(struct pci_dev *dev, u8 slot, u8 pin) | 49 | static int __init avila_map_irq(struct pci_dev *dev, u8 slot, u8 pin) |
42 | { | 50 | { |
43 | static int pci_irq_table[AVILA_PCI_IRQ_LINES] = { | 51 | static int pci_irq_table[IRQ_LINES] = { |
44 | IRQ_AVILA_PCI_INTA, | 52 | IXP4XX_GPIO_IRQ(INTA), |
45 | IRQ_AVILA_PCI_INTB, | 53 | IXP4XX_GPIO_IRQ(INTB), |
46 | IRQ_AVILA_PCI_INTC, | 54 | IXP4XX_GPIO_IRQ(INTC), |
47 | IRQ_AVILA_PCI_INTD | 55 | IXP4XX_GPIO_IRQ(INTD) |
48 | }; | 56 | }; |
49 | 57 | ||
50 | int irq = -1; | ||
51 | |||
52 | if (slot >= 1 && | 58 | if (slot >= 1 && |
53 | slot <= (machine_is_loft() ? LOFT_PCI_MAX_DEV : AVILA_PCI_MAX_DEV) && | 59 | slot <= (machine_is_loft() ? LOFT_MAX_DEV : AVILA_MAX_DEV) && |
54 | pin >= 1 && pin <= AVILA_PCI_IRQ_LINES) { | 60 | pin >= 1 && pin <= IRQ_LINES) |
55 | irq = pci_irq_table[(slot + pin - 2) % 4]; | 61 | return pci_irq_table[(slot + pin - 2) % 4]; |
56 | } | ||
57 | 62 | ||
58 | return irq; | 63 | return -1; |
59 | } | 64 | } |
60 | 65 | ||
61 | struct hw_pci avila_pci __initdata = { | 66 | struct hw_pci avila_pci __initdata = { |
@@ -75,4 +80,3 @@ int __init avila_pci_init(void) | |||
75 | } | 80 | } |
76 | 81 | ||
77 | subsys_initcall(avila_pci_init); | 82 | subsys_initcall(avila_pci_init); |
78 | |||