Linux Audio

Check our new training course

Loading...
v3.5.6
 
 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
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	.ops = &ixp4xx_ops,
50	.preinit =        wg302v2_pci_preinit,
51	.setup =          ixp4xx_setup,
52	.map_irq =        wg302v2_map_irq,
53};
54
55int __init wg302v2_pci_init(void)
56{
57	if (machine_is_wg302v2())
58		pci_common_init(&wg302v2_pci);
59	return 0;
60}
61
62subsys_initcall(wg302v2_pci_init);
v5.4
 1// SPDX-License-Identifier: GPL-2.0-only
 2/*
 3 * arch/arch/mach-ixp4xx/wg302v2-pci.c
 4 *
 5 * PCI setup routines for the Netgear WG302 v2 and WAG302 v2
 6 *
 7 * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org>
 8 *
 9 * based on coyote-pci.c:
10 *	Copyright (C) 2002 Jungo Software Technologies.
11 *	Copyright (C) 2003 MontaVista Software, Inc.
12 *
13 * Maintainer: Imre Kaloz <kaloz@openwrt.org>
 
 
 
 
 
14 */
15
16#include <linux/kernel.h>
17#include <linux/pci.h>
18#include <linux/init.h>
19#include <linux/irq.h>
20
21#include <asm/mach-types.h>
22#include <mach/hardware.h>
23
24#include <asm/mach/pci.h>
25
26#include "irqs.h"
27
28void __init wg302v2_pci_preinit(void)
29{
30	irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW);
31	irq_set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_LEVEL_LOW);
32
33	ixp4xx_pci_preinit();
34}
35
36static int __init wg302v2_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
37{
38	if (slot == 1)
39		return IRQ_IXP4XX_GPIO8;
40	else if (slot == 2)
41		return IRQ_IXP4XX_GPIO9;
42	else return -1;
43}
44
45struct hw_pci wg302v2_pci __initdata = {
46	.nr_controllers = 1,
47	.ops = &ixp4xx_ops,
48	.preinit =        wg302v2_pci_preinit,
49	.setup =          ixp4xx_setup,
50	.map_irq =        wg302v2_map_irq,
51};
52
53int __init wg302v2_pci_init(void)
54{
55	if (machine_is_wg302v2())
56		pci_common_init(&wg302v2_pci);
57	return 0;
58}
59
60subsys_initcall(wg302v2_pci_init);