2 * linux/arch/sh/boards/renesas/rts7751r2d/irq.c
4 * Copyright (C) 2000 Kazumoto Kojima
6 * Renesas Technology Sales RTS7751R2D Support.
8 * Modified for RTS7751R2D by
9 * Atom Create Engineering Co., Ltd. 2002.
11 #include <linux/init.h>
12 #include <linux/interrupt.h>
13 #include <linux/irq.h>
14 #include <linux/interrupt.h>
16 #include <asm/rts7751r2d.h>
18 #if defined(CONFIG_RTS7751R2D_REV11)
19 static int mask_pos[] = {11, 9, 8, 12, 10, 6, 5, 4, 7, 14, 13, 0, 0, 0, 0};
21 static int mask_pos[] = {6, 11, 9, 8, 12, 10, 5, 4, 7, 14, 13, 0, 0, 0, 0};
24 extern int voyagergx_irq_demux(int irq);
25 extern void setup_voyagergx_irq(void);
27 static void enable_rts7751r2d_irq(unsigned int irq)
29 /* Set priority in IPR back to original value */
30 ctrl_outw(ctrl_inw(IRLCNTR1) | (1 << mask_pos[irq]), IRLCNTR1);
33 static void disable_rts7751r2d_irq(unsigned int irq)
35 /* Set the priority in IPR to 0 */
36 ctrl_outw(ctrl_inw(IRLCNTR1) & (0xffff ^ (1 << mask_pos[irq])),
40 int rts7751r2d_irq_demux(int irq)
42 return voyagergx_irq_demux(irq);
45 static struct irq_chip rts7751r2d_irq_chip __read_mostly = {
47 .mask = disable_rts7751r2d_irq,
48 .unmask = enable_rts7751r2d_irq,
49 .mask_ack = disable_rts7751r2d_irq,
53 * Initialize IRQ setting
55 void __init init_rts7751r2d_IRQ(void)
76 for (i=0; i<15; i++) {
77 disable_irq_nosync(i);
78 set_irq_chip_and_handler_name(i, &rts7751r2d_irq_chip,
79 handle_level_irq, "level");
80 enable_rts7751r2d_irq(i);
83 setup_voyagergx_irq();