2 * arch/arch/mach-ixp4xx/wg302v2-pci.c
4 * PCI setup routines for the Netgear WG302 v2 and WAG302 v2
6 * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org>
8 * based on coyote-pci.c:
9 * Copyright (C) 2002 Jungo Software Technologies.
10 * Copyright (C) 2003 MontaVista Software, Inc.
12 * Maintainer: Imre Kaloz <kaloz@openwrt.org>
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.
20 #include <linux/kernel.h>
21 #include <linux/pci.h>
22 #include <linux/init.h>
23 #include <linux/irq.h>
25 #include <asm/mach-types.h>
26 #include <asm/hardware.h>
29 #include <asm/mach/pci.h>
31 void __init wg302v2_pci_preinit(void)
33 set_irq_type(IRQ_IXP4XX_GPIO8, IRQT_LOW);
34 set_irq_type(IRQ_IXP4XX_GPIO9, IRQT_LOW);
39 static int __init wg302v2_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
42 return IRQ_IXP4XX_GPIO8;
44 return IRQ_IXP4XX_GPIO9;
48 struct hw_pci wg302v2_pci __initdata = {
50 .preinit = wg302v2_pci_preinit,
51 .swizzle = pci_std_swizzle,
52 .setup = ixp4xx_setup,
53 .scan = ixp4xx_scan_bus,
54 .map_irq = wg302v2_map_irq,
57 int __init wg302v2_pci_init(void)
59 if (machine_is_wg302v2())
60 pci_common_init(&wg302v2_pci);
64 subsys_initcall(wg302v2_pci_init);