aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-s3c.c
diff options
context:
space:
mode:
authorTaekgyun Ko <taeggyun.ko@samsung.com>2010-07-29 00:00:42 -0400
committerKukjin Kim <kgene.kim@samsung.com>2010-08-05 05:32:51 -0400
commit051fe54e9f8c568dc9cd288b630d436ee93afe35 (patch)
tree43cba5cae8a90661f56ac4f8466cd9f7baca73fb /drivers/rtc/rtc-s3c.c
parent2f3478f6579b3f8d4579b6d49d7a8e9376c48fc2 (diff)
rtc: rtc-s3c: Add BCD register initialization codes
RTC needs to be initialized when BCD registers have invalid value. Signed-off-by: Taekgyun Ko <taeggyun.ko@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> Cc: Ben Dooks <ben-linux@fluff.org> Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Diffstat (limited to 'drivers/rtc/rtc-s3c.c')
-rw-r--r--drivers/rtc/rtc-s3c.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index 204001769ebc..a0d3ec89d412 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -458,6 +458,7 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
458{ 458{
459 struct rtc_device *rtc; 459 struct rtc_device *rtc;
460 struct resource *res; 460 struct resource *res;
461 unsigned int tmp, i;
461 int ret; 462 int ret;
462 463
463 pr_debug("%s: probe=%p\n", __func__, pdev); 464 pr_debug("%s: probe=%p\n", __func__, pdev);
@@ -536,6 +537,15 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
536 537
537 s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data; 538 s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
538 539
540 /* Check RTC Time */
541
542 for (i = S3C2410_RTCSEC; i <= S3C2410_RTCYEAR; i += 0x4) {
543 tmp = readb(s3c_rtc_base + i);
544
545 if ((tmp & 0xf) > 0x9 || ((tmp >> 4) & 0xf) > 0x9)
546 writeb(0, s3c_rtc_base + i);
547 }
548
539 if (s3c_rtc_cpu_type == TYPE_S3C64XX) 549 if (s3c_rtc_cpu_type == TYPE_S3C64XX)
540 rtc->max_user_freq = 32768; 550 rtc->max_user_freq = 32768;
541 else 551 else