diff options
Diffstat (limited to 'drivers/rtc/rtc-twl.c')
-rw-r--r-- | drivers/rtc/rtc-twl.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c index 8bc6c80b184c..8751a5240c99 100644 --- a/drivers/rtc/rtc-twl.c +++ b/drivers/rtc/rtc-twl.c | |||
@@ -566,11 +566,10 @@ static void twl_rtc_shutdown(struct platform_device *pdev) | |||
566 | mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M); | 566 | mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M); |
567 | } | 567 | } |
568 | 568 | ||
569 | #ifdef CONFIG_PM | 569 | #ifdef CONFIG_PM_SLEEP |
570 | |||
571 | static unsigned char irqstat; | 570 | static unsigned char irqstat; |
572 | 571 | ||
573 | static int twl_rtc_suspend(struct platform_device *pdev, pm_message_t state) | 572 | static int twl_rtc_suspend(struct device *dev) |
574 | { | 573 | { |
575 | irqstat = rtc_irq_bits; | 574 | irqstat = rtc_irq_bits; |
576 | 575 | ||
@@ -578,17 +577,15 @@ static int twl_rtc_suspend(struct platform_device *pdev, pm_message_t state) | |||
578 | return 0; | 577 | return 0; |
579 | } | 578 | } |
580 | 579 | ||
581 | static int twl_rtc_resume(struct platform_device *pdev) | 580 | static int twl_rtc_resume(struct device *dev) |
582 | { | 581 | { |
583 | set_rtc_irq_bit(irqstat); | 582 | set_rtc_irq_bit(irqstat); |
584 | return 0; | 583 | return 0; |
585 | } | 584 | } |
586 | |||
587 | #else | ||
588 | #define twl_rtc_suspend NULL | ||
589 | #define twl_rtc_resume NULL | ||
590 | #endif | 585 | #endif |
591 | 586 | ||
587 | static SIMPLE_DEV_PM_OPS(twl_rtc_pm_ops, twl_rtc_suspend, twl_rtc_resume); | ||
588 | |||
592 | #ifdef CONFIG_OF | 589 | #ifdef CONFIG_OF |
593 | static const struct of_device_id twl_rtc_of_match[] = { | 590 | static const struct of_device_id twl_rtc_of_match[] = { |
594 | {.compatible = "ti,twl4030-rtc", }, | 591 | {.compatible = "ti,twl4030-rtc", }, |
@@ -603,11 +600,10 @@ static struct platform_driver twl4030rtc_driver = { | |||
603 | .probe = twl_rtc_probe, | 600 | .probe = twl_rtc_probe, |
604 | .remove = twl_rtc_remove, | 601 | .remove = twl_rtc_remove, |
605 | .shutdown = twl_rtc_shutdown, | 602 | .shutdown = twl_rtc_shutdown, |
606 | .suspend = twl_rtc_suspend, | ||
607 | .resume = twl_rtc_resume, | ||
608 | .driver = { | 603 | .driver = { |
609 | .owner = THIS_MODULE, | 604 | .owner = THIS_MODULE, |
610 | .name = "twl_rtc", | 605 | .name = "twl_rtc", |
606 | .pm = &twl_rtc_pm_ops, | ||
611 | .of_match_table = of_match_ptr(twl_rtc_of_match), | 607 | .of_match_table = of_match_ptr(twl_rtc_of_match), |
612 | }, | 608 | }, |
613 | }; | 609 | }; |