]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
sh: Wire up GENERIC_CMOS_UPDATE for the platforms that need it.
authorPaul Mundt <lethal@linux-sh.org>
Fri, 8 May 2009 07:36:13 +0000 (16:36 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Fri, 8 May 2009 07:36:13 +0000 (16:36 +0900)
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>
arch/sh/Kconfig
arch/sh/kernel/time.c

index ca5c09b241c301af3799fabd765051f3da208995..d88a61b11d321c085b88b5a411709faaa86f603d 100644 (file)
@@ -83,6 +83,10 @@ config GENERIC_CLOCKEVENTS
 config GENERIC_CLOCKEVENTS_BROADCAST
        bool
 
+config GENERIC_CMOS_UPDATE
+       def_bool y
+       depends on SH_SH03 || SH_DREAMCAST
+
 config GENERIC_LOCKBREAK
        def_bool y
        depends on SMP && PREEMPT
index d41ca4cf20cf931f86d15b4e4db5691d42f63b8c..77b841a99c01f6f95869c746dfffdeb8659def3c 100644 (file)
@@ -46,6 +46,20 @@ static int null_rtc_set_time(const time_t secs)
 void (*rtc_sh_get_time)(struct timespec *) = null_rtc_get_time;
 int (*rtc_sh_set_time)(const time_t) = null_rtc_set_time;
 
+#ifdef CONFIG_GENERIC_CMOS_UPDATE
+unsigned long read_persistent_clock(void)
+{
+       struct timespec tv;
+       rtc_sh_get_time(&tv);
+       return tv.tv_sec;
+}
+
+int update_persistent_clock(struct timespec now)
+{
+       return rtc_sh_set_time(now.tv_sec);
+}
+#endif
+
 unsigned int get_rtc_time(struct rtc_time *tm)
 {
        if (rtc_sh_get_time != null_rtc_get_time) {