summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/at91x40_time.c
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2013-02-11 09:21:44 -0800
committerOlof Johansson <olof@lixom.net>2013-02-11 09:21:44 -0800
commit5f48a29f1721736930b7817b430039c1d348dd05 (patch)
tree69c47c1105d275810123785a947227b9aa8028d6 /arch/arm/mach-at91/at91x40_time.c
parent3ad06d1a7dfd99a2e8f3a41e0fa5118551186d3c (diff)
parentf8060f5446b1f2782f0a8ca9be2d870ea4198aee (diff)
Merge branch 'depends/cleanup' into next/virt
Diffstat (limited to 'arch/arm/mach-at91/at91x40_time.c')
-rw-r--r--arch/arm/mach-at91/at91x40_time.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/arch/arm/mach-at91/at91x40_time.c b/arch/arm/mach-at91/at91x40_time.c
index 0e57e440c06..0c07a4459cb 100644
--- a/arch/arm/mach-at91/at91x40_time.c
+++ b/arch/arm/mach-at91/at91x40_time.c
@@ -42,9 +42,10 @@
#define AT91_TC_CLK1BASE 0x40
#define AT91_TC_CLK2BASE 0x80
-static unsigned long at91x40_gettimeoffset(void)
+static u32 at91x40_gettimeoffset(void)
{
- return (at91_tc_read(AT91_TC_CLK1BASE + AT91_TC_CV) * 1000000 / (AT91X40_MASTER_CLOCK / 128));
+ return (at91_tc_read(AT91_TC_CLK1BASE + AT91_TC_CV) * 1000000 /
+ (AT91X40_MASTER_CLOCK / 128)) * 1000;
}
static irqreturn_t at91x40_timer_interrupt(int irq, void *dev_id)
@@ -64,6 +65,8 @@ void __init at91x40_timer_init(void)
{
unsigned int v;
+ arch_gettimeoffset = at91x40_gettimeoffset;
+
at91_tc_write(AT91_TC_BCR, 0);
v = at91_tc_read(AT91_TC_BMR);
v = (v & ~AT91_TC_TC1XC1S) | AT91_TC_TC1XC1S_NONE;
@@ -79,9 +82,3 @@ void __init at91x40_timer_init(void)
at91_tc_write(AT91_TC_CLK1BASE + AT91_TC_CCR, (AT91_TC_SWTRG | AT91_TC_CLKEN));
}
-
-struct sys_timer at91x40_timer = {
- .init = at91x40_timer_init,
- .offset = at91x40_gettimeoffset,
-};
-