aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ixp4xx/gtwx5715-pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-ixp4xx/gtwx5715-pci.c')
-rw-r--r--arch/arm/mach-ixp4xx/gtwx5715-pci.c52
1 files changed, 22 insertions, 30 deletions
diff --git a/arch/arm/mach-ixp4xx/gtwx5715-pci.c b/arch/arm/mach-ixp4xx/gtwx5715-pci.c
index 68011852559b..276c61437851 100644
--- a/arch/arm/mach-ixp4xx/gtwx5715-pci.c
+++ b/arch/arm/mach-ixp4xx/gtwx5715-pci.c
@@ -30,20 +30,16 @@
30#include <mach/hardware.h> 30#include <mach/hardware.h>
31#include <asm/mach/pci.h> 31#include <asm/mach/pci.h>
32 32
33#define GTWX5715_PCI_SLOT0_DEVID 0 33#define SLOT0_DEVID 0
34#define GTWX5715_PCI_SLOT0_INTA_GPIO 10 34#define SLOT0_INTA 10
35#define GTWX5715_PCI_SLOT0_INTB_GPIO 11 35#define SLOT0_INTB 11
36#define GTWX5715_PCI_SLOT0_INTA_IRQ IRQ_IXP4XX_GPIO10
37#define GTWX5715_PCI_SLOT0_INTB_IRQ IRQ_IXP4XX_GPIO11
38 36
39#define GTWX5715_PCI_SLOT1_DEVID 1 37#define SLOT1_DEVID 1
40#define GTWX5715_PCI_SLOT1_INTA_GPIO 11 38#define SLOT1_INTA 11
41#define GTWX5715_PCI_SLOT1_INTB_GPIO 10 39#define SLOT1_INTB 10
42#define GTWX5715_PCI_SLOT1_INTA_IRQ IRQ_IXP4XX_GPIO11
43#define GTWX5715_PCI_SLOT1_INTB_IRQ IRQ_IXP4XX_GPIO10
44 40
45#define GTWX5715_PCI_SLOT_COUNT 2 41#define SLOT_COUNT 2
46#define GTWX5715_PCI_INT_PIN_COUNT 2 42#define INT_PIN_COUNT 2
47 43
48/* 44/*
49 * Slot 0 isn't actually populated with a card connector but 45 * Slot 0 isn't actually populated with a card connector but
@@ -53,11 +49,10 @@
53 */ 49 */
54void __init gtwx5715_pci_preinit(void) 50void __init gtwx5715_pci_preinit(void)
55{ 51{
56 set_irq_type(GTWX5715_PCI_SLOT0_INTA_IRQ, IRQ_TYPE_LEVEL_LOW); 52 set_irq_type(IXP4XX_GPIO_IRQ(SLOT0_INTA), IRQ_TYPE_LEVEL_LOW);
57 set_irq_type(GTWX5715_PCI_SLOT0_INTB_IRQ, IRQ_TYPE_LEVEL_LOW); 53 set_irq_type(IXP4XX_GPIO_IRQ(SLOT0_INTB), IRQ_TYPE_LEVEL_LOW);
58 set_irq_type(GTWX5715_PCI_SLOT1_INTA_IRQ, IRQ_TYPE_LEVEL_LOW); 54 set_irq_type(IXP4XX_GPIO_IRQ(SLOT1_INTA), IRQ_TYPE_LEVEL_LOW);
59 set_irq_type(GTWX5715_PCI_SLOT1_INTB_IRQ, IRQ_TYPE_LEVEL_LOW); 55 set_irq_type(IXP4XX_GPIO_IRQ(SLOT1_INTB), IRQ_TYPE_LEVEL_LOW);
60
61 ixp4xx_pci_preinit(); 56 ixp4xx_pci_preinit();
62} 57}
63 58
@@ -65,20 +60,19 @@ void __init gtwx5715_pci_preinit(void)
65static int __init gtwx5715_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 60static int __init gtwx5715_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
66{ 61{
67 int rc; 62 int rc;
68 static int gtwx5715_irqmap 63 static int gtwx5715_irqmap[SLOT_COUNT][INT_PIN_COUNT] = {
69 [GTWX5715_PCI_SLOT_COUNT] 64 {IXP4XX_GPIO_IRQ(SLOT0_INTA), IXP4XX_GPIO_IRQ(SLOT0_INTB)},
70 [GTWX5715_PCI_INT_PIN_COUNT] = { 65 {IXP4XX_GPIO_IRQ(SLOT1_INTA), IXP4XX_GPIO_IRQ(SLOT1_INTB)},
71 {GTWX5715_PCI_SLOT0_INTA_IRQ, GTWX5715_PCI_SLOT0_INTB_IRQ}, 66 };
72 {GTWX5715_PCI_SLOT1_INTA_IRQ, GTWX5715_PCI_SLOT1_INTB_IRQ},
73};
74 67
75 if (slot >= GTWX5715_PCI_SLOT_COUNT || 68 if (slot >= SLOT_COUNT || pin >= INT_PIN_COUNT)
76 pin >= GTWX5715_PCI_INT_PIN_COUNT) rc = -1; 69 rc = -1;
77 else 70 else
78 rc = gtwx5715_irqmap[slot][pin-1]; 71 rc = gtwx5715_irqmap[slot][pin - 1];
79 72
80 printk("%s: Mapped slot %d pin %d to IRQ %d\n", __func__, slot, pin, rc); 73 printk(KERN_INFO "%s: Mapped slot %d pin %d to IRQ %d\n",
81 return(rc); 74 __func__, slot, pin, rc);
75 return rc;
82} 76}
83 77
84struct hw_pci gtwx5715_pci __initdata = { 78struct hw_pci gtwx5715_pci __initdata = {
@@ -93,9 +87,7 @@ struct hw_pci gtwx5715_pci __initdata = {
93int __init gtwx5715_pci_init(void) 87int __init gtwx5715_pci_init(void)
94{ 88{
95 if (machine_is_gtwx5715()) 89 if (machine_is_gtwx5715())
96 {
97 pci_common_init(&gtwx5715_pci); 90 pci_common_init(&gtwx5715_pci);
98 }
99 91
100 return 0; 92 return 0;
101} 93}