linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: kgene.kim@samsung.com (Kukjin Kim)
To: linux-arm-kernel@lists.infradead.org
Subject: [rtc-linux] [PATCH 3/3] rtc: rtc-s3c: Add BCD register initialization codes
Date: Fri, 23 Jul 2010 16:34:43 +0900	[thread overview]
Message-ID: <006501cb2a39$8b06eb20$a114c160$%kim@samsung.com> (raw)
In-Reply-To: <AANLkTinHlD1fC_Es6P7mcX4-_STNoYxV4wmsKe6KAw_N@mail.gmail.com>

Wan ZongShun wrote:
> 
> 2010/7/21 Kukjin Kim <kgene.kim@samsung.com>:
> > From: Taekgyun Ko <taeggyun.ko@samsung.com>
> >
> > RTC needs to be initialized when BCD registers have invalid value.
> 
> Do you mean that the hardware register does not have default value?
> Any results if no initialized value here?
> 
Hi,

Yes..I mean that it has no default value.
As you know, it has to be keep the previous time value after reset..and the reset value is not defined.

So added check that functionality, because if it has no valid BCD value, RTC time does not move on.
Of course, if we set time at that time, RTC works well...I mean just need initialize that.

> >
> > Signed-off-by: Taekgyun Ko <taeggyun.ko@samsung.com>
> > Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> > ---
> >  drivers/rtc/rtc-s3c.c |   14 ++++++++++++--
> >  1 files changed, 12 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
> > index 2040017..e96e109 100644
> > --- a/drivers/rtc/rtc-s3c.c
> > +++ b/drivers/rtc/rtc-s3c.c
> > @@ -536,10 +536,20 @@ static int __devinit s3c_rtc_probe(struct
> platform_device *pdev)
> >
> >        s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
> >
> > -       if (s3c_rtc_cpu_type == TYPE_S3C64XX)
> > +       if (s3c_rtc_cpu_type == TYPE_S3C64XX) {
> >                rtc->max_user_freq = 32768;
> > -       else
> > +
> > +               /* 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);
> > +               }
> > +       } else {
> >                rtc->max_user_freq = 128;
> > +       }
> >
> >        platform_set_drvdata(pdev, rtc);
> >
> > --
> > 1.6.2.5
> >


Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

  reply	other threads:[~2010-07-23  7:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-21  8:57 [PATCH 0/3] Updates RTC driver for Samsung S3C64XX and newer SoCs Kukjin Kim
2010-07-21  8:57 ` [PATCH 1/3] ARM: SAMSUNG: Updates RTC register for support Alarm IRQ and Time Tick Kukjin Kim
2010-07-21  8:57 ` [PATCH 2/3] rtc: rtc-s3c: Updates driver for S3C64XX and newer SoCs Kukjin Kim
2010-07-21  8:57 ` [PATCH 3/3] rtc: rtc-s3c: Add BCD register initialization codes Kukjin Kim
2010-07-21 14:42   ` Sergei Shtylyov
2010-07-23  7:04     ` Kukjin Kim
2010-07-22  1:50   ` [rtc-linux] " Wan ZongShun
2010-07-23  7:34     ` Kukjin Kim [this message]
2010-07-23  9:28       ` Wan ZongShun
2010-07-27 13:11         ` Kukjin Kim
2010-07-28 18:17   ` Ben Dooks
2010-07-29  1:55     ` Kukjin Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='006501cb2a39$8b06eb20$a114c160$%kim@samsung.com' \
    --to=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).