aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ixp4xx/avila-pci.c
diff options
context:
space:
mode:
authorKrzysztof Hałasa <khc@pm.waw.pl>2009-11-17 12:48:23 -0500
committerKrzysztof Hałasa <khc@pm.waw.pl>2009-12-05 10:58:41 -0500
commit8d3fdf31dd2066533861bb57ed7df1ae1b1f5fcc (patch)
tree5186d63c67dee5454348e55cf46d31053672d67d /arch/arm/mach-ixp4xx/avila-pci.c
parenta8b7b34075f693632cd1483b817d4211c7a63257 (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/avila-pci.c')
-rw-r--r--arch/arm/mach-ixp4xx/avila-pci.c50
1 files changed, 20 insertions, 30 deletions
diff --git a/arch/arm/mach-ixp4xx/avila-pci.c b/arch/arm/mach-ixp4xx/avila-pci.c
index 14df8cf49146..845e1b500548 100644
--- a/arch/arm/mach-ixp4xx/avila-pci.c
+++ b/arch/arm/mach-ixp4xx/avila-pci.c
@@ -27,49 +27,40 @@
27#include <mach/hardware.h> 27#include <mach/hardware.h>
28#include <asm/mach-types.h> 28#include <asm/mach-types.h>
29 29
30#define AVILA_PCI_MAX_DEV 4 30#define AVILA_MAX_DEV 4
31#define LOFT_PCI_MAX_DEV 6 31#define LOFT_MAX_DEV 6
32#define AVILA_PCI_IRQ_LINES 4 32#define IRQ_LINES 4
33 33
34/* PCI controller GPIO to IRQ pin mappings */ 34/* PCI controller GPIO to IRQ pin mappings */
35#define AVILA_PCI_INTA_PIN 11 35#define INTA 11
36#define AVILA_PCI_INTB_PIN 10 36#define INTB 10
37#define AVILA_PCI_INTC_PIN 9 37#define INTC 9
38#define AVILA_PCI_INTD_PIN 8 38#define INTD 8
39
40#define IRQ_AVILA_PCI_INTA IRQ_IXP4XX_GPIO11
41#define IRQ_AVILA_PCI_INTB IRQ_IXP4XX_GPIO10
42#define IRQ_AVILA_PCI_INTC IRQ_IXP4XX_GPIO9
43#define IRQ_AVILA_PCI_INTD IRQ_IXP4XX_GPIO8
44 39
45void __init avila_pci_preinit(void) 40void __init avila_pci_preinit(void)
46{ 41{
47 set_irq_type(IRQ_AVILA_PCI_INTA, IRQ_TYPE_LEVEL_LOW); 42 set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW);
48 set_irq_type(IRQ_AVILA_PCI_INTB, IRQ_TYPE_LEVEL_LOW); 43 set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW);
49 set_irq_type(IRQ_AVILA_PCI_INTC, IRQ_TYPE_LEVEL_LOW); 44 set_irq_type(IXP4XX_GPIO_IRQ(INTC), IRQ_TYPE_LEVEL_LOW);
50 set_irq_type(IRQ_AVILA_PCI_INTD, IRQ_TYPE_LEVEL_LOW); 45 set_irq_type(IXP4XX_GPIO_IRQ(INTD), IRQ_TYPE_LEVEL_LOW);
51
52 ixp4xx_pci_preinit(); 46 ixp4xx_pci_preinit();
53} 47}
54 48
55static int __init avila_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 49static int __init avila_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
56{ 50{
57 static int pci_irq_table[AVILA_PCI_IRQ_LINES] = { 51 static int pci_irq_table[IRQ_LINES] = {
58 IRQ_AVILA_PCI_INTA, 52 IXP4XX_GPIO_IRQ(INTA),
59 IRQ_AVILA_PCI_INTB, 53 IXP4XX_GPIO_IRQ(INTB),
60 IRQ_AVILA_PCI_INTC, 54 IXP4XX_GPIO_IRQ(INTC),
61 IRQ_AVILA_PCI_INTD 55 IXP4XX_GPIO_IRQ(INTD)
62 }; 56 };
63 57
64 int irq = -1;
65
66 if (slot >= 1 && 58 if (slot >= 1 &&
67 slot <= (machine_is_loft() ? LOFT_PCI_MAX_DEV : AVILA_PCI_MAX_DEV) && 59 slot <= (machine_is_loft() ? LOFT_MAX_DEV : AVILA_MAX_DEV) &&
68 pin >= 1 && pin <= AVILA_PCI_IRQ_LINES) { 60 pin >= 1 && pin <= IRQ_LINES)
69 irq = pci_irq_table[(slot + pin - 2) % 4]; 61 return pci_irq_table[(slot + pin - 2) % 4];
70 }
71 62
72 return irq; 63 return -1;
73} 64}
74 65
75struct hw_pci avila_pci __initdata = { 66struct hw_pci avila_pci __initdata = {
@@ -89,4 +80,3 @@ int __init avila_pci_init(void)
89} 80}
90 81
91subsys_initcall(avila_pci_init); 82subsys_initcall(avila_pci_init);
92