1 // SPDX-License-Identifier: GPL-2.0-only
3 * arch/arch/mach-ixp4xx/wg302v2-pci.c
5 * PCI setup routines for the Netgear WG302 v2 and WAG302 v2
7 * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org>
9 * based on coyote-pci.c:
10 * Copyright (C) 2002 Jungo Software Technologies.
11 * Copyright (C) 2003 MontaVista Software, Inc.
13 * Maintainer: Imre Kaloz <kaloz@openwrt.org>
16 #include <linux/kernel.h>
17 #include <linux/pci.h>
18 #include <linux/init.h>
19 #include <linux/irq.h>
21 #include <asm/mach-types.h>
22 #include <mach/hardware.h>
24 #include <asm/mach/pci.h>
28 void __init wg302v2_pci_preinit(void)
30 irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW);
31 irq_set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_LEVEL_LOW);
36 static int __init wg302v2_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
39 return IRQ_IXP4XX_GPIO8;
41 return IRQ_IXP4XX_GPIO9;
45 struct hw_pci wg302v2_pci __initdata = {
48 .preinit = wg302v2_pci_preinit,
49 .setup = ixp4xx_setup,
50 .map_irq = wg302v2_map_irq,
53 int __init wg302v2_pci_init(void)
55 if (machine_is_wg302v2())
56 pci_common_init(&wg302v2_pci);
60 subsys_initcall(wg302v2_pci_init);