diff options
author | Stephen Warren <swarren@nvidia.com> | 2012-11-08 13:51:58 -0500 |
---|---|---|
committer | Stephen Warren <swarren@nvidia.com> | 2012-12-24 11:36:35 -0500 |
commit | 23c197b77f9553c30f9c8a5ab41279a35f135f37 (patch) | |
tree | 7da1f4b032ff24482afb1f289ab9c633de684d7a /arch/arm/mach-at91 | |
parent | c8d5ba1891eda2aa63800f052cb5af128283d130 (diff) |
ARM: set arch_gettimeoffset directly
remove ARM's struct sys_timer .offset function pointer, and instead
directly set the arch_gettimeoffset function pointer when the timer
driver is initialized. This requires multiplying all function results
by 1000, since the removed arm_gettimeoffset() did this. Also,
s/unsigned long/u32/ just to make the function prototypes exactly
match that of arch_gettimeoffset.
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Andrew Victor <linux@maxim.org.za>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ryan Mallon <rmallon@gmail.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'arch/arm/mach-at91')
-rw-r--r-- | arch/arm/mach-at91/at91x40_time.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/arm/mach-at91/at91x40_time.c b/arch/arm/mach-at91/at91x40_time.c index 0e57e440c061..fb3c70124ac3 100644 --- a/arch/arm/mach-at91/at91x40_time.c +++ b/arch/arm/mach-at91/at91x40_time.c | |||
@@ -42,9 +42,10 @@ | |||
42 | #define AT91_TC_CLK1BASE 0x40 | 42 | #define AT91_TC_CLK1BASE 0x40 |
43 | #define AT91_TC_CLK2BASE 0x80 | 43 | #define AT91_TC_CLK2BASE 0x80 |
44 | 44 | ||
45 | static unsigned long at91x40_gettimeoffset(void) | 45 | static u32 at91x40_gettimeoffset(void) |
46 | { | 46 | { |
47 | return (at91_tc_read(AT91_TC_CLK1BASE + AT91_TC_CV) * 1000000 / (AT91X40_MASTER_CLOCK / 128)); | 47 | return (at91_tc_read(AT91_TC_CLK1BASE + AT91_TC_CV) * 1000000 / |
48 | (AT91X40_MASTER_CLOCK / 128)) * 1000; | ||
48 | } | 49 | } |
49 | 50 | ||
50 | static irqreturn_t at91x40_timer_interrupt(int irq, void *dev_id) | 51 | static irqreturn_t at91x40_timer_interrupt(int irq, void *dev_id) |
@@ -64,6 +65,8 @@ void __init at91x40_timer_init(void) | |||
64 | { | 65 | { |
65 | unsigned int v; | 66 | unsigned int v; |
66 | 67 | ||
68 | arch_gettimeoffset = at91x40_gettimeoffset; | ||
69 | |||
67 | at91_tc_write(AT91_TC_BCR, 0); | 70 | at91_tc_write(AT91_TC_BCR, 0); |
68 | v = at91_tc_read(AT91_TC_BMR); | 71 | v = at91_tc_read(AT91_TC_BMR); |
69 | v = (v & ~AT91_TC_TC1XC1S) | AT91_TC_TC1XC1S_NONE; | 72 | v = (v & ~AT91_TC_TC1XC1S) | AT91_TC_TC1XC1S_NONE; |
@@ -82,6 +85,5 @@ void __init at91x40_timer_init(void) | |||
82 | 85 | ||
83 | struct sys_timer at91x40_timer = { | 86 | struct sys_timer at91x40_timer = { |
84 | .init = at91x40_timer_init, | 87 | .init = at91x40_timer_init, |
85 | .offset = at91x40_gettimeoffset, | ||
86 | }; | 88 | }; |
87 | 89 | ||