From patchwork Thu Aug 4 13:53:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak Saxena X-Patchwork-Id: 1035752 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 p74DrkXZ000602 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 4 Aug 2011 13:54:07 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QoyMi-0007TL-73; Thu, 04 Aug 2011 13:53:36 +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 1QoyMh-0007To-Nn; Thu, 04 Aug 2011 13:53:35 +0000 Received: from plexity.net ([206.123.115.38]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QoyMf-0007TW-4y for linux-arm-kernel@lists.infradead.org; Thu, 04 Aug 2011 13:53:33 +0000 Received: by plexity.net (Postfix, from userid 1000) id A6E9220C2B; Thu, 4 Aug 2011 06:53:32 -0700 (PDT) Date: Thu, 4 Aug 2011 06:53:32 -0700 From: Deepak Saxena To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 10/12] ARM: pnx4000: Remove LATCH and CLOCK_TICK_RATE dependency Message-ID: <20110804135332.GH1019@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_095333_369503_9848889B X-CRM114-Status: GOOD ( 12.40 ) 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 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:54:07 +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 pnx4000 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-pnx4008/time.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-pnx4008/time.c b/arch/arm/mach-pnx4008/time.c index 0c8aad4..8aa48a4 100644 --- a/arch/arm/mach-pnx4008/time.c +++ b/arch/arm/mach-pnx4008/time.c @@ -34,6 +34,9 @@ /*! Note: all timers are UPCOUNTING */ +#define HSTIM_TICK_RATE 1000000 +#define HSTIM_TIMER_LATCH ((HSTIM_TICK_RATE + HZ/2) / HZ) + /*! * Returns number of us since last clock interrupt. Note that interrupts * will have been disabled by do_gettimeoffset() @@ -42,8 +45,8 @@ static unsigned long pnx4008_gettimeoffset(void) { u32 ticks_to_match = __raw_readl(HSTIM_MATCH0) - __raw_readl(HSTIM_COUNTER); - u32 elapsed = LATCH - ticks_to_match; - return (elapsed * (tick_nsec / 1000)) / LATCH; + u32 elapsed = HSTIM_TIMER_LATCH - ticks_to_match; + return (elapsed * (tick_nsec / 1000)) / HSTIM_TIMER_LATCH; } /*! @@ -61,7 +64,7 @@ static irqreturn_t pnx4008_timer_interrupt(int irq, void *dev_id) * for this interrupt handling longer than a normal * timer period */ - __raw_writel(__raw_readl(HSTIM_MATCH0) + LATCH, + __raw_writel(__raw_readl(HSTIM_MATCH0) + HSTIM_TIMER_LATCH, HSTIM_MATCH0); __raw_writel(MATCH0_INT, HSTIM_INT); /* clear interrupt */ @@ -100,7 +103,7 @@ static __init void pnx4008_setup_timer(void) __raw_writel(0, HSTIM_MCTRL); __raw_writel(0, HSTIM_CCR); __raw_writel(12, HSTIM_PMATCH); /* scale down to 1 MHZ */ - __raw_writel(LATCH, HSTIM_MATCH0); + __raw_writel(HSTIM_TIMER_LATCH, HSTIM_MATCH0); __raw_writel(MR0_INT, HSTIM_MCTRL); setup_irq(HSTIMER_INT, &pnx4008_timer_irq);