From patchwork Thu Aug 4 13:44:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak Saxena X-Patchwork-Id: 1035692 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p74Dj9jU016890 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 4 Aug 2011 13:45:30 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QoyEH-00037G-9n; Thu, 04 Aug 2011 13:44:54 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QoyEG-0006uc-I5; Thu, 04 Aug 2011 13:44:52 +0000 Received: from plexity.net ([206.123.115.38]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QoyE1-0006rq-OJ for linux-arm-kernel@lists.infradead.org; Thu, 04 Aug 2011 13:44:38 +0000 Received: by plexity.net (Postfix, from userid 1000) id 3E60A20C2B; Thu, 4 Aug 2011 06:44:37 -0700 (PDT) Date: Thu, 4 Aug 2011 06:44:37 -0700 From: Deepak Saxena To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 01/12] ARM: Remove LATCH reference for time-acorn.c Message-ID: <20110804134437.GB919@plexity.net> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110804_094437_899858_C56390C2 X-CRM114-Status: GOOD ( 12.18 ) X-Spam-Score: -0.8 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.8 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Nicolas Pitre , rmk@arm.linux.org.uk X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: dsaxena@plexity.net List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 04 Aug 2011 13:46:41 +0000 (UTC) As part of work to remove the global CLOCK_TICK_RATE symbol, this patch defines a sub-arch local value for use by the time-acorn.c file. This is only used when mach-rpc is built and the tick rate was taken from that sub-arch's timex.h header. Signed-off-by: Deepak Saxena --- arch/arm/common/time-acorn.c | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/arch/arm/common/time-acorn.c b/arch/arm/common/time-acorn.c index deeed56..0cc3a0d 100644 --- a/arch/arm/common/time-acorn.c +++ b/arch/arm/common/time-acorn.c @@ -24,6 +24,9 @@ #include +#define ACORN_TICK_RATE 2000000 +#define ACORN_TIMER_LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) + unsigned long ioc_timer_gettimeoffset(void) { unsigned int count1, count2, status; @@ -46,23 +49,23 @@ unsigned long ioc_timer_gettimeoffset(void) * and count2. */ if (status & (1 << 5)) - offset -= LATCH; + offset -= ACORN_TIMER_LATCH; } else if (count2 > count1) { /* * We have just had another interrupt between reading * count1 and count2. */ - offset -= LATCH; + offset -= ACORN_TIMER_LATCH; } - offset = (LATCH - offset) * (tick_nsec / 1000); - return (offset + LATCH/2) / LATCH; + offset = (ACORN_TIMER_LATCH - offset) * (tick_nsec / 1000); + return (offset + ACORN_TIMER_LATCH/2) / ACORN_TIMER_LATCH; } void __init ioctime_init(void) { - ioc_writeb(LATCH & 255, IOC_T0LTCHL); - ioc_writeb(LATCH >> 8, IOC_T0LTCHH); + ioc_writeb(ACORN_TIMER_LATCH & 255, IOC_T0LTCHL); + ioc_writeb(ACORN_TIMER_LATCH >> 8, IOC_T0LTCHH); ioc_writeb(0, IOC_T0GO); }