diff options
author | Greg Ungerer <gerg@uclinux.org> | 2012-01-22 22:25:56 -0500 |
---|---|---|
committer | Greg Ungerer <gerg@uclinux.org> | 2012-03-04 18:43:03 -0500 |
commit | 9517746131f62294ddd922bcd288415be5104c23 (patch) | |
tree | 1ca5433e9d25c1c2f34197a52bfa15fdec163fac /arch/m68k/platform/68328 | |
parent | d3f033f894c433d3c9bf347a0a84f45dac0b14ac (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')
-rw-r--r-- | arch/m68k/platform/68328/config.c | 5 | ||||
-rw-r--r-- | arch/m68k/platform/68328/timers.c | 18 |
2 files changed, 14 insertions, 9 deletions
diff --git a/arch/m68k/platform/68328/config.c b/arch/m68k/platform/68328/config.c index d70bf2623db1..44b866544314 100644 --- a/arch/m68k/platform/68328/config.c +++ b/arch/m68k/platform/68328/config.c | |||
@@ -17,6 +17,7 @@ | |||
17 | 17 | ||
18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
19 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
20 | #include <linux/rtc.h> | ||
20 | #include <asm/system.h> | 21 | #include <asm/system.h> |
21 | #include <asm/machdep.h> | 22 | #include <asm/machdep.h> |
22 | #include <asm/MC68328.h> | 23 | #include <asm/MC68328.h> |
@@ -26,7 +27,7 @@ | |||
26 | 27 | ||
27 | /***************************************************************************/ | 28 | /***************************************************************************/ |
28 | 29 | ||
29 | void m68328_timer_gettod(int *year, int *mon, int *day, int *hour, int *min, int *sec); | 30 | int m68328_hwclk(int set, struct rtc_time *t); |
30 | 31 | ||
31 | /***************************************************************************/ | 32 | /***************************************************************************/ |
32 | 33 | ||
@@ -48,7 +49,7 @@ void config_BSP(char *command, int len) | |||
48 | printk(KERN_INFO "68328 support Kenneth Albanowski <kjahds@kjshds.com>\n"); | 49 | printk(KERN_INFO "68328 support Kenneth Albanowski <kjahds@kjshds.com>\n"); |
49 | printk(KERN_INFO "68328/Pilot support Bernhard Kuhn <kuhn@lpr.e-technik.tu-muenchen.de>\n"); | 50 | printk(KERN_INFO "68328/Pilot support Bernhard Kuhn <kuhn@lpr.e-technik.tu-muenchen.de>\n"); |
50 | 51 | ||
51 | mach_gettod = m68328_timer_gettod; | 52 | mach_hwclk = m68328_hwclk; |
52 | mach_reset = m68328_reset; | 53 | mach_reset = m68328_reset; |
53 | } | 54 | } |
54 | 55 | ||
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 | ||
122 | void m68328_timer_gettod(int *year, int *mon, int *day, int *hour, int *min, int *sec) | 123 | int 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 | /***************************************************************************/ |