ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / arch / mips / pci / fixup-victor-mpc30x.c
1 /*
2  * FILE NAME
3  *      arch/mips/vr41xx/victor-mpc30x/pci_fixup.c
4  *
5  * BRIEF MODULE DESCRIPTION
6  *      The Victor MP-C303/304 specific PCI fixups.
7  *
8  * Copyright 2002 Yoichi Yuasa
9  *                yuasa@hh.iij4u.or.jp
10  *
11  *  This program is free software; you can redistribute it and/or modify it
12  *  under the terms of the GNU General Public License as published by the
13  *  Free Software Foundation; either version 2 of the License, or (at your
14  *  option) any later version.
15  */
16 #include <linux/init.h>
17 #include <linux/pci.h>
18
19 #include <asm/vr41xx/vrc4173.h>
20 #include <asm/vr41xx/mpc30x.h>
21
22 /*
23  * Shortcuts
24  */
25 #define PCMCIA1 VRC4173_PCMCIA1_IRQ
26 #define PCMCIA2 VRC4173_PCMCIA2_IRQ
27 #define MQ      MQ200_IRQ
28
29 static const int internal_func_irqs[8] __initdata = {
30         VRC4173_CASCADE_IRQ,
31         VRC4173_AC97_IRQ,
32         VRC4173_USB_IRQ,
33         
34 };
35
36 static char irq_tab_mpc30x[][5] __initdata = {
37  [12] = { PCMCIA1, PCMCIA1, 0, 0 },
38  [13] = { PCMCIA2, PCMCIA2, 0, 0 },
39  [29] = {      MQ,      MQ, 0, 0 },             /* mediaQ MQ-200 */
40 };
41
42 int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
43 {
44         if (slot == 30)
45                 return internal_func_irqs[PCI_FUNC(dev->devfn)];
46
47         return irq_tab_mpc30x[slot][pin];
48 }