diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-05-08 03:36:13 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-05-08 03:36:13 -0400 |
commit | 6d134b9e8d3f32331ad2faca2db8186f54198931 (patch) | |
tree | 1b778b8e3088f4d5f44db0728693fdf02f3d158f /arch/sh/kernel/time.c | |
parent | b179b72fad5c88c3b616fb88a9ae7cbbc1a750d3 (diff) |
sh: Wire up GENERIC_CMOS_UPDATE for the platforms that need it.
Now that everything has converted over to generic timekeeping, we need an
alternate method for keeping the RTC updated for those platforms that are
still using the rtc_sh_get/set_time pairs, presently limited to SH-03 and
the Dreamcast. This wires up the GENERIC_CMOS_UPDATE hooks for those to
maintain the same behaviour.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/time.c')
-rw-r--r-- | arch/sh/kernel/time.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/sh/kernel/time.c b/arch/sh/kernel/time.c index d41ca4cf20cf..77b841a99c01 100644 --- a/arch/sh/kernel/time.c +++ b/arch/sh/kernel/time.c | |||
@@ -46,6 +46,20 @@ static int null_rtc_set_time(const time_t secs) | |||
46 | void (*rtc_sh_get_time)(struct timespec *) = null_rtc_get_time; | 46 | void (*rtc_sh_get_time)(struct timespec *) = null_rtc_get_time; |
47 | int (*rtc_sh_set_time)(const time_t) = null_rtc_set_time; | 47 | int (*rtc_sh_set_time)(const time_t) = null_rtc_set_time; |
48 | 48 | ||
49 | #ifdef CONFIG_GENERIC_CMOS_UPDATE | ||
50 | unsigned long read_persistent_clock(void) | ||
51 | { | ||
52 | struct timespec tv; | ||
53 | rtc_sh_get_time(&tv); | ||
54 | return tv.tv_sec; | ||
55 | } | ||
56 | |||
57 | int update_persistent_clock(struct timespec now) | ||
58 | { | ||
59 | return rtc_sh_set_time(now.tv_sec); | ||
60 | } | ||
61 | #endif | ||
62 | |||
49 | unsigned int get_rtc_time(struct rtc_time *tm) | 63 | unsigned int get_rtc_time(struct rtc_time *tm) |
50 | { | 64 | { |
51 | if (rtc_sh_get_time != null_rtc_get_time) { | 65 | if (rtc_sh_get_time != null_rtc_get_time) { |