| Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 1 | /* | 
|  | 2 | * arch/sh/drivers/pci/ops-landisk.c | 
|  | 3 | * | 
|  | 4 | * PCI initialization for the I-O DATA Device, Inc. LANDISK board | 
|  | 5 | * | 
|  | 6 | * Copyright (C) 2006 kogiidena | 
|  | 7 | * | 
|  | 8 | * May be copied or modified under the terms of the GNU General Public | 
|  | 9 | * License.  See linux/COPYING for more information. | 
|  | 10 | */ | 
| Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 11 | #include <linux/kernel.h> | 
|  | 12 | #include <linux/types.h> | 
|  | 13 | #include <linux/init.h> | 
|  | 14 | #include <linux/delay.h> | 
|  | 15 | #include <linux/pci.h> | 
|  | 16 | #include "pci-sh4.h" | 
|  | 17 |  | 
| Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 18 | int pcibios_map_platform_irq(struct pci_dev *pdev, u8 slot, u8 pin) | 
|  | 19 | { | 
|  | 20 | /* | 
|  | 21 | * slot0: pin1-4 = irq5,6,7,8 | 
|  | 22 | * slot1: pin1-4 = irq6,7,8,5 | 
|  | 23 | * slot2: pin1-4 = irq7,8,5,6 | 
|  | 24 | * slot3: pin1-4 = irq8,5,6,7 | 
|  | 25 | */ | 
|  | 26 | int irq = ((slot + pin - 1) & 0x3) + 5; | 
|  | 27 |  | 
|  | 28 | if ((slot | (pin - 1)) > 0x3) { | 
|  | 29 | printk("PCI: Bad IRQ mapping request for slot %d pin %c\n", | 
|  | 30 | slot, pin - 1 + 'A'); | 
|  | 31 | return -1; | 
|  | 32 | } | 
|  | 33 | return irq; | 
|  | 34 | } |