aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s3c2410/irq.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-s3c2410/irq.c')
-rw-r--r--arch/arm/mach-s3c2410/irq.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c2410/irq.c b/arch/arm/mach-s3c2410/irq.c
index cd6139b35999..9c7463bf8f86 100644
--- a/arch/arm/mach-s3c2410/irq.c
+++ b/arch/arm/mach-s3c2410/irq.c
@@ -586,6 +586,59 @@ s3c_irq_demux_extint(unsigned int irq,
586 } 586 }
587} 587}
588 588
589#ifdef CONFIG_PM
590
591static struct sleep_save irq_save[] = {
592 SAVE_ITEM(S3C2410_INTMSK),
593 SAVE_ITEM(S3C2410_INTSUBMSK),
594};
595
596/* the extint values move between the s3c2410/s3c2440 and the s3c2412
597 * so we use an array to hold them, and to calculate the address of
598 * the register at run-time
599*/
600
601static unsigned long save_extint[3];
602static unsigned long save_eintflt[4];
603static unsigned long save_eintmask;
604
605int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state)
606{
607 unsigned int i;
608
609 for (i = 0; i < ARRAY_SIZE(save_extint); i++)
610 save_extint[i] = __raw_readl(S3C24XX_EXTINT0 + (i*4));
611
612 for (i = 0; i < ARRAY_SIZE(save_eintflt); i++)
613 save_eintflt[i] = __raw_readl(S3C24XX_EINFLT0 + (i*4));
614
615 s3c2410_pm_do_save(irq_save, ARRAY_SIZE(irq_save));
616 save_eintmask = __raw_readl(S3C24XX_EINTMASK);
617
618 return 0;
619}
620
621int s3c24xx_irq_resume(struct sys_device *dev)
622{
623 unsigned int i;
624
625 for (i = 0; i < ARRAY_SIZE(save_extint); i++)
626 __raw_writel(save_extint[i], S3C24XX_EXTINT0 + (i*4));
627
628 for (i = 0; i < ARRAY_SIZE(save_eintflt); i++)
629 __raw_writel(save_eintflt[i], S3C24XX_EINFLT0 + (i*4));
630
631 s3c2410_pm_do_restore(irq_save, ARRAY_SIZE(irq_save));
632 __raw_writel(save_eintmask, S3C24XX_EINTMASK);
633
634 return 0;
635}
636
637#else
638#define s3c24xx_irq_suspend NULL
639#define s3c24xx_irq_resume NULL
640#endif
641
589/* s3c24xx_init_irq 642/* s3c24xx_init_irq
590 * 643 *
591 * Initialise S3C2410 IRQ system 644 * Initialise S3C2410 IRQ system