Commit 051fe54e authored by Taekgyun Ko's avatar Taekgyun Ko Committed by Kukjin Kim

rtc: rtc-s3c: Add BCD register initialization codes

RTC needs to be initialized when BCD registers have invalid value.
Signed-off-by: default avatarTaekgyun Ko <taeggyun.ko@samsung.com>
Signed-off-by: default avatarKukjin Kim <kgene.kim@samsung.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Acked-by: default avatarAlessandro Zummo <a.zummo@towertech.it>
parent 2f3478f6
...@@ -458,6 +458,7 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev) ...@@ -458,6 +458,7 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
{ {
struct rtc_device *rtc; struct rtc_device *rtc;
struct resource *res; struct resource *res;
unsigned int tmp, i;
int ret; int ret;
pr_debug("%s: probe=%p\n", __func__, pdev); pr_debug("%s: probe=%p\n", __func__, pdev);
...@@ -536,6 +537,15 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev) ...@@ -536,6 +537,15 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data; s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
/* Check RTC Time */
for (i = S3C2410_RTCSEC; i <= S3C2410_RTCYEAR; i += 0x4) {
tmp = readb(s3c_rtc_base + i);
if ((tmp & 0xf) > 0x9 || ((tmp >> 4) & 0xf) > 0x9)
writeb(0, s3c_rtc_base + i);
}
if (s3c_rtc_cpu_type == TYPE_S3C64XX) if (s3c_rtc_cpu_type == TYPE_S3C64XX)
rtc->max_user_freq = 32768; rtc->max_user_freq = 32768;
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment