From patchwork Tue Sep 7 05:29:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kukjin Kim X-Patchwork-Id: 63968 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-fx0-f56.google.com (mail-fx0-f56.google.com [209.85.161.56]) by ozlabs.org (Postfix) with ESMTP id F2E8DB70AB for ; Tue, 7 Sep 2010 15:46:50 +1000 (EST) Received: by fxm6 with SMTP id 6sf1388745fxm.11 for ; Mon, 06 Sep 2010 22:46:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:mime-version:x-beenthere:received :received:received:received:received-spf:received:received:from:to :cc:subject:date:message-id:x-mailer:in-reply-to:references :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :sender:list-subscribe:list-unsubscribe:content-type; bh=bSjpo1l4KUVXRNvJgnlDqig3Yw6oeSb9qcjiqIsumUo=; b=2HKIEAXPZy12FyUHUc9KRwPfVx9ZG4UrWHPVFddx1BTTViaCbeHURFe6F2cxbVkbR1 Jayj8sqe/fEnr3WBLtjMnvjtcMS9xOBn4hZ9nuqQoG/K6l0nUATLyXJ80hqBuJHu84cd iC1koVVxN8yWJTx5ZVcZy8d6A87y2ggjYifIU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=mime-version:x-beenthere:received-spf:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type; b=D4sMJgzcLPiGIjcuTdQwqgqrT85T+nFd7s42U97Lh6kPVtVdBWKQhEZ80DPOuHA9fb NYjW4cZt4iw02ZirWQifdK8xZcgCoiw3gHm4ywdObMYZ0AF9Ys5uXO/wwdjPk+o3gJxv BpCOl2ZSgbvuW7v++K/jmo3v5Utfqs05uOIps= Received: by 10.223.30.74 with SMTP id t10mr129149fac.31.1283838408474; Mon, 06 Sep 2010 22:46:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.223.32.142 with SMTP id c14ls1100823fad.2.p; Mon, 06 Sep 2010 22:46:48 -0700 (PDT) Received: by 10.223.117.83 with SMTP id p19mr54727faq.3.1283838407996; Mon, 06 Sep 2010 22:46:47 -0700 (PDT) Received: by 10.223.117.83 with SMTP id p19mr54726faq.3.1283838407969; Mon, 06 Sep 2010 22:46:47 -0700 (PDT) Received: from ganesha.gnumonks.org (ganesha.gnumonks.org [213.95.27.120]) by gmr-mx.google.com with ESMTP id q13si1698225faa.15.2010.09.06.22.46.47; Mon, 06 Sep 2010 22:46:47 -0700 (PDT) Received-SPF: neutral (google.com: 213.95.27.120 is neither permitted nor denied by best guess record for domain of kgene.kim@samsung.com) client-ip=213.95.27.120; Received: from uucp by ganesha.gnumonks.org with local-bsmtp (Exim 4.69) (envelope-from ) id 1Osr10-0005vC-HM; Tue, 07 Sep 2010 07:46:42 +0200 Received: from [12.23.102.184] (helo=localhost.localdomain) by jackpot.kr.gnumonks.org with esmtp (Exim 4.69) (envelope-from ) id 1Osq4z-0004LV-LE; Tue, 07 Sep 2010 13:46:45 +0900 From: Kukjin Kim 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 , Kukjin Kim Subject: [rtc-linux] [PATCH 1/5] rtc: rtc-s3c: Fix access unit from byte to word on RTCCON Date: Tue, 7 Sep 2010 14:29:37 +0900 Message-Id: <1283837381-9575-2-git-send-email-kgene.kim@samsung.com> X-Mailer: git-send-email 1.6.2.5 In-Reply-To: <1283837381-9575-1-git-send-email-kgene.kim@samsung.com> References: <1283837381-9575-1-git-send-email-kgene.kim@samsung.com> X-Original-Sender: kgene.kim@samsung.com X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 213.95.27.120 is neither permitted nor denied by best guess record for domain of kgene.kim@samsung.com) smtp.mail=kgene.kim@samsung.com Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , From: Changhwan Youn 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 Signed-off-by: Kukjin Kim Cc: Ben Dooks --- 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; }