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
15 #include <linux/init.h>
16 #include <linux/irq.h>
17 #include <linux/interrupt.h>
19 #include <asm/landisk/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 = {
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)
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);