/*1* Toshiba rbtx4938 pci routines2* Copyright (C) 2000-2001 Toshiba Corporation3*4* 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the5* terms of the GNU General Public License version 2. This program is6* licensed "as is" without any warranty of any kind, whether express7* or implied.8*9* Support for TX4938 in 2.6 - Manish Lachwani ([email protected])10*/11#include <linux/types.h>12#include <asm/txx9/pci.h>13#include <asm/txx9/rbtx4938.h>1415int __init rbtx4938_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)16{17int irq = tx4938_pcic1_map_irq(dev, slot);1819if (irq >= 0)20return irq;21irq = pin;22/* IRQ rotation */23irq--; /* 0-3 */24if (slot == TX4927_PCIC_IDSEL_AD_TO_SLOT(23)) {25/* PCI CardSlot (IDSEL=A23) */26/* PCIA => PCIA (IDSEL=A23) */27irq = (irq + 0 + slot) % 4;28} else {29/* PCI Backplane */30if (txx9_pci_option & TXX9_PCI_OPT_PICMG)31irq = (irq + 33 - slot) % 4;32else33irq = (irq + 3 + slot) % 4;34}35irq++; /* 1-4 */3637switch (irq) {38case 1:39irq = RBTX4938_IRQ_IOC_PCIA;40break;41case 2:42irq = RBTX4938_IRQ_IOC_PCIB;43break;44case 3:45irq = RBTX4938_IRQ_IOC_PCIC;46break;47case 4:48irq = RBTX4938_IRQ_IOC_PCID;49break;50}51return irq;52}535455