|
@@ -580,10 +580,12 @@ static int s3c_rtc_suspend(struct device *dev)
|
|
|
|
|
|
clk_enable(rtc_clk);
|
|
|
/* save TICNT for anyone using periodic interrupts */
|
|
|
- ticnt_save = readb(s3c_rtc_base + S3C2410_TICNT);
|
|
|
if (s3c_rtc_cpu_type == TYPE_S3C64XX) {
|
|
|
ticnt_en_save = readw(s3c_rtc_base + S3C2410_RTCCON);
|
|
|
ticnt_en_save &= S3C64XX_RTCCON_TICEN;
|
|
|
+ ticnt_save = readl(s3c_rtc_base + S3C2410_TICNT);
|
|
|
+ } else {
|
|
|
+ ticnt_save = readb(s3c_rtc_base + S3C2410_TICNT);
|
|
|
}
|
|
|
s3c_rtc_enable(pdev, 0);
|
|
|
|
|
@@ -605,10 +607,15 @@ static int s3c_rtc_resume(struct device *dev)
|
|
|
|
|
|
clk_enable(rtc_clk);
|
|
|
s3c_rtc_enable(pdev, 1);
|
|
|
- writeb(ticnt_save, s3c_rtc_base + S3C2410_TICNT);
|
|
|
- if (s3c_rtc_cpu_type == TYPE_S3C64XX && ticnt_en_save) {
|
|
|
- tmp = readw(s3c_rtc_base + S3C2410_RTCCON);
|
|
|
- writew(tmp | ticnt_en_save, s3c_rtc_base + S3C2410_RTCCON);
|
|
|
+ if (s3c_rtc_cpu_type == TYPE_S3C64XX) {
|
|
|
+ writel(ticnt_save, s3c_rtc_base + S3C2410_TICNT);
|
|
|
+ if (ticnt_en_save) {
|
|
|
+ tmp = readw(s3c_rtc_base + S3C2410_RTCCON);
|
|
|
+ writew(tmp | ticnt_en_save,
|
|
|
+ s3c_rtc_base + S3C2410_RTCCON);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ writeb(ticnt_save, s3c_rtc_base + S3C2410_TICNT);
|
|
|
}
|
|
|
|
|
|
if (device_may_wakeup(dev) && wake_en) {
|