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)
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>
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
)
40 static void __s3c4510b_unmask_irq(unsigned int irq
)
45 static void __s3c4510b_ack_irq(unsigned int irq
)
47 /* Acknowledge, clear _AND_ disable the interrupt. */
52 static struct irqchip s3c4510b_chip
= {
53 .ack
= __s3c4510b_ack_irq
,
54 .mask
= __s3c4510b_mask_irq
,
55 .unmask
= __s3c4510b_unmask_irq
,
59 static unsigned long ic_irq_enable
;
61 static int irq_suspend(struct sys_device
*dev
, u32 state
)
66 static int irq_resume(struct sys_device
*dev
)
68 /* disable all irq sources */
72 #define irq_suspend NULL
73 #define irq_resume NULL
76 static struct sysdev_class irq_class
= {
78 .suspend
= irq_suspend
,
82 static struct sys_device irq_device
= {
87 static int __init
irq_init_sysfs(void)
89 int ret
= sysdev_class_register(&irq_class
);
91 ret
= sysdev_register(&irq_device
);
95 device_initcall(irq_init_sysfs
);
97 void __init
s3c4510b_init_irq(void)
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
);