diff options
Diffstat (limited to 'arch/sh/kernel/time.c')
-rw-r--r-- | arch/sh/kernel/time.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/arch/sh/kernel/time.c b/arch/sh/kernel/time.c index 9b352a1e3fb4..953fa1613312 100644 --- a/arch/sh/kernel/time.c +++ b/arch/sh/kernel/time.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/smp.h> | 21 | #include <linux/smp.h> |
22 | #include <linux/rtc.h> | 22 | #include <linux/rtc.h> |
23 | #include <asm/clock.h> | 23 | #include <asm/clock.h> |
24 | #include <asm/hwblk.h> | ||
24 | #include <asm/rtc.h> | 25 | #include <asm/rtc.h> |
25 | 26 | ||
26 | /* Dummy RTC ops */ | 27 | /* Dummy RTC ops */ |
@@ -39,11 +40,9 @@ void (*rtc_sh_get_time)(struct timespec *) = null_rtc_get_time; | |||
39 | int (*rtc_sh_set_time)(const time_t) = null_rtc_set_time; | 40 | int (*rtc_sh_set_time)(const time_t) = null_rtc_set_time; |
40 | 41 | ||
41 | #ifdef CONFIG_GENERIC_CMOS_UPDATE | 42 | #ifdef CONFIG_GENERIC_CMOS_UPDATE |
42 | unsigned long read_persistent_clock(void) | 43 | void read_persistent_clock(struct timespec *ts) |
43 | { | 44 | { |
44 | struct timespec tv; | 45 | rtc_sh_get_time(ts); |
45 | rtc_sh_get_time(&tv); | ||
46 | return tv.tv_sec; | ||
47 | } | 46 | } |
48 | 47 | ||
49 | int update_persistent_clock(struct timespec now) | 48 | int update_persistent_clock(struct timespec now) |
@@ -91,21 +90,8 @@ module_init(rtc_generic_init); | |||
91 | 90 | ||
92 | void (*board_time_init)(void); | 91 | void (*board_time_init)(void); |
93 | 92 | ||
94 | void __init time_init(void) | 93 | static void __init sh_late_time_init(void) |
95 | { | 94 | { |
96 | if (board_time_init) | ||
97 | board_time_init(); | ||
98 | |||
99 | clk_init(); | ||
100 | |||
101 | rtc_sh_get_time(&xtime); | ||
102 | set_normalized_timespec(&wall_to_monotonic, | ||
103 | -xtime.tv_sec, -xtime.tv_nsec); | ||
104 | |||
105 | #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST | ||
106 | local_timer_setup(smp_processor_id()); | ||
107 | #endif | ||
108 | |||
109 | /* | 95 | /* |
110 | * Make sure all compiled-in early timers register themselves. | 96 | * Make sure all compiled-in early timers register themselves. |
111 | * | 97 | * |
@@ -118,3 +104,18 @@ void __init time_init(void) | |||
118 | early_platform_driver_register_all("earlytimer"); | 104 | early_platform_driver_register_all("earlytimer"); |
119 | early_platform_driver_probe("earlytimer", 2, 0); | 105 | early_platform_driver_probe("earlytimer", 2, 0); |
120 | } | 106 | } |
107 | |||
108 | void __init time_init(void) | ||
109 | { | ||
110 | if (board_time_init) | ||
111 | board_time_init(); | ||
112 | |||
113 | hwblk_init(); | ||
114 | clk_init(); | ||
115 | |||
116 | rtc_sh_get_time(&xtime); | ||
117 | set_normalized_timespec(&wall_to_monotonic, | ||
118 | -xtime.tv_sec, -xtime.tv_nsec); | ||
119 | |||
120 | late_time_init = sh_late_time_init; | ||
121 | } | ||