diff options
author | Jouni Hogander <jouni.hogander@nokia.com> | 2009-02-03 15:49:04 -0800 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2009-05-28 10:59:04 -0700 |
commit | 94434535bd36ca010a81e1199f954beef2c4de64 (patch) | |
tree | 7abfddf6812d4b88bb4cc8bff5a6acbbc0664a1b /arch/arm/mach-omap2/irq.c | |
parent | 8bd229492209c0c7d050e2f9a600c12f035d72f7 (diff) | |
download | linux-3.10-94434535bd36ca010a81e1199f954beef2c4de64.tar.gz linux-3.10-94434535bd36ca010a81e1199f954beef2c4de64.tar.bz2 linux-3.10-94434535bd36ca010a81e1199f954beef2c4de64.zip |
OMAP: Add new function to check wether there is irq pending
Add common omap2/3 function to check wether there is irq pending.
Switch to use it in omap2 pm code instead of its own.
Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-omap2/irq.c')
-rw-r--r-- | arch/arm/mach-omap2/irq.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c index 08a3b99abe6..b82863887f1 100644 --- a/arch/arm/mach-omap2/irq.c +++ b/arch/arm/mach-omap2/irq.c @@ -28,7 +28,6 @@ #define INTC_MIR_CLEAR0 0x0088 #define INTC_MIR_SET0 0x008c #define INTC_PENDING_IRQ0 0x0098 - /* Number of IRQ state bits in each MIR register */ #define IRQ_BITS_PER_REG 32 @@ -156,6 +155,22 @@ static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank) intc_bank_write_reg(1 << 0, bank, INTC_SYSCONFIG); } +int omap_irq_pending(void) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(irq_banks); i++) { + struct omap_irq_bank *bank = irq_banks + i; + int irq; + + for (irq = 0; irq < bank->nr_irqs; irq += 32) + if (intc_bank_read_reg(bank, INTC_PENDING_IRQ0 + + ((irq >> 5) << 5))) + return 1; + } + return 0; +} + void __init omap_init_irq(void) { unsigned long nr_of_irqs = 0; |