1 /* arch/arm/mach-s3c2410/irq.h
3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
6 * Header file for S3C24XX CPU IRQ support
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
18 #define EXTINT_OFF (IRQ_EINT4 - 4)
20 extern struct irq_chip s3c_irq_level_chip;
23 s3c_irqsub_mask(unsigned int irqno, unsigned int parentbit,
27 unsigned long submask;
29 submask = __raw_readl(S3C2410_INTSUBMSK);
30 mask = __raw_readl(S3C2410_INTMSK);
32 submask |= (1UL << (irqno - IRQ_S3CUART_RX0));
34 /* check to see if we need to mask the parent IRQ */
36 if ((submask & subcheck) == subcheck) {
37 __raw_writel(mask | parentbit, S3C2410_INTMSK);
40 /* write back masks */
41 __raw_writel(submask, S3C2410_INTSUBMSK);
46 s3c_irqsub_unmask(unsigned int irqno, unsigned int parentbit)
49 unsigned long submask;
51 submask = __raw_readl(S3C2410_INTSUBMSK);
52 mask = __raw_readl(S3C2410_INTMSK);
54 submask &= ~(1UL << (irqno - IRQ_S3CUART_RX0));
57 /* write back masks */
58 __raw_writel(submask, S3C2410_INTSUBMSK);
59 __raw_writel(mask, S3C2410_INTMSK);
64 s3c_irqsub_maskack(unsigned int irqno, unsigned int parentmask, unsigned int group)
66 unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
68 s3c_irqsub_mask(irqno, parentmask, group);
70 __raw_writel(bit, S3C2410_SUBSRCPND);
72 /* only ack parent if we've got all the irqs (seems we must
73 * ack, all and hope that the irq system retriggers ok when
74 * the interrupt goes off again)
78 __raw_writel(parentmask, S3C2410_SRCPND);
79 __raw_writel(parentmask, S3C2410_INTPND);
84 s3c_irqsub_ack(unsigned int irqno, unsigned int parentmask, unsigned int group)
86 unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
88 __raw_writel(bit, S3C2410_SUBSRCPND);
90 /* only ack parent if we've got all the irqs (seems we must
91 * ack, all and hope that the irq system retriggers ok when
92 * the interrupt goes off again)
96 __raw_writel(parentmask, S3C2410_SRCPND);
97 __raw_writel(parentmask, S3C2410_INTPND);
101 /* exported for use in arch/arm/mach-s3c2410 */
104 extern int s3c_irq_wake(unsigned int irqno, unsigned int state);
106 #define s3c_irq_wake NULL
109 extern int s3c_irqext_type(unsigned int irq, unsigned int type);