From: Kukjin Kim <kgene.kim@samsung.com>
To: linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org, rtc-linux@googlegroups.com
Cc: ben-linux@fluff.org, p_gortmaker@yahoo.com, a.zummo@towertech.it,
Changhwan Youn <chaos.youn@samsung.com>,
Kukjin Kim <kgene.kim@samsung.com>
Subject: [PATCH 1/5] rtc: rtc-s3c: Fix access unit from byte to word on RTCCON
Date: Tue, 7 Sep 2010 14:29:37 +0900 [thread overview]
Message-ID: <1283837381-9575-2-git-send-email-kgene.kim@samsung.com> (raw)
In-Reply-To: <1283837381-9575-1-git-send-email-kgene.kim@samsung.com>
From: Changhwan Youn <chaos.youn@samsung.com>
S3C2410_RTCCON of TYPE_S3C64XX RTC should be read/written by readw and writew,
because TYPE_S3C64XX RTC uses bit8 and bit9.
Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Cc: Ben Dooks <ben-linux@fluff.org>
---
drivers/rtc/rtc-s3c.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index a0d3ec8..557a538 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -100,7 +100,7 @@ static int s3c_rtc_setpie(struct device *dev, int enabled)
spin_lock_irq(&s3c_rtc_pie_lock);
if (s3c_rtc_cpu_type == TYPE_S3C64XX) {
- tmp = readb(s3c_rtc_base + S3C2410_RTCCON);
+ tmp = readw(s3c_rtc_base + S3C2410_RTCCON);
tmp &= ~S3C64XX_RTCCON_TICEN;
if (enabled)
@@ -323,7 +323,7 @@ static int s3c_rtc_proc(struct device *dev, struct seq_file *seq)
unsigned int ticnt;
if (s3c_rtc_cpu_type == TYPE_S3C64XX) {
- ticnt = readb(s3c_rtc_base + S3C2410_RTCCON);
+ ticnt = readw(s3c_rtc_base + S3C2410_RTCCON);
ticnt &= S3C64XX_RTCCON_TICEN;
} else {
ticnt = readb(s3c_rtc_base + S3C2410_TICNT);
@@ -396,11 +396,11 @@ static void s3c_rtc_enable(struct platform_device *pdev, int en)
return;
if (!en) {
- tmp = readb(base + S3C2410_RTCCON);
+ tmp = readw(base + S3C2410_RTCCON);
if (s3c_rtc_cpu_type == TYPE_S3C64XX)
tmp &= ~S3C64XX_RTCCON_TICEN;
tmp &= ~S3C2410_RTCCON_RTCEN;
- writeb(tmp, base + S3C2410_RTCCON);
+ writew(tmp, base + S3C2410_RTCCON);
if (s3c_rtc_cpu_type == TYPE_S3C2410) {
tmp = readb(base + S3C2410_TICNT);
@@ -519,8 +519,8 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
s3c_rtc_enable(pdev, 1);
- pr_debug("s3c2410_rtc: RTCCON=%02x\n",
- readb(s3c_rtc_base + S3C2410_RTCCON));
+ pr_debug("s3c2410_rtc: RTCCON=%02x\n",
+ readw(s3c_rtc_base + S3C2410_RTCCON));
device_init_wakeup(&pdev->dev, 1);
@@ -583,7 +583,7 @@ static int s3c_rtc_suspend(struct platform_device *pdev, pm_message_t state)
/* 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 = readb(s3c_rtc_base + S3C2410_RTCCON);
+ ticnt_en_save = readw(s3c_rtc_base + S3C2410_RTCCON);
ticnt_en_save &= S3C64XX_RTCCON_TICEN;
}
s3c_rtc_enable(pdev, 0);
@@ -597,8 +597,8 @@ static int s3c_rtc_resume(struct platform_device *pdev)
s3c_rtc_enable(pdev, 1);
writeb(ticnt_save, s3c_rtc_base + S3C2410_TICNT);
if (s3c_rtc_cpu_type == TYPE_S3C64XX && ticnt_en_save) {
- tmp = readb(s3c_rtc_base + S3C2410_RTCCON);
- writeb(tmp | ticnt_en_save, s3c_rtc_base + S3C2410_RTCCON);
+ tmp = readw(s3c_rtc_base + S3C2410_RTCCON);
+ writew(tmp | ticnt_en_save, s3c_rtc_base + S3C2410_RTCCON);
}
return 0;
}
--
1.6.2.5
next prev parent reply other threads:[~2010-09-07 5:46 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-07 5:29 [PATCH 0/5] rtc: rtc-s3c: Fix RTC bugs for RTC-S3C Kukjin Kim
2010-09-07 5:29 ` Kukjin Kim [this message]
2010-09-07 23:17 ` [PATCH 1/5] rtc: rtc-s3c: Fix access unit from byte to word on RTCCON Ben Dooks
2010-09-07 5:29 ` [PATCH 2/5] rtc: rtc-s3c: Fix setting missing field of getalarm Kukjin Kim
2010-09-07 23:21 ` Ben Dooks
2010-09-07 5:29 ` [PATCH 3/5] rtc: rtc-s3c: Fix on support RTC Alarm Kukjin Kim
2010-09-07 23:22 ` Ben Dooks
2010-09-07 5:29 ` [PATCH 4/5] rtc: rtc-s3c: Fix on RTC initialization method Kukjin Kim
2010-09-07 8:56 ` Kyungmin Park
2010-09-07 23:24 ` Ben Dooks
2010-09-08 1:55 ` Wan ZongShun
2010-09-09 1:03 ` Kukjin Kim
2010-09-09 1:04 ` Kukjin Kim
2010-09-07 5:29 ` [PATCH 5/5] rtc: rtc-s3c: Fix debug message format on RTC Kukjin Kim
2010-09-07 23:29 ` Ben Dooks
2010-09-09 1:11 ` Kukjin Kim
2010-09-10 9:05 ` [rtc-linux] " Wan ZongShun
2010-09-10 11:38 ` Kukjin Kim
2010-09-10 23:23 ` Andrew Morton
2010-09-10 23:35 ` Kukjin Kim
2010-10-07 23:16 ` Kukjin Kim
2010-10-07 23:28 ` Andrew Morton
2010-10-07 23:46 ` 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=1283837381-9575-2-git-send-email-kgene.kim@samsung.com \
--to=kgene.kim@samsung.com \
--cc=a.zummo@towertech.it \
--cc=ben-linux@fluff.org \
--cc=chaos.youn@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=p_gortmaker@yahoo.com \
--cc=rtc-linux@googlegroups.com \
/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