diff options
author | Krzysztof Hałasa <khc@pm.waw.pl> | 2009-11-17 18:39:01 -0500 |
---|---|---|
committer | Krzysztof Hałasa <khc@pm.waw.pl> | 2009-12-05 10:58:41 -0500 |
commit | 0fd7dc7f6c88ba4a46ff472a30d175facc8b6292 (patch) | |
tree | da84211afc906c96bd1b069eceb9a549b345fe59 | |
parent | 8d3fdf31dd2066533861bb57ed7df1ae1b1f5fcc (diff) |
IXP4xx: GTWX5715 platform only has two PCI IRQ lines, not four.
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
-rw-r--r-- | arch/arm/mach-ixp4xx/gtwx5715-pci.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/arch/arm/mach-ixp4xx/gtwx5715-pci.c b/arch/arm/mach-ixp4xx/gtwx5715-pci.c index 276c61437851..25d2c333c204 100644 --- a/arch/arm/mach-ixp4xx/gtwx5715-pci.c +++ b/arch/arm/mach-ixp4xx/gtwx5715-pci.c | |||
@@ -31,15 +31,9 @@ | |||
31 | #include <asm/mach/pci.h> | 31 | #include <asm/mach/pci.h> |
32 | 32 | ||
33 | #define SLOT0_DEVID 0 | 33 | #define SLOT0_DEVID 0 |
34 | #define SLOT0_INTA 10 | ||
35 | #define SLOT0_INTB 11 | ||
36 | |||
37 | #define SLOT1_DEVID 1 | 34 | #define SLOT1_DEVID 1 |
38 | #define SLOT1_INTA 11 | 35 | #define INTA 10 /* slot 1 has INTA and INTB crossed */ |
39 | #define SLOT1_INTB 10 | 36 | #define INTB 11 |
40 | |||
41 | #define SLOT_COUNT 2 | ||
42 | #define INT_PIN_COUNT 2 | ||
43 | 37 | ||
44 | /* | 38 | /* |
45 | * Slot 0 isn't actually populated with a card connector but | 39 | * Slot 0 isn't actually populated with a card connector but |
@@ -49,26 +43,22 @@ | |||
49 | */ | 43 | */ |
50 | void __init gtwx5715_pci_preinit(void) | 44 | void __init gtwx5715_pci_preinit(void) |
51 | { | 45 | { |
52 | set_irq_type(IXP4XX_GPIO_IRQ(SLOT0_INTA), IRQ_TYPE_LEVEL_LOW); | 46 | set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW); |
53 | set_irq_type(IXP4XX_GPIO_IRQ(SLOT0_INTB), IRQ_TYPE_LEVEL_LOW); | 47 | set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW); |
54 | set_irq_type(IXP4XX_GPIO_IRQ(SLOT1_INTA), IRQ_TYPE_LEVEL_LOW); | ||
55 | set_irq_type(IXP4XX_GPIO_IRQ(SLOT1_INTB), IRQ_TYPE_LEVEL_LOW); | ||
56 | ixp4xx_pci_preinit(); | 48 | ixp4xx_pci_preinit(); |
57 | } | 49 | } |
58 | 50 | ||
59 | 51 | ||
60 | static int __init gtwx5715_map_irq(struct pci_dev *dev, u8 slot, u8 pin) | 52 | static int __init gtwx5715_map_irq(struct pci_dev *dev, u8 slot, u8 pin) |
61 | { | 53 | { |
62 | int rc; | 54 | int rc = -1; |
63 | static int gtwx5715_irqmap[SLOT_COUNT][INT_PIN_COUNT] = { | ||
64 | {IXP4XX_GPIO_IRQ(SLOT0_INTA), IXP4XX_GPIO_IRQ(SLOT0_INTB)}, | ||
65 | {IXP4XX_GPIO_IRQ(SLOT1_INTA), IXP4XX_GPIO_IRQ(SLOT1_INTB)}, | ||
66 | }; | ||
67 | 55 | ||
68 | if (slot >= SLOT_COUNT || pin >= INT_PIN_COUNT) | 56 | if ((slot == SLOT0_DEVID && pin == 1) || |
69 | rc = -1; | 57 | (slot == SLOT1_DEVID && pin == 2)) |
70 | else | 58 | rc = IXP4XX_GPIO_IRQ(INTA); |
71 | rc = gtwx5715_irqmap[slot][pin - 1]; | 59 | else if ((slot == SLOT0_DEVID && pin == 2) || |
60 | (slot == SLOT1_DEVID && pin == 1)) | ||
61 | rc = IXP4XX_GPIO_IRQ(INTB); | ||
72 | 62 | ||
73 | printk(KERN_INFO "%s: Mapped slot %d pin %d to IRQ %d\n", | 63 | printk(KERN_INFO "%s: Mapped slot %d pin %d to IRQ %d\n", |
74 | __func__, slot, pin, rc); | 64 | __func__, slot, pin, rc); |