2006-09-27 13:53:35 +08:00
|
|
|
/*
|
|
|
|
* arch/sh/boards/landisk/irq.c
|
|
|
|
*
|
2007-03-19 15:24:12 +08:00
|
|
|
* I-O DATA Device, Inc. LANDISK Support
|
|
|
|
*
|
|
|
|
* Copyright (C) 2005-2007 kogiidena
|
|
|
|
*
|
2006-09-27 13:53:35 +08:00
|
|
|
* Copyright (C) 2001 Ian da Silva, Jeremy Siegel
|
|
|
|
* Based largely on io_se.c.
|
|
|
|
*
|
2007-03-19 15:24:12 +08:00
|
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
|
|
* for more details.
|
2006-09-27 13:53:35 +08:00
|
|
|
*/
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/irq.h>
|
2006-12-07 16:27:18 +08:00
|
|
|
#include <linux/interrupt.h>
|
|
|
|
#include <linux/io.h>
|
2006-09-27 13:53:35 +08:00
|
|
|
#include <asm/landisk/iodata_landisk.h>
|
|
|
|
|
|
|
|
static void disable_landisk_irq(unsigned int irq)
|
|
|
|
{
|
|
|
|
unsigned char mask = 0xff ^ (0x01 << (irq - 5));
|
|
|
|
|
2007-03-19 15:24:12 +08:00
|
|
|
ctrl_outb(ctrl_inb(PA_IMASK) & mask, PA_IMASK);
|
2006-09-27 13:53:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void enable_landisk_irq(unsigned int irq)
|
|
|
|
{
|
|
|
|
unsigned char value = (0x01 << (irq - 5));
|
|
|
|
|
2007-03-19 15:24:12 +08:00
|
|
|
ctrl_outb(ctrl_inb(PA_IMASK) | value, PA_IMASK);
|
2006-09-27 13:53:35 +08:00
|
|
|
}
|
|
|
|
|
2007-03-19 15:24:12 +08:00
|
|
|
static struct irq_chip landisk_irq_chip __read_mostly = {
|
|
|
|
.name = "LANDISK",
|
|
|
|
.mask = disable_landisk_irq,
|
|
|
|
.unmask = enable_landisk_irq,
|
|
|
|
.mask_ack = disable_landisk_irq,
|
2006-09-27 13:53:35 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Initialize IRQ setting
|
|
|
|
*/
|
|
|
|
void __init init_landisk_IRQ(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
2007-03-19 15:24:12 +08:00
|
|
|
for (i = 5; i < 14; i++) {
|
|
|
|
disable_irq_nosync(i);
|
|
|
|
set_irq_chip_and_handler_name(i, &landisk_irq_chip,
|
|
|
|
handle_level_irq, "level");
|
|
|
|
enable_landisk_irq(i);
|
|
|
|
}
|
|
|
|
ctrl_outb(0x00, PA_PWRINT_CLR);
|
2006-09-27 13:53:35 +08:00
|
|
|
}
|