Commit 222ead7f authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Linus Torvalds

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: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Cc: Mark Brown <broonie@linaro.org>
Acked-by: default avatarSangbeom Kim <sbkim73@samsung.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d73238d4
...@@ -639,6 +639,30 @@ static void s5m_rtc_shutdown(struct platform_device *pdev) ...@@ -639,6 +639,30 @@ static void s5m_rtc_shutdown(struct platform_device *pdev)
s5m_rtc_enable_smpl(info, false); 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[] = { static const struct platform_device_id s5m_rtc_id[] = {
{ "s5m-rtc", 0 }, { "s5m-rtc", 0 },
}; };
...@@ -647,6 +671,7 @@ static struct platform_driver s5m_rtc_driver = { ...@@ -647,6 +671,7 @@ static struct platform_driver s5m_rtc_driver = {
.driver = { .driver = {
.name = "s5m-rtc", .name = "s5m-rtc",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = &s5m_rtc_pm_ops,
}, },
.probe = s5m_rtc_probe, .probe = s5m_rtc_probe,
.shutdown = s5m_rtc_shutdown, .shutdown = s5m_rtc_shutdown,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment