2 * arch/sh/boards/landisk/irq.c
4 * Copyright (C) 2001 Ian da Silva, Jeremy Siegel
5 * Based largely on io_se.c.
7 * I/O routine for I-O Data Device, Inc. LANDISK.
9 * Initial version only to support LAN access; some
10 * placeholder code from io_landisk.c left in with the
11 * expectation of later SuperIO and PCMCIA access.
14 * modified by kogiidena
18 #include <linux/config.h>
19 #include <linux/init.h>
20 #include <linux/irq.h>
23 #include <asm/landisk/iodata_landisk.h>
25 static void enable_landisk_irq(unsigned int irq);
26 static void disable_landisk_irq(unsigned int irq);
28 /* shutdown is same as "disable" */
29 #define shutdown_landisk_irq disable_landisk_irq
31 static void ack_landisk_irq(unsigned int irq);
32 static void end_landisk_irq(unsigned int irq);
34 static unsigned int startup_landisk_irq(unsigned int irq)
36 enable_landisk_irq(irq);
37 return 0; /* never anything pending */
40 static void disable_landisk_irq(unsigned int irq)
43 unsigned char mask = 0xff ^ (0x01 << (irq - 5));
45 /* Set the priority in IPR to 0 */
46 val = ctrl_inb(PA_IMASK);
48 ctrl_outb(val, PA_IMASK);
51 static void enable_landisk_irq(unsigned int irq)
54 unsigned char value = (0x01 << (irq - 5));
56 /* Set priority in IPR back to original value */
57 val = ctrl_inb(PA_IMASK);
59 ctrl_outb(val, PA_IMASK);
62 static void ack_landisk_irq(unsigned int irq)
64 disable_landisk_irq(irq);
67 static void end_landisk_irq(unsigned int irq)
69 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
70 enable_landisk_irq(irq);
73 static struct hw_interrupt_type landisk_irq_type = {
74 .typename = "LANDISK IRQ",
75 .startup = startup_landisk_irq,
76 .shutdown = shutdown_landisk_irq,
77 .enable = enable_landisk_irq,
78 .disable = disable_landisk_irq,
79 .ack = ack_landisk_irq,
80 .end = end_landisk_irq
83 static void make_landisk_irq(unsigned int irq)
85 disable_irq_nosync(irq);
86 irq_desc[irq].handler = &landisk_irq_type;
87 disable_landisk_irq(irq);
91 * Initialize IRQ setting
93 void __init init_landisk_IRQ(void)
97 for (i = 5; i < 14; i++)