Skip to content

Commit

Permalink
[ARM] pxa: fix irq suspend/resume for pxa25x
Browse files Browse the repository at this point in the history
PXA25x does not have IPR registers, saving and restoring should happen
only for pxa27x and pxa3xx.

Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
  • Loading branch information
Eric Miao committed Jan 13, 2010
1 parent 463de20 commit c70f5a6
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions arch/arm/mach-pxa/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,11 @@ 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);

if (cpu_is_pxa27x() || cpu_is_pxa3xx()) {
for (i = 0; i < pxa_internal_irq_nr; i++)
saved_ipr[i] = IPR(i);
}

return 0;
}
Expand All @@ -174,12 +177,15 @@ static int pxa_irq_resume(struct sys_device *dev)
{
int i, irq = PXA_IRQ(0);

if (cpu_is_pxa27x() || cpu_is_pxa3xx()) {
for (i = 0; i < pxa_internal_irq_nr; i++)
IPR(i) = saved_ipr[i];
}

for (i = 0; irq < PXA_IRQ(pxa_internal_irq_nr); i++, irq += 32) {
_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 c70f5a6

Please sign in to comment.