aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-s3c.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-s3c.c')
-rw-r--r--drivers/rtc/rtc-s3c.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index 7afd373b9595..c4cde9c08f1f 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -580,10 +580,12 @@ static int s3c_rtc_suspend(struct device *dev)
580 580
581 clk_enable(rtc_clk); 581 clk_enable(rtc_clk);
582 /* save TICNT for anyone using periodic interrupts */ 582 /* save TICNT for anyone using periodic interrupts */
583 ticnt_save = readb(s3c_rtc_base + S3C2410_TICNT);
584 if (s3c_rtc_cpu_type == TYPE_S3C64XX) { 583 if (s3c_rtc_cpu_type == TYPE_S3C64XX) {
585 ticnt_en_save = readw(s3c_rtc_base + S3C2410_RTCCON); 584 ticnt_en_save = readw(s3c_rtc_base + S3C2410_RTCCON);
586 ticnt_en_save &= S3C64XX_RTCCON_TICEN; 585 ticnt_en_save &= S3C64XX_RTCCON_TICEN;
586 ticnt_save = readl(s3c_rtc_base + S3C2410_TICNT);
587 } else {
588 ticnt_save = readb(s3c_rtc_base + S3C2410_TICNT);
587 } 589 }
588 s3c_rtc_enable(pdev, 0); 590 s3c_rtc_enable(pdev, 0);
589 591
@@ -605,10 +607,15 @@ static int s3c_rtc_resume(struct device *dev)
605 607
606 clk_enable(rtc_clk); 608 clk_enable(rtc_clk);
607 s3c_rtc_enable(pdev, 1); 609 s3c_rtc_enable(pdev, 1);
608 writeb(ticnt_save, s3c_rtc_base + S3C2410_TICNT); 610 if (s3c_rtc_cpu_type == TYPE_S3C64XX) {
609 if (s3c_rtc_cpu_type == TYPE_S3C64XX && ticnt_en_save) { 611 writel(ticnt_save, s3c_rtc_base + S3C2410_TICNT);
610 tmp = readw(s3c_rtc_base + S3C2410_RTCCON); 612 if (ticnt_en_save) {
611 writew(tmp | ticnt_en_save, s3c_rtc_base + S3C2410_RTCCON); 613 tmp = readw(s3c_rtc_base + S3C2410_RTCCON);
614 writew(tmp | ticnt_en_save,
615 s3c_rtc_base + S3C2410_RTCCON);
616 }
617 } else {
618 writeb(ticnt_save, s3c_rtc_base + S3C2410_TICNT);
612 } 619 }
613 620
614 if (device_may_wakeup(dev) && wake_en) { 621 if (device_may_wakeup(dev) && wake_en) {