The patch titled Subject: rtc: max77686: Allow the max77686 rtc to wakeup the system has been added to the -mm tree. Its filename is rtc-max77686-allow-the-max77686-rtc-to-wakeup-the-system.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/rtc-max77686-allow-the-max77686-rtc-to-wakeup-the-system.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/rtc-max77686-allow-the-max77686-rtc-to-wakeup-the-system.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Doug Anderson <dianders@xxxxxxxxxxxx> Subject: rtc: max77686: Allow the max77686 rtc to wakeup the system The max77686 includes an RTC that keeps power during suspend. It's convenient to be able to use it as a wakeup source. Signed-off-by: Doug Anderson <dianders@xxxxxxxxxxxx> Signed-off-by: Javier Martinez Canillas <javier.martinez@xxxxxxxxxxxxxxx> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@xxxxxxxxxxx> Cc: Alessandro Zummo <a.zummo@xxxxxxxxxxxx> Cc: Olof Johansson <olof@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/rtc/rtc-max77686.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff -puN drivers/rtc/rtc-max77686.c~rtc-max77686-allow-the-max77686-rtc-to-wakeup-the-system drivers/rtc/rtc-max77686.c --- a/drivers/rtc/rtc-max77686.c~rtc-max77686-allow-the-max77686-rtc-to-wakeup-the-system +++ a/drivers/rtc/rtc-max77686.c @@ -583,6 +583,33 @@ static void max77686_rtc_shutdown(struct #endif /* MAX77686_RTC_WTSR_SMPL */ } +#ifdef CONFIG_PM_SLEEP +static int max77686_rtc_suspend(struct device *dev) +{ + if (device_may_wakeup(dev)) { + struct max77686_rtc_info *info = dev_get_drvdata(dev); + + return enable_irq_wake(info->virq); + } + + return 0; +} + +static int max77686_rtc_resume(struct device *dev) +{ + if (device_may_wakeup(dev)) { + struct max77686_rtc_info *info = dev_get_drvdata(dev); + + return disable_irq_wake(info->virq); + } + + return 0; +} +#endif + +static SIMPLE_DEV_PM_OPS(max77686_rtc_pm_ops, + max77686_rtc_suspend, max77686_rtc_resume); + static const struct platform_device_id rtc_id[] = { { "max77686-rtc", 0 }, {}, @@ -592,6 +619,7 @@ static struct platform_driver max77686_r .driver = { .name = "max77686-rtc", .owner = THIS_MODULE, + .pm = &max77686_rtc_pm_ops, }, .probe = max77686_rtc_probe, .shutdown = max77686_rtc_shutdown, _ Patches currently in -mm which might be from dianders@xxxxxxxxxxxx are rtc-rk808-add-rtc-driver-for-rk808.patch rtc-rk808-add-rtc-driver-for-rk808-fix-2.patch clk-rk808-add-clkout-driver-for-rk808.patch rtc-max77686-allow-the-max77686-rtc-to-wakeup-the-system.patch rtc-max77686-remove-dead-code-for-smpl-and-wtsr.patch rtc-max77686-fail-to-probe-if-no-rtc-regmap-irqchip-is-set.patch rtc-max77686-remove-unneded-info-log.patch rtc-add-driver-for-maxim-77802-pmic-real-time-clock.patch linux-next.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html