aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards/mach-landisk/irq.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2008-07-29 08:01:19 -0400
committerPaul Mundt <lethal@linux-sh.org>2008-07-29 08:01:19 -0400
commitda2014a2b080e7f3024a4eb6917d47069ad9620b (patch)
treecfde12c6d4b5baa222966b14a676f107992cf786 /arch/sh/boards/mach-landisk/irq.c
parent71b8064e7df5698520d73b4c1566a3dbc98eb9ef (diff)
sh: Shuffle the board directories in to mach groups.
This flattens out the board directories in to individual mach groups, we will use this for getting rid of unneeded directories, simplifying the build system, and becoming more coherent with the refactored arch/sh/include topology. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards/mach-landisk/irq.c')
-rw-r--r--arch/sh/boards/mach-landisk/irq.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/arch/sh/boards/mach-landisk/irq.c b/arch/sh/boards/mach-landisk/irq.c
new file mode 100644
index 000000000000..d0f9378f6ff4
--- /dev/null
+++ b/arch/sh/boards/mach-landisk/irq.c
@@ -0,0 +1,56 @@
1/*
2 * arch/sh/boards/landisk/irq.c
3 *
4 * I-O DATA Device, Inc. LANDISK Support
5 *
6 * Copyright (C) 2005-2007 kogiidena
7 *
8 * Copyright (C) 2001 Ian da Silva, Jeremy Siegel
9 * Based largely on io_se.c.
10 *
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.
14 */
15#include <linux/init.h>
16#include <linux/irq.h>
17#include <linux/interrupt.h>
18#include <linux/io.h>
19#include <mach/iodata_landisk.h>
20
21static void disable_landisk_irq(unsigned int irq)
22{
23 unsigned char mask = 0xff ^ (0x01 << (irq - 5));
24
25 ctrl_outb(ctrl_inb(PA_IMASK) & mask, PA_IMASK);
26}
27
28static void enable_landisk_irq(unsigned int irq)
29{
30 unsigned char value = (0x01 << (irq - 5));
31
32 ctrl_outb(ctrl_inb(PA_IMASK) | value, PA_IMASK);
33}
34
35static 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,
40};
41
42/*
43 * Initialize IRQ setting
44 */
45void __init init_landisk_IRQ(void)
46{
47 int i;
48
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);
54 }
55 ctrl_outb(0x00, PA_PWRINT_CLR);
56}