MOXA linux-2.6.x / linux-2.6.19-uc1 from UC-7110-LX-BOOTLOADER-1.9_VERSION-4.2.tgz
[linux-2.6.19-moxart.git] / arch / arm / mach-espd_4510b / irq.c
blob80f576b991725a738b6f2056e7229bc90c870c87
1 /*
2 * linux/arch/armnommu/mach-espd_4510b/irq.c
4 * Copyright (c) 2004 Cucy Systems (http://www.cucy.com)
5 * Curt Brune <curt@cucy.com>
7 * Copyright (C) 2003 SAMSUNG ELECTRONICS
8 * Hyok S. Choi (hyok.choi@samsung.com)
9 * based the codes by
10 * 2003 Thomas Eschenbacher <thomas.eschenbacher@gmx.de>
13 #include <linux/types.h>
14 #include <linux/sched.h>
15 #include <linux/interrupt.h>
16 #include <linux/types.h>
17 #include <linux/kernel.h>
18 #include <linux/init.h>
19 #include <linux/list.h>
20 #include <linux/device.h>
21 #include <linux/slab.h>
22 #include <linux/string.h>
23 #include <linux/sysdev.h>
25 #include <asm/hardware.h>
26 #include <asm/io.h>
27 #include <asm/irq.h>
28 #include <asm/setup.h>
29 #include <asm/mach-types.h>
31 #include <asm/mach/arch.h>
32 #include <asm/mach/irq.h>
33 #include <asm/mach/map.h>
35 static void __s3c4510b_mask_irq(unsigned int irq)
37 INT_DISABLE( irq);
40 static void __s3c4510b_unmask_irq(unsigned int irq)
42 INT_ENABLE( irq);
45 static void __s3c4510b_ack_irq(unsigned int irq)
47 /* Acknowledge, clear _AND_ disable the interrupt. */
48 INT_DISABLE( irq);
49 CLEAR_PEND_INT( irq);
52 static struct irqchip s3c4510b_chip = {
53 .ack = __s3c4510b_ack_irq,
54 .mask = __s3c4510b_mask_irq,
55 .unmask = __s3c4510b_unmask_irq,
58 #ifdef CONFIG_PM
59 static unsigned long ic_irq_enable;
61 static int irq_suspend(struct sys_device *dev, u32 state)
63 return 0;
66 static int irq_resume(struct sys_device *dev)
68 /* disable all irq sources */
69 return 0;
71 #else
72 #define irq_suspend NULL
73 #define irq_resume NULL
74 #endif
76 static struct sysdev_class irq_class = {
77 set_kset_name("irq"),
78 .suspend = irq_suspend,
79 .resume = irq_resume,
82 static struct sys_device irq_device = {
83 .id = 0,
84 .cls = &irq_class,
87 static int __init irq_init_sysfs(void)
89 int ret = sysdev_class_register(&irq_class);
90 if (ret == 0)
91 ret = sysdev_register(&irq_device);
92 return ret;
95 device_initcall(irq_init_sysfs);
97 void __init s3c4510b_init_irq(void)
99 int irq;
101 for (irq = 0; irq < NR_IRQS; irq++) {
102 set_irq_chip(irq, &s3c4510b_chip);
103 set_irq_handler(irq, do_level_IRQ);
104 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
107 /* mask and disable all further interrupts */
108 outl(INT_MASK_DIS, REG_INTMASK);
110 /* set all to IRQ mode, not FIQ */
111 outl(INT_MODE_IRQ, REG_INTMODE);
113 /* Clear Intrerrupt pending register */
114 outl( 0x1FFFFF, REG_INTPEND);
117 * enable the gloabal interrupt flag, this should be
118 * safe now, all sources are masked out and acknowledged
120 INT_ENABLE( INT_GLOBAL);