aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powermac/time.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-03-19 06:53:53 -0400
committerPaul Mackerras <paulus@samba.org>2007-03-25 22:35:14 -0400
commit17e638bc28f2fdc9c0d3eebfb80fce43827b8d12 (patch)
treebaedb1e3e83358ea41331d763dcca560ea4f8e2a /arch/powerpc/platforms/powermac/time.c
parentec5f77e789a02adf7c45f03a76455b4e71ae1c5b (diff)
[POWERPC] Generic time suspend/resume code
This removes the time suspend/restore code that was done through a PMU notifier in arch/platforms/powermac/time.c. Instead, introduce arch/powerpc/sysdev/timer.c which creates a sys device and handles time of day suspend/resume through that. This should probably be replaced by using the generic RTC framework but for now it gets rid of the arcane powermac specific hack. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/powermac/time.c')
-rw-r--r--arch/powerpc/platforms/powermac/time.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/arch/powerpc/platforms/powermac/time.c b/arch/powerpc/platforms/powermac/time.c
index a4173906e945..bf9da56942e8 100644
--- a/arch/powerpc/platforms/powermac/time.c
+++ b/arch/powerpc/platforms/powermac/time.c
@@ -297,49 +297,11 @@ int __init via_calibrate_decr(void)
297} 297}
298#endif 298#endif
299 299
300#ifdef CONFIG_PM
301/*
302 * Reset the time after a sleep.
303 */
304static int
305time_sleep_notify(struct pmu_sleep_notifier *self, int when)
306{
307 static unsigned long time_diff;
308 unsigned long flags;
309 unsigned long seq;
310 struct timespec tv;
311
312 switch (when) {
313 case PBOOK_SLEEP_NOW:
314 do {
315 seq = read_seqbegin_irqsave(&xtime_lock, flags);
316 time_diff = xtime.tv_sec - pmac_get_boot_time();
317 } while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
318 break;
319 case PBOOK_WAKE:
320 tv.tv_sec = pmac_get_boot_time() + time_diff;
321 tv.tv_nsec = 0;
322 do_settimeofday(&tv);
323 break;
324 }
325 return PBOOK_SLEEP_OK;
326}
327
328static struct pmu_sleep_notifier time_sleep_notifier = {
329 time_sleep_notify, SLEEP_LEVEL_MISC,
330};
331#endif /* CONFIG_PM */
332
333/* 300/*
334 * Query the OF and get the decr frequency. 301 * Query the OF and get the decr frequency.
335 */ 302 */
336void __init pmac_calibrate_decr(void) 303void __init pmac_calibrate_decr(void)
337{ 304{
338#if defined(CONFIG_PM) && defined(CONFIG_ADB_PMU)
339 /* XXX why here? */
340 pmu_register_sleep_notifier(&time_sleep_notifier);
341#endif
342
343 generic_calibrate_decr(); 305 generic_calibrate_decr();
344 306
345#ifdef CONFIG_PPC32 307#ifdef CONFIG_PPC32