From patchwork Thu Aug 4 13:49:05 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak Saxena X-Patchwork-Id: 1035672 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p74DnG9x027741 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 4 Aug 2011 13:49:42 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QoyIO-0004l0-Tc; Thu, 04 Aug 2011 13:49:09 +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 1QoyIO-00077W-EG; Thu, 04 Aug 2011 13:49:08 +0000 Received: from plexity.net ([206.123.115.38]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QoyIM-00077E-3f for linux-arm-kernel@lists.infradead.org; Thu, 04 Aug 2011 13:49:06 +0000 Received: by plexity.net (Postfix, from userid 1000) id 9B0F920C2B; Thu, 4 Aug 2011 06:49:05 -0700 (PDT) Date: Thu, 4 Aug 2011 06:49:05 -0700 From: Deepak Saxena To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 04/12] ARM: clps711x: Remove LATCH and CLOCK_TICK_RATE dependency Message-ID: <20110804134905.GB1019@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_094906_253517_96F0BB33 X-CRM114-Status: GOOD ( 12.61 ) 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 (demeter2.kernel.org [140.211.167.43]); Thu, 04 Aug 2011 13:49:42 +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 clps711x code. Once all LATCH and CLOCK_TICK_RATE references are removed, we will remove all the definitions across sub-arches. Signed-off-by: Deepak Saxena --- arch/arm/mach-clps711x/time.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-clps711x/time.c b/arch/arm/mach-clps711x/time.c index d581ef0..88c86f2 100644 --- a/arch/arm/mach-clps711x/time.c +++ b/arch/arm/mach-clps711x/time.c @@ -30,18 +30,20 @@ #include +#define CLPS711x_TICK_RATE 512000 +#define TIMER_LATCH ((CLPS711x_TICK_RATE + HZ/2) / HZ) /* * gettimeoffset() returns time since last timer tick, in usecs. * - * 'LATCH' is hwclock ticks (see CLOCK_TICK_RATE in timex.h) per jiffy. + * 'LATCH' is hwclock ticks per jiffy. * 'tick' is usecs per jiffy. */ static unsigned long clps711x_gettimeoffset(void) { unsigned long hwticks; - hwticks = LATCH - (clps_readl(TC2D) & 0xffff); /* since last underflow */ - return (hwticks * (tick_nsec / 1000)) / LATCH; + hwticks = TIMER_LATCH - (clps_readl(TC2D) & 0xffff); /* since last underflow */ + return (hwticks * (tick_nsec / 1000)) / TIMER_LATCH; } /* @@ -69,7 +71,7 @@ static void __init clps711x_timer_init(void) syscon |= SYSCON1_TC2S | SYSCON1_TC2M; clps_writel(syscon, SYSCON1); - clps_writel(LATCH-1, TC2D); /* 512kHz / 100Hz - 1 */ + clps_writel(TIMER_LATCH-1, TC2D); /* 512kHz / 100Hz - 1 */ setup_irq(IRQ_TC2OI, &clps711x_timer_irq);