diff options
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-bfin.c | 15 | ||||
-rw-r--r-- | drivers/rtc/rtc-m41t80.c | 2 | ||||
-rw-r--r-- | drivers/rtc/rtc-pl031.c | 2 |
3 files changed, 14 insertions, 5 deletions
diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c index 72b2bcc2c224..d4fb82d85e9b 100644 --- a/drivers/rtc/rtc-bfin.c +++ b/drivers/rtc/rtc-bfin.c | |||
@@ -426,7 +426,7 @@ static int bfin_rtc_suspend(struct platform_device *pdev, pm_message_t state) | |||
426 | enable_irq_wake(IRQ_RTC); | 426 | enable_irq_wake(IRQ_RTC); |
427 | bfin_rtc_sync_pending(&pdev->dev); | 427 | bfin_rtc_sync_pending(&pdev->dev); |
428 | } else | 428 | } else |
429 | bfin_rtc_int_clear(-1); | 429 | bfin_rtc_int_clear(0); |
430 | 430 | ||
431 | return 0; | 431 | return 0; |
432 | } | 432 | } |
@@ -435,8 +435,17 @@ static int bfin_rtc_resume(struct platform_device *pdev) | |||
435 | { | 435 | { |
436 | if (device_may_wakeup(&pdev->dev)) | 436 | if (device_may_wakeup(&pdev->dev)) |
437 | disable_irq_wake(IRQ_RTC); | 437 | disable_irq_wake(IRQ_RTC); |
438 | else | 438 | |
439 | bfin_write_RTC_ISTAT(-1); | 439 | /* |
440 | * Since only some of the RTC bits are maintained externally in the | ||
441 | * Vbat domain, we need to wait for the RTC MMRs to be synced into | ||
442 | * the core after waking up. This happens every RTC 1HZ. Once that | ||
443 | * has happened, we can go ahead and re-enable the important write | ||
444 | * complete interrupt event. | ||
445 | */ | ||
446 | while (!(bfin_read_RTC_ISTAT() & RTC_ISTAT_SEC)) | ||
447 | continue; | ||
448 | bfin_rtc_int_set(RTC_ISTAT_WRITE_COMPLETE); | ||
440 | 449 | ||
441 | return 0; | 450 | return 0; |
442 | } | 451 | } |
diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c index 66377f3e28b8..d60557cae8ef 100644 --- a/drivers/rtc/rtc-m41t80.c +++ b/drivers/rtc/rtc-m41t80.c | |||
@@ -364,7 +364,7 @@ static int m41t80_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *t) | |||
364 | t->time.tm_isdst = -1; | 364 | t->time.tm_isdst = -1; |
365 | t->enabled = !!(reg[M41T80_REG_ALARM_MON] & M41T80_ALMON_AFE); | 365 | t->enabled = !!(reg[M41T80_REG_ALARM_MON] & M41T80_ALMON_AFE); |
366 | t->pending = !!(reg[M41T80_REG_FLAGS] & M41T80_FLAGS_AF); | 366 | t->pending = !!(reg[M41T80_REG_FLAGS] & M41T80_FLAGS_AF); |
367 | return rtc_valid_tm(t); | 367 | return 0; |
368 | } | 368 | } |
369 | 369 | ||
370 | static struct rtc_class_ops m41t80_rtc_ops = { | 370 | static struct rtc_class_ops m41t80_rtc_ops = { |
diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c index 6c418fe7f288..b7a6690e5b35 100644 --- a/drivers/rtc/rtc-pl031.c +++ b/drivers/rtc/rtc-pl031.c | |||
@@ -403,7 +403,7 @@ static int pl031_probe(struct amba_device *adev, struct amba_id *id) | |||
403 | } | 403 | } |
404 | 404 | ||
405 | if (request_irq(adev->irq[0], pl031_interrupt, | 405 | if (request_irq(adev->irq[0], pl031_interrupt, |
406 | IRQF_DISABLED | IRQF_SHARED, "rtc-pl031", ldata)) { | 406 | IRQF_DISABLED, "rtc-pl031", ldata)) { |
407 | ret = -EIO; | 407 | ret = -EIO; |
408 | goto out_no_irq; | 408 | goto out_no_irq; |
409 | } | 409 | } |