aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-at91rm9200.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-at91rm9200.c')
-rw-r--r--drivers/rtc/rtc-at91rm9200.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/drivers/rtc/rtc-at91rm9200.c b/drivers/rtc/rtc-at91rm9200.c
index 2f06b5f9fb7b..33795e5a5595 100644
--- a/drivers/rtc/rtc-at91rm9200.c
+++ b/drivers/rtc/rtc-at91rm9200.c
@@ -348,21 +348,10 @@ static int __exit at91_rtc_remove(struct platform_device *pdev)
348 348
349/* AT91RM9200 RTC Power management control */ 349/* AT91RM9200 RTC Power management control */
350 350
351static struct timespec at91_rtc_delta;
352static u32 at91_rtc_imr; 351static u32 at91_rtc_imr;
353 352
354static int at91_rtc_suspend(struct platform_device *pdev, pm_message_t state) 353static int at91_rtc_suspend(struct platform_device *pdev, pm_message_t state)
355{ 354{
356 struct rtc_time tm;
357 struct timespec time;
358
359 time.tv_nsec = 0;
360
361 /* calculate time delta for suspend */
362 at91_rtc_readtime(&pdev->dev, &tm);
363 rtc_tm_to_time(&tm, &time.tv_sec);
364 save_time_delta(&at91_rtc_delta, &time);
365
366 /* this IRQ is shared with DBGU and other hardware which isn't 355 /* this IRQ is shared with DBGU and other hardware which isn't
367 * necessarily doing PM like we are... 356 * necessarily doing PM like we are...
368 */ 357 */
@@ -374,36 +363,17 @@ static int at91_rtc_suspend(struct platform_device *pdev, pm_message_t state)
374 else 363 else
375 at91_sys_write(AT91_RTC_IDR, at91_rtc_imr); 364 at91_sys_write(AT91_RTC_IDR, at91_rtc_imr);
376 } 365 }
377
378 pr_debug("%s(): %4d-%02d-%02d %02d:%02d:%02d\n", __FUNCTION__,
379 1900 + tm.tm_year, tm.tm_mon, tm.tm_mday,
380 tm.tm_hour, tm.tm_min, tm.tm_sec);
381
382 return 0; 366 return 0;
383} 367}
384 368
385static int at91_rtc_resume(struct platform_device *pdev) 369static int at91_rtc_resume(struct platform_device *pdev)
386{ 370{
387 struct rtc_time tm;
388 struct timespec time;
389
390 time.tv_nsec = 0;
391
392 at91_rtc_readtime(&pdev->dev, &tm);
393 rtc_tm_to_time(&tm, &time.tv_sec);
394 restore_time_delta(&at91_rtc_delta, &time);
395
396 if (at91_rtc_imr) { 371 if (at91_rtc_imr) {
397 if (device_may_wakeup(&pdev->dev)) 372 if (device_may_wakeup(&pdev->dev))
398 disable_irq_wake(AT91_ID_SYS); 373 disable_irq_wake(AT91_ID_SYS);
399 else 374 else
400 at91_sys_write(AT91_RTC_IER, at91_rtc_imr); 375 at91_sys_write(AT91_RTC_IER, at91_rtc_imr);
401 } 376 }
402
403 pr_debug("%s(): %4d-%02d-%02d %02d:%02d:%02d\n", __FUNCTION__,
404 1900 + tm.tm_year, tm.tm_mon, tm.tm_mday,
405 tm.tm_hour, tm.tm_min, tm.tm_sec);
406
407 return 0; 377 return 0;
408} 378}
409#else 379#else