aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/dec
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2007-10-11 18:46:08 -0400
committerRalf Baechle <ralf@linux-mips.org>2007-10-11 18:46:08 -0400
commit4b550488f894c899aa54dc935c8fee47bca2b7df (patch)
treef7ee1d0ff80542124b5fa864a30022277d703c49 /arch/mips/dec
parentf5ff0a280201c9cbfb6e9eb4bafdb465c2269ed3 (diff)
[MIPS] Deforest the function pointer jungle in the time code.
Hard to follow who is pointing what to where and why so it's simply getting in the way of the time code renovation. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/dec')
-rw-r--r--arch/mips/dec/setup.c4
-rw-r--r--arch/mips/dec/time.c12
2 files changed, 4 insertions, 12 deletions
diff --git a/arch/mips/dec/setup.c b/arch/mips/dec/setup.c
index 3e634f2f5443..bd5431e1f408 100644
--- a/arch/mips/dec/setup.c
+++ b/arch/mips/dec/setup.c
@@ -145,13 +145,9 @@ static void __init dec_be_init(void)
145 } 145 }
146} 146}
147 147
148
149extern void dec_time_init(void);
150
151void __init plat_mem_setup(void) 148void __init plat_mem_setup(void)
152{ 149{
153 board_be_init = dec_be_init; 150 board_be_init = dec_be_init;
154 board_time_init = dec_time_init;
155 151
156 wbflush_setup(); 152 wbflush_setup();
157 153
diff --git a/arch/mips/dec/time.c b/arch/mips/dec/time.c
index e2973a432b92..820e5331205f 100644
--- a/arch/mips/dec/time.c
+++ b/arch/mips/dec/time.c
@@ -35,7 +35,7 @@
35#include <asm/dec/ioasic_addrs.h> 35#include <asm/dec/ioasic_addrs.h>
36#include <asm/dec/machtype.h> 36#include <asm/dec/machtype.h>
37 37
38static unsigned long dec_rtc_get_time(void) 38unsigned long read_persistent_clock(void)
39{ 39{
40 unsigned int year, mon, day, hour, min, sec, real_year; 40 unsigned int year, mon, day, hour, min, sec, real_year;
41 unsigned long flags; 41 unsigned long flags;
@@ -74,13 +74,13 @@ static unsigned long dec_rtc_get_time(void)
74} 74}
75 75
76/* 76/*
77 * In order to set the CMOS clock precisely, dec_rtc_set_mmss has to 77 * In order to set the CMOS clock precisely, rtc_mips_set_mmss has to
78 * be called 500 ms after the second nowtime has started, because when 78 * be called 500 ms after the second nowtime has started, because when
79 * nowtime is written into the registers of the CMOS clock, it will 79 * nowtime is written into the registers of the CMOS clock, it will
80 * jump to the next second precisely 500 ms later. Check the Dallas 80 * jump to the next second precisely 500 ms later. Check the Dallas
81 * DS1287 data sheet for details. 81 * DS1287 data sheet for details.
82 */ 82 */
83static int dec_rtc_set_mmss(unsigned long nowtime) 83int rtc_mips_set_mmss(unsigned long nowtime)
84{ 84{
85 int retval = 0; 85 int retval = 0;
86 int real_seconds, real_minutes, cmos_minutes; 86 int real_seconds, real_minutes, cmos_minutes;
@@ -139,7 +139,6 @@ static int dec_rtc_set_mmss(unsigned long nowtime)
139 return retval; 139 return retval;
140} 140}
141 141
142
143static int dec_timer_state(void) 142static int dec_timer_state(void)
144{ 143{
145 return (CMOS_READ(RTC_REG_C) & RTC_PF) != 0; 144 return (CMOS_READ(RTC_REG_C) & RTC_PF) != 0;
@@ -160,11 +159,8 @@ static cycle_t dec_ioasic_hpt_read(void)
160} 159}
161 160
162 161
163void __init dec_time_init(void) 162void __init plat_time_init(void)
164{ 163{
165 rtc_mips_get_time = dec_rtc_get_time;
166 rtc_mips_set_mmss = dec_rtc_set_mmss;
167
168 mips_timer_state = dec_timer_state; 164 mips_timer_state = dec_timer_state;
169 mips_timer_ack = dec_timer_ack; 165 mips_timer_ack = dec_timer_ack;
170 166