From patchwork Thu Aug 4 13:50:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak Saxena X-Patchwork-Id: 1035712 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 p74DoPIP019631 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 4 Aug 2011 13:50:46 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QoyJW-0005g4-Dn; Thu, 04 Aug 2011 13:50:18 +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 1QoyJV-0007Ek-VP; Thu, 04 Aug 2011 13:50:17 +0000 Received: from plexity.net ([206.123.115.38]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QoyJT-0007ES-32 for linux-arm-kernel@lists.infradead.org; Thu, 04 Aug 2011 13:50:15 +0000 Received: by plexity.net (Postfix, from userid 1000) id 96D2C20C2B; Thu, 4 Aug 2011 06:50:14 -0700 (PDT) Date: Thu, 4 Aug 2011 06:50:14 -0700 From: Deepak Saxena To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 06/12] ARM: IXP23xx: Remove LATCH and CLOCK_TICK_RATE dependency Message-ID: <20110804135014.GD1019@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_095015_241789_D597756B X-CRM114-Status: GOOD ( 13.92 ) 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 , Lennert Buytenhek 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:50:47 +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 ixp23xx 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-ixp23xx/core.c | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-ixp23xx/core.c b/arch/arm/mach-ixp23xx/core.c index a1bee33..03eba95 100644 --- a/arch/arm/mach-ixp23xx/core.c +++ b/arch/arm/mach-ixp23xx/core.c @@ -336,7 +336,9 @@ void __init ixp23xx_init_irq(void) /************************************************************************* * Timer-tick functions for IXP23xx *************************************************************************/ -#define CLOCK_TICKS_PER_USEC (CLOCK_TICK_RATE / USEC_PER_SEC) +#define IXP23XX_TICK_RATE 75000000 +#define IXP23XX_TICKS_PER_USEC (IXP23XX_TICK_RATE / USEC_PER_SEC) +#define IXP23XX_TIMER_LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) /* For divider */ static unsigned long next_jiffy_time; @@ -345,7 +347,7 @@ ixp23xx_gettimeoffset(void) { unsigned long elapsed; - elapsed = *IXP23XX_TIMER_CONT - (next_jiffy_time - LATCH); + elapsed = *IXP23XX_TIMER_CONT - (next_jiffy_time - IXP23XX_TIMER_LATCH); return elapsed / CLOCK_TICKS_PER_USEC; } @@ -355,9 +357,9 @@ ixp23xx_timer_interrupt(int irq, void *dev_id) { /* Clear Pending Interrupt by writing '1' to it */ *IXP23XX_TIMER_STATUS = IXP23XX_TIMER1_INT_PEND; - while ((signed long)(*IXP23XX_TIMER_CONT - next_jiffy_time) >= LATCH) { + while ((signed long)(*IXP23XX_TIMER_CONT - next_jiffy_time) >= IXP23XX_TIMER_LATCH) { timer_tick(); - next_jiffy_time += LATCH; + next_jiffy_time += IXP23XX_TIMER_LATCH; } return IRQ_HANDLED; @@ -376,10 +378,10 @@ void __init ixp23xx_init_timer(void) /* Setup the Timer counter value */ *IXP23XX_TIMER1_RELOAD = - (LATCH & ~IXP23XX_TIMER_RELOAD_MASK) | IXP23XX_TIMER_ENABLE; + (IXP23XX_TIMER_LATCH & ~IXP23XX_TIMER_RELOAD_MASK) | IXP23XX_TIMER_ENABLE; *IXP23XX_TIMER_CONT = 0; - next_jiffy_time = LATCH; + next_jiffy_time = IXP23XX_TIMER_LATCH; /* Connect the interrupt handler and enable the interrupt */ setup_irq(IRQ_IXP23XX_TIMER1, &ixp23xx_timer_irq);