summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2010-11-17 16:20:15 -0800
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-12-22 22:44:42 +0000
commit684e94cbcb5add60356d124166e40feb2174f0f1 (patch)
treedfdcf2048c6ac76c8c55134d1dc5633d495c4f4a /arch/arm/mach-tegra
parent11e718a6535c0c7a375b24c3ad60a98b988090c8 (diff)
ARM: tegra: timer: Separate clocksource and sched_clock
tegra_clocksource_read should not use cnt32_to_63, wrapping is already handled in the clocksource code. Move the cnt32_to_63 into the sched_clock function, and replace the use of clocksource mult and shift with a multiplication by 1000 to convert us to ns. Acked-by: John Stultz <johnstul@us.ibm.com> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Tested-by: Olof Johansson <olof@lixom.net> Signed-off-by: Colin Cross <ccross@android.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r--arch/arm/mach-tegra/timer.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c
index 9057d6fd1d31..b49f2f5025f2 100644
--- a/arch/arm/mach-tegra/timer.c
+++ b/arch/arm/mach-tegra/timer.c
@@ -91,7 +91,7 @@ static void tegra_timer_set_mode(enum clock_event_mode mode,
static cycle_t tegra_clocksource_read(struct clocksource *cs)
{
- return cnt32_to_63(timer_readl(TIMERUS_CNTR_1US));
+ return timer_readl(TIMERUS_CNTR_1US);
}
static struct clock_event_device tegra_clockevent = {
@@ -106,14 +106,13 @@ static struct clocksource tegra_clocksource = {
.name = "timer_us",
.rating = 300,
.read = tegra_clocksource_read,
- .mask = 0x7FFFFFFFFFFFFFFFULL,
+ .mask = CLOCKSOURCE_MASK(32),
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
unsigned long long sched_clock(void)
{
- return clocksource_cyc2ns(tegra_clocksource.read(&tegra_clocksource),
- tegra_clocksource.mult, tegra_clocksource.shift);
+ return cnt32_to_63(timer_readl(TIMERUS_CNTR_1US)) * 1000;
}
static irqreturn_t tegra_timer_interrupt(int irq, void *dev_id)