22 #include <linux/module.h>
25 #include <linux/device.h>
74 unsigned int irqno = data->
irq;
78 irqdbf2(
"s3c_irq_unmask %d\n", irqno);
83 mask &= ~(1
UL << irqno);
89 .irq_ack = s3c_irq_maskack,
90 .irq_mask = s3c_irq_mask,
91 .irq_unmask = s3c_irq_unmask,
97 .irq_ack = s3c_irq_ack,
98 .irq_mask = s3c_irq_mask,
99 .irq_unmask = s3c_irq_unmask,
104 s3c_irqext_mask(
struct irq_data *data)
110 mask |= ( 1
UL << irqno);
115 s3c_irqext_ack(
struct irq_data *data)
133 if ((req & 0xf0) == 0)
142 s3c_irqext_unmask(
struct irq_data *data)
148 mask &= ~(1
UL << irqno);
157 unsigned long gpcon_offset, extint_offset;
158 unsigned long newvalue = 0,
value;
186 value = (
value & ~(3 << gpcon_offset)) | (0x02 << gpcon_offset);
222 value = (
value & ~(7 << extint_offset)) | (newvalue << extint_offset);
228 static struct irq_chip s3c_irqext_chip = {
230 .irq_mask = s3c_irqext_mask,
231 .irq_unmask = s3c_irqext_unmask,
232 .irq_ack = s3c_irqext_ack,
237 static struct irq_chip s3c_irq_eint0t4 = {
239 .irq_ack = s3c_irq_ack,
240 .irq_mask = s3c_irq_mask,
241 .irq_unmask = s3c_irq_unmask,
248 #define INTMSK_UART0 (1UL << (IRQ_UART0 - IRQ_EINT0))
249 #define INTMSK_UART1 (1UL << (IRQ_UART1 - IRQ_EINT0))
250 #define INTMSK_UART2 (1UL << (IRQ_UART2 - IRQ_EINT0))
251 #define INTMSK_ADCPARENT (1UL << (IRQ_ADCPARENT - IRQ_EINT0))
257 s3c_irq_uart0_mask(
struct irq_data *data)
263 s3c_irq_uart0_unmask(
struct irq_data *data)
269 s3c_irq_uart0_ack(
struct irq_data *data)
274 static struct irq_chip s3c_irq_uart0 = {
276 .irq_mask = s3c_irq_uart0_mask,
277 .irq_unmask = s3c_irq_uart0_unmask,
278 .irq_ack = s3c_irq_uart0_ack,
284 s3c_irq_uart1_mask(
struct irq_data *data)
290 s3c_irq_uart1_unmask(
struct irq_data *data)
296 s3c_irq_uart1_ack(
struct irq_data *data)
301 static struct irq_chip s3c_irq_uart1 = {
303 .irq_mask = s3c_irq_uart1_mask,
304 .irq_unmask = s3c_irq_uart1_unmask,
305 .irq_ack = s3c_irq_uart1_ack,
311 s3c_irq_uart2_mask(
struct irq_data *data)
317 s3c_irq_uart2_unmask(
struct irq_data *data)
323 s3c_irq_uart2_ack(
struct irq_data *data)
328 static struct irq_chip s3c_irq_uart2 = {
330 .irq_mask = s3c_irq_uart2_mask,
331 .irq_unmask = s3c_irq_uart2_unmask,
332 .irq_ack = s3c_irq_uart2_ack,
355 static struct irq_chip s3c_irq_adc = {
357 .irq_mask = s3c_irq_adc_mask,
358 .irq_unmask = s3c_irq_adc_unmask,
359 .irq_ack = s3c_irq_adc_ack,
363 static void s3c_irq_demux_adc(
unsigned int irq,
366 unsigned int subsrc, submsk;
389 static void s3c_irq_demux_uart(
unsigned int start)
391 unsigned int subsrc, submsk;
400 irqdbf2(
"s3c_irq_demux_uart: start=%d (%d), subsrc=0x%08x,0x%08x\n",
401 start, offset, subsrc, submsk);
422 s3c_irq_demux_uart0(
unsigned int irq,
426 s3c_irq_demux_uart(IRQ_S3CUART_RX0);
430 s3c_irq_demux_uart1(
unsigned int irq,
438 s3c_irq_demux_uart2(
unsigned int irq,
446 s3c_irq_demux_extint8(
unsigned int irq,
458 irq =
__ffs(eintpnd);
459 eintpnd &= ~(1<<irq);
468 s3c_irq_demux_extint4t7(
unsigned int irq,
480 irq =
__ffs(eintpnd);
481 eintpnd &= ~(1<<irq);
539 irqdbf(
"s3c2410_init_irq: clearing interrupt status flags\n");
544 for (i = 0; i < 4; i++) {
547 if (pend == 0 || pend == last)
551 printk(
"irq: clearing pending ext status %08x\n", (
int)pend);
556 for (i = 0; i < 4; i++) {
559 if (pend == 0 || pend == last)
564 printk(
"irq: clearing pending status %08x\n", (
int)pend);
569 for (i = 0; i < 4; i++) {
572 if (pend == 0 || pend == last)
575 printk(
"irq: clearing subpending status %08x\n", (
int)pend);
582 irqdbf(
"s3c2410_init_irq: registering s3c2410 interrupt handlers\n");
596 irq_set_chip_and_handler(irqno, &s3c_irq_level_chip,
607 irq_set_chip_and_handler(irqno, &s3c_irq_chip,
615 irq_set_chained_handler(
IRQ_EINT4t7, s3c_irq_demux_extint4t7);
616 irq_set_chained_handler(
IRQ_EINT8t23, s3c_irq_demux_extint8);
618 irq_set_chained_handler(
IRQ_UART0, s3c_irq_demux_uart0);
619 irq_set_chained_handler(
IRQ_UART1, s3c_irq_demux_uart1);
620 irq_set_chained_handler(
IRQ_UART2, s3c_irq_demux_uart2);
626 irqdbf(
"registering irq %d (ext int)\n", irqno);
627 irq_set_chip_and_handler(irqno, &s3c_irq_eint0t4,
633 irqdbf(
"registering irq %d (extended s3c irq)\n", irqno);
634 irq_set_chip_and_handler(irqno, &s3c_irqext_chip,
641 irqdbf(
"s3c2410: registering external interrupts\n");
644 irqdbf(
"registering irq %d (s3c uart0 irq)\n", irqno);
645 irq_set_chip_and_handler(irqno, &s3c_irq_uart0,
651 irqdbf(
"registering irq %d (s3c uart1 irq)\n", irqno);
652 irq_set_chip_and_handler(irqno, &s3c_irq_uart1,
658 irqdbf(
"registering irq %d (s3c uart2 irq)\n", irqno);
659 irq_set_chip_and_handler(irqno, &s3c_irq_uart2,
665 irqdbf(
"registering irq %d (s3c adc irq)\n", irqno);
670 irqdbf(
"s3c2410: registered interrupt handlers\n");