diff options
Diffstat (limited to 'arch/arm/mach-ixp4xx/ixdp425-pci.c')
-rw-r--r-- | arch/arm/mach-ixp4xx/ixdp425-pci.c | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/arch/arm/mach-ixp4xx/ixdp425-pci.c b/arch/arm/mach-ixp4xx/ixdp425-pci.c index 64c29aacaac9..1ba165a6edac 100644 --- a/arch/arm/mach-ixp4xx/ixdp425-pci.c +++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/mach-ixp4xx/ixdp425-pci.c | 2 | * arch/arm/mach-ixp4xx/ixdp425-pci.c |
3 | * | 3 | * |
4 | * IXDP425 board-level PCI initialization | 4 | * IXDP425 board-level PCI initialization |
5 | * | 5 | * |
@@ -19,39 +19,43 @@ | |||
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/irq.h> | 20 | #include <linux/irq.h> |
21 | #include <linux/delay.h> | 21 | #include <linux/delay.h> |
22 | |||
23 | #include <asm/mach/pci.h> | 22 | #include <asm/mach/pci.h> |
24 | #include <asm/irq.h> | 23 | #include <asm/irq.h> |
25 | #include <mach/hardware.h> | 24 | #include <mach/hardware.h> |
26 | #include <asm/mach-types.h> | 25 | #include <asm/mach-types.h> |
27 | 26 | ||
27 | #define MAX_DEV 4 | ||
28 | #define IRQ_LINES 4 | ||
29 | |||
30 | /* PCI controller GPIO to IRQ pin mappings */ | ||
31 | #define INTA 11 | ||
32 | #define INTB 10 | ||
33 | #define INTC 9 | ||
34 | #define INTD 8 | ||
35 | |||
36 | |||
28 | void __init ixdp425_pci_preinit(void) | 37 | void __init ixdp425_pci_preinit(void) |
29 | { | 38 | { |
30 | set_irq_type(IRQ_IXDP425_PCI_INTA, IRQ_TYPE_LEVEL_LOW); | 39 | set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW); |
31 | set_irq_type(IRQ_IXDP425_PCI_INTB, IRQ_TYPE_LEVEL_LOW); | 40 | set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW); |
32 | set_irq_type(IRQ_IXDP425_PCI_INTC, IRQ_TYPE_LEVEL_LOW); | 41 | set_irq_type(IXP4XX_GPIO_IRQ(INTC), IRQ_TYPE_LEVEL_LOW); |
33 | set_irq_type(IRQ_IXDP425_PCI_INTD, IRQ_TYPE_LEVEL_LOW); | 42 | set_irq_type(IXP4XX_GPIO_IRQ(INTD), IRQ_TYPE_LEVEL_LOW); |
34 | |||
35 | ixp4xx_pci_preinit(); | 43 | ixp4xx_pci_preinit(); |
36 | } | 44 | } |
37 | 45 | ||
38 | static int __init ixdp425_map_irq(struct pci_dev *dev, u8 slot, u8 pin) | 46 | static int __init ixdp425_map_irq(struct pci_dev *dev, u8 slot, u8 pin) |
39 | { | 47 | { |
40 | static int pci_irq_table[IXDP425_PCI_IRQ_LINES] = { | 48 | static int pci_irq_table[IRQ_LINES] = { |
41 | IRQ_IXDP425_PCI_INTA, | 49 | IXP4XX_GPIO_IRQ(INTA), |
42 | IRQ_IXDP425_PCI_INTB, | 50 | IXP4XX_GPIO_IRQ(INTB), |
43 | IRQ_IXDP425_PCI_INTC, | 51 | IXP4XX_GPIO_IRQ(INTC), |
44 | IRQ_IXDP425_PCI_INTD | 52 | IXP4XX_GPIO_IRQ(INTD) |
45 | }; | 53 | }; |
46 | 54 | ||
47 | int irq = -1; | 55 | if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES) |
48 | 56 | return pci_irq_table[(slot + pin - 2) % 4]; | |
49 | if (slot >= 1 && slot <= IXDP425_PCI_MAX_DEV && | ||
50 | pin >= 1 && pin <= IXDP425_PCI_IRQ_LINES) { | ||
51 | irq = pci_irq_table[(slot + pin - 2) % 4]; | ||
52 | } | ||
53 | 57 | ||
54 | return irq; | 58 | return -1; |
55 | } | 59 | } |
56 | 60 | ||
57 | struct hw_pci ixdp425_pci __initdata = { | 61 | struct hw_pci ixdp425_pci __initdata = { |
@@ -72,4 +76,3 @@ int __init ixdp425_pci_init(void) | |||
72 | } | 76 | } |
73 | 77 | ||
74 | subsys_initcall(ixdp425_pci_init); | 78 | subsys_initcall(ixdp425_pci_init); |
75 | |||