]> git.ipfire.org Git - thirdparty/linux.git/blame - arch/arm/mach-ixp4xx/gateway7001-pci.c
ARM: ixp4xx: Convert to SPARSE_IRQ
[thirdparty/linux.git] / arch / arm / mach-ixp4xx / gateway7001-pci.c
CommitLineData
46918bd1
IK
1/*
2 * arch/arch/mach-ixp4xx/gateway7001-pci.c
3 *
4 * PCI setup routines for Gateway 7001
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 Softwrae, 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>
a09e64fb 26#include <mach/hardware.h>
46918bd1
IK
27
28#include <asm/mach/pci.h>
29
dc8ef8cd
LW
30#include "irqs.h"
31
46918bd1
IK
32void __init gateway7001_pci_preinit(void)
33{
6845664a
TG
34 irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW);
35 irq_set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW);
46918bd1
IK
36
37 ixp4xx_pci_preinit();
38}
39
d5341942
RB
40static int __init gateway7001_map_irq(const struct pci_dev *dev, u8 slot,
41 u8 pin)
46918bd1
IK
42{
43 if (slot == 1)
44 return IRQ_IXP4XX_GPIO11;
45 else if (slot == 2)
46 return IRQ_IXP4XX_GPIO10;
47 else return -1;
48}
49
50struct hw_pci gateway7001_pci __initdata = {
51 .nr_controllers = 1,
c23bfc38 52 .ops = &ixp4xx_ops,
46918bd1 53 .preinit = gateway7001_pci_preinit,
46918bd1 54 .setup = ixp4xx_setup,
46918bd1
IK
55 .map_irq = gateway7001_map_irq,
56};
57
58int __init gateway7001_pci_init(void)
59{
60 if (machine_is_gateway7001())
61 pci_common_init(&gateway7001_pci);
62 return 0;
63}
64
65subsys_initcall(gateway7001_pci_init);