diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-04-27 04:34:39 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-04-27 04:34:39 -0400 |
commit | 47c8a08bbe77ad3c06f63919a14b0f0b0cd54390 (patch) | |
tree | 0cc31001058390e56bb1437553adfbe451cd714d /arch/sh/kernel/time_32.c | |
parent | 5be7c0a4d3dfe25091f2e4e524103e81d9e7e180 (diff) |
sh: rtc-generic support.
This adds rtc-generic support for SUPERH32.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/time_32.c')
-rw-r--r-- | arch/sh/kernel/time_32.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/sh/kernel/time_32.c b/arch/sh/kernel/time_32.c index c770413c3213..109409f5ca53 100644 --- a/arch/sh/kernel/time_32.c +++ b/arch/sh/kernel/time_32.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/mc146818rtc.h> /* for rtc_lock */ | 19 | #include <linux/mc146818rtc.h> /* for rtc_lock */ |
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | #include <linux/smp.h> | 21 | #include <linux/smp.h> |
22 | #include <linux/rtc.h> | ||
22 | #include <asm/clock.h> | 23 | #include <asm/clock.h> |
23 | #include <asm/rtc.h> | 24 | #include <asm/rtc.h> |
24 | #include <asm/timer.h> | 25 | #include <asm/timer.h> |
@@ -45,6 +46,28 @@ static int null_rtc_set_time(const time_t secs) | |||
45 | void (*rtc_sh_get_time)(struct timespec *) = null_rtc_get_time; | 46 | void (*rtc_sh_get_time)(struct timespec *) = null_rtc_get_time; |
46 | 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; |
47 | 48 | ||
49 | unsigned int get_rtc_time(struct rtc_time *tm) | ||
50 | { | ||
51 | if (rtc_sh_get_time != null_rtc_get_time) { | ||
52 | struct timespec tv; | ||
53 | |||
54 | rtc_sh_get_time(&tv); | ||
55 | rtc_time_to_tm(tv.tv_sec, tm); | ||
56 | } | ||
57 | |||
58 | return RTC_24H; | ||
59 | } | ||
60 | EXPORT_SYMBOL(get_rtc_time); | ||
61 | |||
62 | int set_rtc_time(struct rtc_time *tm) | ||
63 | { | ||
64 | unsigned long secs; | ||
65 | |||
66 | rtc_tm_to_time(tm, &secs); | ||
67 | return rtc_sh_set_time(secs); | ||
68 | } | ||
69 | EXPORT_SYMBOL(set_rtc_time); | ||
70 | |||
48 | #ifndef CONFIG_GENERIC_TIME | 71 | #ifndef CONFIG_GENERIC_TIME |
49 | void do_gettimeofday(struct timeval *tv) | 72 | void do_gettimeofday(struct timeval *tv) |
50 | { | 73 | { |