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>2011-01-20 19:15:40 +0100
commit3933ef3b2392d5ec5a0508f546669aa791647ae5 (patch)
treebe64bc9b1f95f36eafde507193cb35c70a52d415 /drivers/rtc
parentd71e4d143608a33aaecff9f2fb523debf24bb5e7 (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 8abe1ba02bc0..fa4e9c685f4b 100644
--- a/drivers/rtc/rtc-mc13892.c
+++ b/drivers/rtc/rtc-mc13892.c
@@ -208,7 +208,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);
@@ -230,12 +231,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)