Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
[linux-2.6/kvm.git] / include / asm-arm / plat-s3c24xx / irq.h
blob8af6d9579b31c975bd86ca6e2e6c1c2ed62ab4f9
1 /* linux/include/asm-arm/plat-s3c24xx/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.
13 #define irqdbf(x...)
14 #define irqdbf2(x...)
16 #define EXTINT_OFF (IRQ_EINT4 - 4)
18 extern struct irq_chip s3c_irq_level_chip;
20 static inline void
21 s3c_irqsub_mask(unsigned int irqno, unsigned int parentbit,
22 int subcheck)
24 unsigned long mask;
25 unsigned long submask;
27 submask = __raw_readl(S3C2410_INTSUBMSK);
28 mask = __raw_readl(S3C2410_INTMSK);
30 submask |= (1UL << (irqno - IRQ_S3CUART_RX0));
32 /* check to see if we need to mask the parent IRQ */
34 if ((submask & subcheck) == subcheck) {
35 __raw_writel(mask | parentbit, S3C2410_INTMSK);
38 /* write back masks */
39 __raw_writel(submask, S3C2410_INTSUBMSK);
43 static inline void
44 s3c_irqsub_unmask(unsigned int irqno, unsigned int parentbit)
46 unsigned long mask;
47 unsigned long submask;
49 submask = __raw_readl(S3C2410_INTSUBMSK);
50 mask = __raw_readl(S3C2410_INTMSK);
52 submask &= ~(1UL << (irqno - IRQ_S3CUART_RX0));
53 mask &= ~parentbit;
55 /* write back masks */
56 __raw_writel(submask, S3C2410_INTSUBMSK);
57 __raw_writel(mask, S3C2410_INTMSK);
61 static inline void
62 s3c_irqsub_maskack(unsigned int irqno, unsigned int parentmask, unsigned int group)
64 unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
66 s3c_irqsub_mask(irqno, parentmask, group);
68 __raw_writel(bit, S3C2410_SUBSRCPND);
70 /* only ack parent if we've got all the irqs (seems we must
71 * ack, all and hope that the irq system retriggers ok when
72 * the interrupt goes off again)
75 if (1) {
76 __raw_writel(parentmask, S3C2410_SRCPND);
77 __raw_writel(parentmask, S3C2410_INTPND);
81 static inline void
82 s3c_irqsub_ack(unsigned int irqno, unsigned int parentmask, unsigned int group)
84 unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
86 __raw_writel(bit, S3C2410_SUBSRCPND);
88 /* only ack parent if we've got all the irqs (seems we must
89 * ack, all and hope that the irq system retriggers ok when
90 * the interrupt goes off again)
93 if (1) {
94 __raw_writel(parentmask, S3C2410_SRCPND);
95 __raw_writel(parentmask, S3C2410_INTPND);
99 /* exported for use in arch/arm/mach-s3c2410 */
101 #ifdef CONFIG_PM
102 extern int s3c_irq_wake(unsigned int irqno, unsigned int state);
103 #else
104 #define s3c_irq_wake NULL
105 #endif
107 extern int s3c_irqext_type(unsigned int irq, unsigned int type);