Linux 2.6.31.6
[linux/fpc-iii.git] / arch / sh / boards / mach-landisk / irq.c
blob7b284cde1f586c93436a5bd6cf328b06936d4932
1 /*
2 * arch/sh/boards/landisk/irq.c
4 * I-O DATA Device, Inc. LANDISK Support
6 * Copyright (C) 2005-2007 kogiidena
8 * Copyright (C) 2001 Ian da Silva, Jeremy Siegel
9 * Based largely on io_se.c.
11 * This file is subject to the terms and conditions of the GNU General Public
12 * License. See the file "COPYING" in the main directory of this archive
13 * for more details.
15 #include <linux/init.h>
16 #include <linux/irq.h>
17 #include <linux/interrupt.h>
18 #include <linux/io.h>
19 #include <mach-landisk/mach/iodata_landisk.h>
21 static void disable_landisk_irq(unsigned int irq)
23 unsigned char mask = 0xff ^ (0x01 << (irq - 5));
25 ctrl_outb(ctrl_inb(PA_IMASK) & mask, PA_IMASK);
28 static void enable_landisk_irq(unsigned int irq)
30 unsigned char value = (0x01 << (irq - 5));
32 ctrl_outb(ctrl_inb(PA_IMASK) | value, PA_IMASK);
35 static struct irq_chip landisk_irq_chip __read_mostly = {
36 .name = "LANDISK",
37 .mask = disable_landisk_irq,
38 .unmask = enable_landisk_irq,
39 .mask_ack = disable_landisk_irq,
43 * Initialize IRQ setting
45 void __init init_landisk_IRQ(void)
47 int i;
49 for (i = 5; i < 14; i++) {
50 disable_irq_nosync(i);
51 set_irq_chip_and_handler_name(i, &landisk_irq_chip,
52 handle_level_irq, "level");
53 enable_landisk_irq(i);
55 ctrl_outb(0x00, PA_PWRINT_CLR);