Feed the mess through indent.
[linux-2.6/linux-mips.git] / arch / mips / pci / fixup-tb0226.c
blob115385c18d422787e5058c4103663dcc30aef70b
1 /*
2 * FILE NAME
3 * arch/mips/vr41xx/tanbac-tb0226/pci_fixup.c
5 * BRIEF MODULE DESCRIPTION
6 * The TANBAC TB0226 specific PCI fixups.
8 * Copyright 2002,2003 Yoichi Yuasa
9 * yuasa@hh.iij4u.or.jp
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.
16 #include <linux/init.h>
17 #include <linux/pci.h>
19 #include <asm/vr41xx/tb0226.h>
21 void __init pcibios_fixup_resources(struct pci_dev *dev)
25 void __init pcibios_fixup(void)
29 void __init pcibios_fixup_irqs(void)
31 struct pci_dev *dev;
32 u8 slot, pin;
34 pci_for_each_dev(dev) {
35 slot = PCI_SLOT(dev->devfn);
36 dev->irq = 0;
38 switch (slot) {
39 case 12:
40 vr41xx_set_irq_trigger(GD82559_1_PIN,
41 TRIGGER_LEVEL,
42 SIGNAL_THROUGH);
43 vr41xx_set_irq_level(GD82559_1_PIN, LEVEL_LOW);
44 dev->irq = GD82559_1_IRQ;
45 break;
46 case 13:
47 vr41xx_set_irq_trigger(GD82559_2_PIN,
48 TRIGGER_LEVEL,
49 SIGNAL_THROUGH);
50 vr41xx_set_irq_level(GD82559_2_PIN, LEVEL_LOW);
51 dev->irq = GD82559_2_IRQ;
52 break;
53 case 14:
54 pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
55 switch (pin) {
56 case 1:
57 vr41xx_set_irq_trigger(UPD720100_INTA_PIN,
58 TRIGGER_LEVEL,
59 SIGNAL_THROUGH);
60 vr41xx_set_irq_level(UPD720100_INTA_PIN,
61 LEVEL_LOW);
62 dev->irq = UPD720100_INTA_IRQ;
63 break;
64 case 2:
65 vr41xx_set_irq_trigger(UPD720100_INTB_PIN,
66 TRIGGER_LEVEL,
67 SIGNAL_THROUGH);
68 vr41xx_set_irq_level(UPD720100_INTB_PIN,
69 LEVEL_LOW);
70 dev->irq = UPD720100_INTB_IRQ;
71 break;
72 case 3:
73 vr41xx_set_irq_trigger(UPD720100_INTC_PIN,
74 TRIGGER_LEVEL,
75 SIGNAL_THROUGH);
76 vr41xx_set_irq_level(UPD720100_INTC_PIN,
77 LEVEL_LOW);
78 dev->irq = UPD720100_INTC_IRQ;
79 break;
81 break;
84 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
88 unsigned int pcibios_assign_all_busses(void)
90 return 0;