diff options
author | Scott Williams <scwilliams@nvidia.com> | 2011-07-18 17:42:46 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:46:48 -0800 |
commit | 3f21523980f662b5cb701a7c949d64c9524a631b (patch) | |
tree | 9b7a1744abb60f136b06a09b1d7d10ec4f58e6b8 /arch/arm/mach-tegra/timer-t2.c | |
parent | 07e32729adeff79693e0da4f64ade4a64f52b024 (diff) |
ARM: tegra2: Add LP2 Timers
Restore the Tegra2 LP2 timers that were dropped in the port to Linux
2.6.39.
Change-Id: Ie3958fa3c89886d5dc5a5858c694400bd1421741
Signed-off-by: Scott Williams <scwilliams@nvidia.com>
DW: Split into logical changes
Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com>
Rebase-Id: R63ede668965d11ac2b2114ffa817b690a616205a
Diffstat (limited to 'arch/arm/mach-tegra/timer-t2.c')
-rw-r--r-- | arch/arm/mach-tegra/timer-t2.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/timer-t2.c b/arch/arm/mach-tegra/timer-t2.c index 00550aea9e53..0ee51b6047ab 100644 --- a/arch/arm/mach-tegra/timer-t2.c +++ b/arch/arm/mach-tegra/timer-t2.c @@ -283,3 +283,18 @@ static void __init tegra_init_timer(void) struct sys_timer tegra_timer = { .init = tegra_init_timer, }; + +void tegra2_lp2_set_trigger(unsigned long cycles) +{ + timer_writel(0, TIMER4_OFFSET + TIMER_PTV); + if (cycles) { + u32 reg = 0x80000000ul | min(0x1ffffffful, cycles); + timer_writel(reg, TIMER4_OFFSET + TIMER_PTV); + } +} +EXPORT_SYMBOL(tegra2_lp2_set_trigger); + +unsigned long tegra2_lp2_timer_remain(void) +{ + return timer_readl(TIMER4_OFFSET + TIMER_PCR) & 0x1ffffffful; +} |