diff mbox

[06/12] ARM: IXP23xx: Remove LATCH and CLOCK_TICK_RATE dependency

Message ID 20110804135014.GD1019@plexity.net (mailing list archive)
State New, archived
Headers show

Commit Message

Deepak Saxena Aug. 4, 2011, 1:50 p.m. 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 <dsaxena@linaro.org>
---
 arch/arm/mach-ixp23xx/core.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

Comments

Lennert Buytenhek Aug. 4, 2011, 2:03 p.m. UTC | #1
On Thu, Aug 04, 2011 at 06:50:14AM -0700, Deepak Saxena wrote:

> 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.

I posted a patchset back in Oct 2010 that does this:

http://lists.infradead.org/pipermail/linux-arm-kernel/2010-October/029451.html
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-October/029452.html
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-October/029453.html
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-October/029454.html
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-October/029455.html
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-October/029456.html
diff mbox

Patch

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);