diff options
author | Krzysztof Hałasa <khc@pm.waw.pl> | 2009-11-17 12:48:23 -0500 |
---|---|---|
committer | Krzysztof Hałasa <khc@pm.waw.pl> | 2009-12-05 10:58:41 -0500 |
commit | 8d3fdf31dd2066533861bb57ed7df1ae1b1f5fcc (patch) | |
tree | 5186d63c67dee5454348e55cf46d31053672d67d /arch/arm/mach-ixp4xx/gtwx5715-pci.c | |
parent | a8b7b34075f693632cd1483b817d4211c7a63257 (diff) |
IXP4xx: Introduce IXP4XX_GPIO_IRQ(n) macro and convert IXP4xx platform files.
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Diffstat (limited to 'arch/arm/mach-ixp4xx/gtwx5715-pci.c')
-rw-r--r-- | arch/arm/mach-ixp4xx/gtwx5715-pci.c | 52 |
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 | */ |
54 | void __init gtwx5715_pci_preinit(void) | 50 | void __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) | |||
65 | static int __init gtwx5715_map_irq(struct pci_dev *dev, u8 slot, u8 pin) | 60 | static 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 | ||
84 | struct hw_pci gtwx5715_pci __initdata = { | 78 | struct hw_pci gtwx5715_pci __initdata = { |
@@ -93,9 +87,7 @@ struct hw_pci gtwx5715_pci __initdata = { | |||
93 | int __init gtwx5715_pci_init(void) | 87 | int __init gtwx5715_pci_init(void) |
94 | { | 88 | { |
95 | if (machine_is_gtwx5715()) | 89 | if (machine_is_gtwx5715()) |
96 | { | ||
97 | pci_common_init(>wx5715_pci); | 90 | pci_common_init(>wx5715_pci); |
98 | } | ||
99 | 91 | ||
100 | return 0; | 92 | return 0; |
101 | } | 93 | } |