Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 168498
b: refs/heads/master
c: c482ae4
h: refs/heads/master
v: v3
  • Loading branch information
Haojian Zhuang authored and Eric Miao committed Nov 3, 2009
1 parent 140e3a3 commit 0b8f7cb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 902805dbdae016653768f7139d7b3ab36a20cc6d
refs/heads/master: c482ae4dcf23fd241321595d71bbe8aee33eabf5
11 changes: 10 additions & 1 deletion trunk/arch/arm/mach-pxa/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

#include "generic.h"

#define MAX_INTERNAL_IRQS 128

#define IRQ_BIT(n) (((n) - PXA_IRQ(0)) & 0x1f)
#define _ICMR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICMR2 : &ICMR))
#define _ICLR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICLR2 : &ICLR))
Expand Down Expand Up @@ -122,6 +124,8 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
{
int irq, i;

BUG_ON(irq_nr > MAX_INTERNAL_IRQS);

pxa_internal_irq_nr = irq_nr;

for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq += 32) {
Expand Down Expand Up @@ -149,7 +153,8 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
}

#ifdef CONFIG_PM
static unsigned long saved_icmr[2];
static unsigned long saved_icmr[MAX_INTERNAL_IRQS/32];
static unsigned long saved_ipr[MAX_INTERNAL_IRQS];

static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state)
{
Expand All @@ -159,6 +164,8 @@ static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state)
saved_icmr[i] = _ICMR(irq);
_ICMR(irq) = 0;
}
for (i = 0; i < pxa_internal_irq_nr; i++)
saved_ipr[i] = IPR(i);

return 0;
}
Expand All @@ -171,6 +178,8 @@ static int pxa_irq_resume(struct sys_device *dev)
_ICMR(irq) = saved_icmr[i];
_ICLR(irq) = 0;
}
for (i = 0; i < pxa_internal_irq_nr; i++)
IPR(i) = saved_ipr[i];

ICCR = 1;
return 0;
Expand Down

0 comments on commit 0b8f7cb

Please sign in to comment.