diff options
| author | Krzysztof Kozlowski <[email protected]> | 2013-12-12 17:12:30 -0800 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2013-12-12 18:19:26 -0800 |
| commit | 222ead7fd80f455ac377ae20dfeb56cab513db96 (patch) | |
| tree | d32eb368882569d2b9ba1d30805b0e3f658b7f9b | |
| parent | d73238d4a6ca2eadbd14565d769706c85650c641 (diff) | |
rtc: s5m: enable IRQ wake during suspend
Add PM suspend/resume ops to rtc-s5m driver and enable IRQ wake during
suspend so the RTC would act like a wake up source. This allows waking
up from suspend to RAM on RTC alarm interrupt.
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Cc: Mark Brown <[email protected]>
Acked-by: Sangbeom Kim <[email protected]>
Cc: Samuel Ortiz <[email protected]>
Cc: Lee Jones <[email protected]>
Cc: Liam Girdwood <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Cc: Marek Szyprowski <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Kyungmin Park <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
| -rw-r--r-- | drivers/rtc/rtc-s5m.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c index 977b40cd32a7..0ba56b7cb382 100644 --- a/drivers/rtc/rtc-s5m.c +++ b/drivers/rtc/rtc-s5m.c @@ -639,6 +639,30 @@ static void s5m_rtc_shutdown(struct platform_device *pdev) s5m_rtc_enable_smpl(info, false); } +static int s5m_rtc_resume(struct device *dev) +{ + struct s5m_rtc_info *info = dev_get_drvdata(dev); + int ret = 0; + + if (device_may_wakeup(dev)) + ret = disable_irq_wake(info->irq); + + return ret; +} + +static int s5m_rtc_suspend(struct device *dev) +{ + struct s5m_rtc_info *info = dev_get_drvdata(dev); + int ret = 0; + + if (device_may_wakeup(dev)) + ret = enable_irq_wake(info->irq); + + return ret; +} + +static SIMPLE_DEV_PM_OPS(s5m_rtc_pm_ops, s5m_rtc_suspend, s5m_rtc_resume); + static const struct platform_device_id s5m_rtc_id[] = { { "s5m-rtc", 0 }, }; @@ -647,6 +671,7 @@ static struct platform_driver s5m_rtc_driver = { .driver = { .name = "s5m-rtc", .owner = THIS_MODULE, + .pm = &s5m_rtc_pm_ops, }, .probe = s5m_rtc_probe, .shutdown = s5m_rtc_shutdown, |