Root/
1 | /* |
2 | * arch/arch/mach-ixp4xx/wg302v2-pci.c |
3 | * |
4 | * PCI setup routines for the Netgear WG302 v2 and WAG302 v2 |
5 | * |
6 | * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org> |
7 | * |
8 | * based on coyote-pci.c: |
9 | * Copyright (C) 2002 Jungo Software Technologies. |
10 | * Copyright (C) 2003 MontaVista Software, Inc. |
11 | * |
12 | * Maintainer: Imre Kaloz <kaloz@openwrt.org> |
13 | * |
14 | * This program is free software; you can redistribute it and/or modify |
15 | * it under the terms of the GNU General Public License version 2 as |
16 | * published by the Free Software Foundation. |
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 | |
30 | void __init wg302v2_pci_preinit(void) |
31 | { |
32 | set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); |
33 | set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_LEVEL_LOW); |
34 | |
35 | ixp4xx_pci_preinit(); |
36 | } |
37 | |
38 | static int __init wg302v2_map_irq(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 | |
47 | struct 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 | |
56 | int __init wg302v2_pci_init(void) |
57 | { |
58 | if (machine_is_wg302v2()) |
59 | pci_common_init(&wg302v2_pci); |
60 | return 0; |
61 | } |
62 | |
63 | subsys_initcall(wg302v2_pci_init); |
64 |
Branches:
ben-wpan
ben-wpan-stefan
javiroman/ks7010
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9