aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ixp4xx/dsmg600-pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-ixp4xx/dsmg600-pci.c')
-rw-r--r--arch/arm/mach-ixp4xx/dsmg600-pci.c46
1 files changed, 26 insertions, 20 deletions
diff --git a/arch/arm/mach-ixp4xx/dsmg600-pci.c b/arch/arm/mach-ixp4xx/dsmg600-pci.c
index 926d15f885fb..fa70fed462ba 100644
--- a/arch/arm/mach-ixp4xx/dsmg600-pci.c
+++ b/arch/arm/mach-ixp4xx/dsmg600-pci.c
@@ -19,39 +19,45 @@
19#include <linux/pci.h> 19#include <linux/pci.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/irq.h> 21#include <linux/irq.h>
22
23#include <asm/mach/pci.h> 22#include <asm/mach/pci.h>
24#include <asm/mach-types.h> 23#include <asm/mach-types.h>
25 24
25#define MAX_DEV 4
26#define IRQ_LINES 3
27
28/* PCI controller GPIO to IRQ pin mappings */
29#define INTA 11
30#define INTB 10
31#define INTC 9
32#define INTD 8
33#define INTE 7
34#define INTF 6
35
26void __init dsmg600_pci_preinit(void) 36void __init dsmg600_pci_preinit(void)
27{ 37{
28 set_irq_type(IRQ_DSMG600_PCI_INTA, IRQ_TYPE_LEVEL_LOW); 38 set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW);
29 set_irq_type(IRQ_DSMG600_PCI_INTB, IRQ_TYPE_LEVEL_LOW); 39 set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW);
30 set_irq_type(IRQ_DSMG600_PCI_INTC, IRQ_TYPE_LEVEL_LOW); 40 set_irq_type(IXP4XX_GPIO_IRQ(INTC), IRQ_TYPE_LEVEL_LOW);
31 set_irq_type(IRQ_DSMG600_PCI_INTD, IRQ_TYPE_LEVEL_LOW); 41 set_irq_type(IXP4XX_GPIO_IRQ(INTD), IRQ_TYPE_LEVEL_LOW);
32 set_irq_type(IRQ_DSMG600_PCI_INTE, IRQ_TYPE_LEVEL_LOW); 42 set_irq_type(IXP4XX_GPIO_IRQ(INTE), IRQ_TYPE_LEVEL_LOW);
33 set_irq_type(IRQ_DSMG600_PCI_INTF, IRQ_TYPE_LEVEL_LOW); 43 set_irq_type(IXP4XX_GPIO_IRQ(INTF), IRQ_TYPE_LEVEL_LOW);
34
35 ixp4xx_pci_preinit(); 44 ixp4xx_pci_preinit();
36} 45}
37 46
38static int __init dsmg600_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 47static int __init dsmg600_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
39{ 48{
40 static int pci_irq_table[DSMG600_PCI_MAX_DEV][DSMG600_PCI_IRQ_LINES] = 49 static int pci_irq_table[MAX_DEV][IRQ_LINES] = {
41 { 50 { IXP4XX_GPIO_IRQ(INTE), -1, -1 },
42 { IRQ_DSMG600_PCI_INTE, -1, -1 }, 51 { IXP4XX_GPIO_IRQ(INTA), -1, -1 },
43 { IRQ_DSMG600_PCI_INTA, -1, -1 }, 52 { IXP4XX_GPIO_IRQ(INTB), IXP4XX_GPIO_IRQ(INTC),
44 { IRQ_DSMG600_PCI_INTB, IRQ_DSMG600_PCI_INTC, IRQ_DSMG600_PCI_INTD }, 53 IXP4XX_GPIO_IRQ(INTD) },
45 { IRQ_DSMG600_PCI_INTF, -1, -1 }, 54 { IXP4XX_GPIO_IRQ(INTF), -1, -1 },
46 }; 55 };
47 56
48 int irq = -1; 57 if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES)
49 58 return pci_irq_table[slot - 1][pin - 1];
50 if (slot >= 1 && slot <= DSMG600_PCI_MAX_DEV &&
51 pin >= 1 && pin <= DSMG600_PCI_IRQ_LINES)
52 irq = pci_irq_table[slot-1][pin-1];
53 59
54 return irq; 60 return -1;
55} 61}
56 62
57struct hw_pci __initdata dsmg600_pci = { 63struct hw_pci __initdata dsmg600_pci = {