2 * linux/arch/arm/mach-ks8695/irq.c
4 * Copyright (C) 2002 Micrel Inc.
5 * Copyright (C) 2006 Greg Ungerer <gerg@snapgear.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include <linux/init.h>
23 #include <linux/interrupt.h>
24 #include <asm/hardware.h>
27 #include <asm/mach/irq.h>
29 static void ks8695_irq_mask(unsigned int irq
)
32 msk
= __raw_readl(KS8695_REG(KS8695_INT_ENABLE
));
34 __raw_writel(msk
, KS8695_REG(KS8695_INT_ENABLE
));
37 static void ks8695_irq_unmask(unsigned int irq
)
40 msk
= __raw_readl(KS8695_REG(KS8695_INT_ENABLE
));
42 __raw_writel(msk
, KS8695_REG(KS8695_INT_ENABLE
));
45 static int ks8695_irq_set_type(unsigned int irq
, unsigned int type
)
50 struct irqchip ks8695_irq_chip
= {
51 .ack
= ks8695_irq_mask
,
52 .mask
= ks8695_irq_mask
,
53 .unmask
= ks8695_irq_unmask
,
54 .set_type
= ks8695_irq_set_type
,
57 void __init
ks8695_init_irq(void)
61 /* Disable all interrupts initially. */
62 __raw_writel(0, KS8695_REG(KS8695_INT_CONTL
));
63 __raw_writel(0, KS8695_REG(KS8695_INT_ENABLE
));
65 for (i
= 0; (i
< NR_IRQS
); i
++) {
66 set_irq_chip(i
, &ks8695_irq_chip
);
67 set_irq_handler(i
, do_level_IRQ
);
68 set_irq_flags(i
, IRQF_VALID
);