summaryrefslogtreecommitdiff
path: root/drivers/rtc
diff options
context:
space:
mode:
authorAlejandro Gonzalez <alex.gonzalez@digi.com>2010-06-23 14:13:29 +0200
committerAlejandro Gonzalez <alex.gonzalez@digi.com>2010-06-23 14:31:10 +0200
commita7ffa03d4fd492441def38a3c770615b342c7e6a (patch)
tree583ab7e1873a34a2b2a18b6680a24e1f269a4b5f /drivers/rtc
parent436bc07e9deda38533233e1b1d822f0b360d1f60 (diff)
ccwmx51: Do not unconditionally set the PMIC as a suspend wake up source
This behaviour was causing that even when the user has not explicitely set a wakeup source the system was suspending without a way to awake. With this change the RTC wake up source is set up when its suspend method is called, making it possible to check for enabled wake up sources on the platform suspend enter. Signed-off-by: Alejandro Gonzalez <alex.gonzalez@digi.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-mc13892.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-mc13892.c b/drivers/rtc/rtc-mc13892.c
index e579c1853a26..3b7e3af4e54c 100644
--- a/drivers/rtc/rtc-mc13892.c
+++ b/drivers/rtc/rtc-mc13892.c
@@ -207,7 +207,8 @@ static int mxc_rtc_probe(struct platform_device *pdev)
pdata->event.param = pdata;
CHECK_ERROR(pmic_event_subscribe(EVENT_TODAI, pdata->event));
- device_init_wakeup(&pdev->dev, 1);
+ device_init_wakeup(&pdev->dev, 0);
+ device_set_wakeup_capable(&pdev->dev, 1);
pdata->rtc = rtc_device_register(pdev->name, &pdev->dev,
&mxc_rtc_ops, THIS_MODULE);
@@ -229,12 +230,20 @@ static int __exit mxc_rtc_remove(struct platform_device *pdev)
return 0;
}
+static int mxc_rtc_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ if (device_may_wakeup(&pdev->dev))
+ enable_irq_wake(platform_get_irq(pdev, 0));
+ return 0;
+}
+
static struct platform_driver mxc_rtc_driver = {
.driver = {
.name = "pmic_rtc",
},
.probe = mxc_rtc_probe,
.remove = __exit_p(mxc_rtc_remove),
+ .suspend = mxc_rtc_suspend,
};
static int __init mxc_rtc_init(void)