summaryrefslogtreecommitdiff
path: root/arch/arm/mach-netx
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2008-12-09 21:57:22 +0100
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2008-12-09 21:57:22 +0100
commit24e7857677fe3cb87f1dd7fa1418a73795e9f4c5 (patch)
tree9a94a7dc567210484018d1a22c0c2664d7676f1b /arch/arm/mach-netx
parent9853848860d7ece7d84ac43cfde5390b2638eb89 (diff)
netx: Use a cpp symbol for the clocksource timer number
instead of hardcoding the same value each time. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-netx')
-rw-r--r--arch/arm/mach-netx/time.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/arm/mach-netx/time.c b/arch/arm/mach-netx/time.c
index be833bd1048..34a6a157f35 100644
--- a/arch/arm/mach-netx/time.c
+++ b/arch/arm/mach-netx/time.c
@@ -27,6 +27,8 @@
#include <asm/mach/time.h>
#include <mach/netx-regs.h>
+#define TIMER_CLOCKSOURCE 1
+
/*
* IRQ handler for the timer
*/
@@ -49,7 +51,7 @@ static struct irqaction netx_timer_irq = {
cycle_t netx_get_cycles(void)
{
- return readl(NETX_GPIO_COUNTER_CURRENT(1));
+ return readl(NETX_GPIO_COUNTER_CURRENT(TIMER_CLOCKSOURCE));
}
static struct clocksource clocksource_netx = {
@@ -87,12 +89,12 @@ static void __init netx_timer_init(void)
setup_irq(NETX_IRQ_TIMER0, &netx_timer_irq);
/* Setup timer one for clocksource */
- writel(0, NETX_GPIO_COUNTER_CTRL(1));
- writel(0, NETX_GPIO_COUNTER_CURRENT(1));
- writel(0xffffffff, NETX_GPIO_COUNTER_MAX(1));
+ writel(0, NETX_GPIO_COUNTER_CTRL(TIMER_CLOCKSOURCE));
+ writel(0, NETX_GPIO_COUNTER_CURRENT(TIMER_CLOCKSOURCE));
+ writel(0xffffffff, NETX_GPIO_COUNTER_MAX(TIMER_CLOCKSOURCE));
writel(NETX_GPIO_COUNTER_CTRL_RUN,
- NETX_GPIO_COUNTER_CTRL(1));
+ NETX_GPIO_COUNTER_CTRL(TIMER_CLOCKSOURCE));
clocksource_netx.mult =
clocksource_hz2mult(CLOCK_TICK_RATE, clocksource_netx.shift);