aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/platform/68328/timers.c
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@uclinux.org>2012-01-22 22:25:56 -0500
committerGreg Ungerer <gerg@uclinux.org>2012-03-04 18:43:03 -0500
commit9517746131f62294ddd922bcd288415be5104c23 (patch)
tree1ca5433e9d25c1c2f34197a52bfa15fdec163fac /arch/m68k/platform/68328/timers.c
parentd3f033f894c433d3c9bf347a0a84f45dac0b14ac (diff)
m68knommu: make persistent clock code consistent with m68k
The read_persistent_clock() code is different on m68knommu, for really no reason. With a few changes to support function names and some code re-organization the code can be made the same. This will make it easier to merge the arch/m68k/kernel/time.c for m68k and m68knommu in a future patch. Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Diffstat (limited to 'arch/m68k/platform/68328/timers.c')
-rw-r--r--arch/m68k/platform/68328/timers.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/arch/m68k/platform/68328/timers.c b/arch/m68k/platform/68328/timers.c
index f2678866067b..b15ddef1ec76 100644
--- a/arch/m68k/platform/68328/timers.c
+++ b/arch/m68k/platform/68328/timers.c
@@ -20,6 +20,7 @@
20#include <linux/interrupt.h> 20#include <linux/interrupt.h>
21#include <linux/irq.h> 21#include <linux/irq.h>
22#include <linux/clocksource.h> 22#include <linux/clocksource.h>
23#include <linux/rtc.h>
23#include <asm/setup.h> 24#include <asm/setup.h>
24#include <asm/system.h> 25#include <asm/system.h>
25#include <asm/pgtable.h> 26#include <asm/pgtable.h>
@@ -119,14 +120,17 @@ void hw_timer_init(void)
119 120
120/***************************************************************************/ 121/***************************************************************************/
121 122
122void m68328_timer_gettod(int *year, int *mon, int *day, int *hour, int *min, int *sec) 123int m68328_hwclk(int set, struct rtc_time *t)
123{ 124{
124 long now = RTCTIME; 125 if (!set) {
125 126 long now = RTCTIME;
126 *year = *mon = *day = 1; 127 t->tm_year = t->tm_mon = t->tm_mday = 1;
127 *hour = (now >> 24) % 24; 128 t->tm_hour = (now >> 24) % 24;
128 *min = (now >> 16) % 60; 129 t->tm_min = (now >> 16) % 60;
129 *sec = now % 60; 130 t->tm_sec = now % 60;
131 }
132
133 return 0;
130} 134}
131 135
132/***************************************************************************/ 136/***************************************************************************/