This source file includes following definitions.
- gtwx5715_pci_preinit
- gtwx5715_map_irq
- gtwx5715_pci_init
1
2
3
4
5
6
7
8
9
10
11 #include <linux/pci.h>
12 #include <linux/init.h>
13 #include <linux/delay.h>
14 #include <linux/irq.h>
15 #include <asm/mach-types.h>
16 #include <mach/hardware.h>
17 #include <asm/mach/pci.h>
18
19 #include "irqs.h"
20
21 #define SLOT0_DEVID 0
22 #define SLOT1_DEVID 1
23 #define INTA 10
24 #define INTB 11
25
26
27
28
29
30
31
32 void __init gtwx5715_pci_preinit(void)
33 {
34 irq_set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW);
35 irq_set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW);
36 ixp4xx_pci_preinit();
37 }
38
39
40 static int __init gtwx5715_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
41 {
42 int rc = -1;
43
44 if ((slot == SLOT0_DEVID && pin == 1) ||
45 (slot == SLOT1_DEVID && pin == 2))
46 rc = IXP4XX_GPIO_IRQ(INTA);
47 else if ((slot == SLOT0_DEVID && pin == 2) ||
48 (slot == SLOT1_DEVID && pin == 1))
49 rc = IXP4XX_GPIO_IRQ(INTB);
50
51 printk(KERN_INFO "%s: Mapped slot %d pin %d to IRQ %d\n",
52 __func__, slot, pin, rc);
53 return rc;
54 }
55
56 struct hw_pci gtwx5715_pci __initdata = {
57 .nr_controllers = 1,
58 .ops = &ixp4xx_ops,
59 .preinit = gtwx5715_pci_preinit,
60 .setup = ixp4xx_setup,
61 .map_irq = gtwx5715_map_irq,
62 };
63
64 int __init gtwx5715_pci_init(void)
65 {
66 if (machine_is_gtwx5715())
67 pci_common_init(>wx5715_pci);
68
69 return 0;
70 }
71
72 subsys_initcall(gtwx5715_pci_init);