|
@@ -19,6 +19,7 @@
|
|
#include <linux/mc146818rtc.h> /* for rtc_lock */
|
|
#include <linux/mc146818rtc.h> /* for rtc_lock */
|
|
#include <linux/platform_device.h>
|
|
#include <linux/platform_device.h>
|
|
#include <linux/smp.h>
|
|
#include <linux/smp.h>
|
|
|
|
+#include <linux/rtc.h>
|
|
#include <asm/clock.h>
|
|
#include <asm/clock.h>
|
|
#include <asm/rtc.h>
|
|
#include <asm/rtc.h>
|
|
#include <asm/timer.h>
|
|
#include <asm/timer.h>
|
|
@@ -45,6 +46,28 @@ static int null_rtc_set_time(const time_t secs)
|
|
void (*rtc_sh_get_time)(struct timespec *) = null_rtc_get_time;
|
|
void (*rtc_sh_get_time)(struct timespec *) = null_rtc_get_time;
|
|
int (*rtc_sh_set_time)(const time_t) = null_rtc_set_time;
|
|
int (*rtc_sh_set_time)(const time_t) = null_rtc_set_time;
|
|
|
|
|
|
|
|
+unsigned int get_rtc_time(struct rtc_time *tm)
|
|
|
|
+{
|
|
|
|
+ if (rtc_sh_get_time != null_rtc_get_time) {
|
|
|
|
+ struct timespec tv;
|
|
|
|
+
|
|
|
|
+ rtc_sh_get_time(&tv);
|
|
|
|
+ rtc_time_to_tm(tv.tv_sec, tm);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return RTC_24H;
|
|
|
|
+}
|
|
|
|
+EXPORT_SYMBOL(get_rtc_time);
|
|
|
|
+
|
|
|
|
+int set_rtc_time(struct rtc_time *tm)
|
|
|
|
+{
|
|
|
|
+ unsigned long secs;
|
|
|
|
+
|
|
|
|
+ rtc_tm_to_time(tm, &secs);
|
|
|
|
+ return rtc_sh_set_time(secs);
|
|
|
|
+}
|
|
|
|
+EXPORT_SYMBOL(set_rtc_time);
|
|
|
|
+
|
|
#ifndef CONFIG_GENERIC_TIME
|
|
#ifndef CONFIG_GENERIC_TIME
|
|
void do_gettimeofday(struct timeval *tv)
|
|
void do_gettimeofday(struct timeval *tv)
|
|
{
|
|
{
|