diff options
Diffstat (limited to 'arch/arm/plat-samsung/time.c')
-rw-r--r-- | arch/arm/plat-samsung/time.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/arch/arm/plat-samsung/time.c b/arch/arm/plat-samsung/time.c index 60552e22f22e..73defd00c3e4 100644 --- a/arch/arm/plat-samsung/time.c +++ b/arch/arm/plat-samsung/time.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/clk.h> | 27 | #include <linux/clk.h> |
28 | #include <linux/io.h> | 28 | #include <linux/io.h> |
29 | #include <linux/platform_device.h> | 29 | #include <linux/platform_device.h> |
30 | #include <linux/syscore_ops.h> | ||
30 | 31 | ||
31 | #include <asm/mach-types.h> | 32 | #include <asm/mach-types.h> |
32 | 33 | ||
@@ -95,7 +96,7 @@ static inline unsigned long timer_ticks_to_usec(unsigned long ticks) | |||
95 | * IRQs are disabled before entering here from do_gettimeofday() | 96 | * IRQs are disabled before entering here from do_gettimeofday() |
96 | */ | 97 | */ |
97 | 98 | ||
98 | static unsigned long s3c2410_gettimeoffset (void) | 99 | static u32 s3c2410_gettimeoffset(void) |
99 | { | 100 | { |
100 | unsigned long tdone; | 101 | unsigned long tdone; |
101 | unsigned long tval; | 102 | unsigned long tval; |
@@ -120,7 +121,7 @@ static unsigned long s3c2410_gettimeoffset (void) | |||
120 | tdone += timer_startval; | 121 | tdone += timer_startval; |
121 | } | 122 | } |
122 | 123 | ||
123 | return timer_ticks_to_usec(tdone); | 124 | return timer_ticks_to_usec(tdone) * 1000; |
124 | } | 125 | } |
125 | 126 | ||
126 | 127 | ||
@@ -271,15 +272,16 @@ static void __init s3c2410_timer_resources(void) | |||
271 | clk_enable(tin); | 272 | clk_enable(tin); |
272 | } | 273 | } |
273 | 274 | ||
274 | static void __init s3c2410_timer_init(void) | 275 | static struct syscore_ops s3c24xx_syscore_ops = { |
276 | .resume = s3c2410_timer_setup, | ||
277 | }; | ||
278 | |||
279 | void __init s3c24xx_timer_init(void) | ||
275 | { | 280 | { |
281 | arch_gettimeoffset = s3c2410_gettimeoffset; | ||
282 | |||
276 | s3c2410_timer_resources(); | 283 | s3c2410_timer_resources(); |
277 | s3c2410_timer_setup(); | 284 | s3c2410_timer_setup(); |
278 | setup_irq(IRQ_TIMER4, &s3c2410_timer_irq); | 285 | setup_irq(IRQ_TIMER4, &s3c2410_timer_irq); |
286 | register_syscore_ops(&s3c24xx_syscore_ops); | ||
279 | } | 287 | } |
280 | |||
281 | struct sys_timer s3c24xx_timer = { | ||
282 | .init = s3c2410_timer_init, | ||
283 | .offset = s3c2410_gettimeoffset, | ||
284 | .resume = s3c2410_timer_setup | ||
285 | }; | ||