Merge branch 'fix' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / arm / mach-nuc93x / irq.c
bloba7a88ea4ec31d41e42baa9568b8e0e194b5c47c0
1 /*
2 * linux/arch/arm/mach-nuc93x/irq.c
4 * Copyright (c) 2008 Nuvoton technology corporation.
6 * Wan ZongShun <mcuos.com@gmail.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation;version 2 of the License.
14 #include <linux/init.h>
15 #include <linux/module.h>
16 #include <linux/interrupt.h>
17 #include <linux/ioport.h>
18 #include <linux/ptrace.h>
19 #include <linux/sysdev.h>
20 #include <linux/io.h>
22 #include <asm/irq.h>
23 #include <asm/mach/irq.h>
25 #include <mach/hardware.h>
26 #include <mach/regs-irq.h>
28 static void nuc93x_irq_mask(unsigned int irq)
30 __raw_writel(1 << irq, REG_AIC_MDCR);
34 * By the w90p910 spec,any irq,only write 1
35 * to REG_AIC_EOSCR for ACK
38 static void nuc93x_irq_ack(unsigned int irq)
40 __raw_writel(0x01, REG_AIC_EOSCR);
43 static void nuc93x_irq_unmask(unsigned int irq)
45 __raw_writel(1 << irq, REG_AIC_MECR);
49 static struct irq_chip nuc93x_irq_chip = {
50 .ack = nuc93x_irq_ack,
51 .mask = nuc93x_irq_mask,
52 .unmask = nuc93x_irq_unmask,
55 void __init nuc93x_init_irq(void)
57 int irqno;
59 __raw_writel(0xFFFFFFFE, REG_AIC_MDCR);
61 for (irqno = IRQ_WDT; irqno <= NR_IRQS; irqno++) {
62 set_irq_chip(irqno, &nuc93x_irq_chip);
63 set_irq_handler(irqno, handle_level_irq);
64 set_irq_flags(irqno, IRQF_VALID);