summaryrefslogtreecommitdiffstats
path: root/arch/m68knommu/kernel
diff options
context:
space:
mode:
authorSebastian Siewior <bigeasy@linutronix.de>2008-04-28 11:43:01 +0200
committerGreg Ungerer <gerg@uclinux.org>2008-07-23 07:11:28 +0200
commit95469bd64a7a9ab405b566deb8c81d4aaf67ed9e (patch)
tree737b6971940e46bba0467e9808f6b101ce3cdb37 /arch/m68knommu/kernel
parentm68knommu: move code within time.c (diff)
downloadlinux-95469bd64a7a9ab405b566deb8c81d4aaf67ed9e.tar.xz
linux-95469bd64a7a9ab405b566deb8c81d4aaf67ed9e.zip
m68knommu: complete generic time
do_set_rtc() isn't required because the work that is handled is allready served if read_persistent_clock() & update_persistent_clock() are implemented and CONFIG_GENERIC_CMOS_UPDATE is. sync_cmos_clock() looks very familiar :) Signed-off-by: Sebastian Siewior <bigeasy@linutronix.de> Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Diffstat (limited to 'arch/m68knommu/kernel')
-rw-r--r--arch/m68knommu/kernel/time.c38
1 files changed, 10 insertions, 28 deletions
diff --git a/arch/m68knommu/kernel/time.c b/arch/m68knommu/kernel/time.c
index d33ed9a84cc7..67944aa27280 100644
--- a/arch/m68knommu/kernel/time.c
+++ b/arch/m68knommu/kernel/time.c
@@ -33,27 +33,6 @@ static inline int set_rtc_mmss(unsigned long nowtime)
return -1;
}
-static inline void do_set_rtc(void)
-{
- /* last time the cmos clock got updated */
- static long last_rtc_update=0;
-
- /*
- * If we have an externally synchronized Linux clock, then update
- * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
- * called as close as possible to 500 ms before the new second starts.
- */
- if (ntp_synced() &&
- xtime.tv_sec > last_rtc_update + 660 &&
- (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 &&
- (xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) {
- if (set_rtc_mmss(xtime.tv_sec) == 0)
- last_rtc_update = xtime.tv_sec;
- else
- last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */
- }
-}
-
/*
* timer_interrupt() needs to keep up the real-time clock,
* as well as call the "do_timer()" routine every clocktick
@@ -68,8 +47,6 @@ irqreturn_t arch_timer_interrupt(int irq, void *dummy)
do_timer(1);
- do_set_rtc();
-
write_sequnlock(&xtime_lock);
#ifndef CONFIG_SMP
@@ -93,12 +70,17 @@ static unsigned long read_rtc_mmss(void)
return mktime(year, mon, day, hour, min, sec);;
}
-void time_init(void)
+unsigned long read_persistent_clock(void)
+{
+ return read_rtc_mmss();
+}
+
+int update_persistent_clock(struct timespec now)
{
- xtime.tv_sec = read_rtc_mmss();
- xtime.tv_nsec = 0;
- wall_to_monotonic.tv_sec = -xtime.tv_sec;
+ return set_rtc_mmss(now.tv_sec);
+}
+void time_init(void)
+{
hw_timer_init();
}
-