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
17 #include <linux/init.h>
18 #include <linux/irq.h>
21 #include <asm/landisk/iodata_landisk.h>
23 static void enable_landisk_irq(unsigned int irq);
24 static void disable_landisk_irq(unsigned int irq);
26 /* shutdown is same as "disable" */
27 #define shutdown_landisk_irq disable_landisk_irq
29 static void ack_landisk_irq(unsigned int irq);
30 static void end_landisk_irq(unsigned int irq);
32 static unsigned int startup_landisk_irq(unsigned int irq)
34 enable_landisk_irq(irq);
35 return 0; /* never anything pending */
38 static void disable_landisk_irq(unsigned int irq)
41 unsigned char mask = 0xff ^ (0x01 << (irq - 5));
43 /* Set the priority in IPR to 0 */
44 val = ctrl_inb(PA_IMASK);
46 ctrl_outb(val, PA_IMASK);
49 static void enable_landisk_irq(unsigned int irq)
52 unsigned char value = (0x01 << (irq - 5));
54 /* Set priority in IPR back to original value */
55 val = ctrl_inb(PA_IMASK);
57 ctrl_outb(val, PA_IMASK);
60 static void ack_landisk_irq(unsigned int irq)
62 disable_landisk_irq(irq);
65 static void end_landisk_irq(unsigned int irq)
67 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
68 enable_landisk_irq(irq);
71 static struct hw_interrupt_type landisk_irq_type = {
72 .typename = "LANDISK IRQ",
73 .startup = startup_landisk_irq,
74 .shutdown = shutdown_landisk_irq,
75 .enable = enable_landisk_irq,
76 .disable = disable_landisk_irq,
77 .ack = ack_landisk_irq,
78 .end = end_landisk_irq
81 static void make_landisk_irq(unsigned int irq)
83 disable_irq_nosync(irq);
84 irq_desc[irq].chip = &landisk_irq_type;
85 disable_landisk_irq(irq);
89 * Initialize IRQ setting
91 void __init init_landisk_IRQ(void)
95 for (i = 5; i < 14; i++)