1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20#include <linux/kernel.h>
21#include <linux/pci.h>
22#include <linux/init.h>
23#include <linux/irq.h>
24
25#include <asm/mach-types.h>
26#include <mach/hardware.h>
27
28#include <asm/mach/pci.h>
29
30void __init wg302v2_pci_preinit(void)
31{
32 irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW);
33 irq_set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_LEVEL_LOW);
34
35 ixp4xx_pci_preinit();
36}
37
38static int __init wg302v2_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
39{
40 if (slot == 1)
41 return IRQ_IXP4XX_GPIO8;
42 else if (slot == 2)
43 return IRQ_IXP4XX_GPIO9;
44 else return -1;
45}
46
47struct hw_pci wg302v2_pci __initdata = {
48 .nr_controllers = 1,
49 .preinit = wg302v2_pci_preinit,
50 .swizzle = pci_std_swizzle,
51 .setup = ixp4xx_setup,
52 .scan = ixp4xx_scan_bus,
53 .map_irq = wg302v2_map_irq,
54};
55
56int __init wg302v2_pci_init(void)
57{
58 if (machine_is_wg302v2())
59 pci_common_init(&wg302v2_pci);
60 return 0;
61}
62
63subsys_initcall(wg302v2_pci_init);
64