From: Johan Hovold Date: Wed, 10 Dec 2014 23:53:16 +0000 (-0800) Subject: rtc: omap: enable wake-up from power off X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8ad5c722d592ae1965195651965c02396b42fe1a;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git rtc: omap: enable wake-up from power off The ALARM interrupt must not be disabled during shutdown in order to be able to power up the system using an RTC alarm. Signed-off-by: Johan Hovold Cc: Alessandro Zummo Cc: Tony Lindgren Cc: Benot Cousson Cc: Lokesh Vutla Cc: Guenter Roeck Cc: Sekhar Nori Cc: Tero Kristo Cc: Keerthy J Tested-by: Felipe Balbi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c index e83f51ae7f63..0dfb0404f867 100644 --- a/drivers/rtc/rtc-omap.c +++ b/drivers/rtc/rtc-omap.c @@ -694,8 +694,15 @@ static SIMPLE_DEV_PM_OPS(omap_rtc_pm_ops, omap_rtc_suspend, omap_rtc_resume); static void omap_rtc_shutdown(struct platform_device *pdev) { struct omap_rtc *rtc = platform_get_drvdata(pdev); + u8 mask; - rtc_write(rtc, OMAP_RTC_INTERRUPTS_REG, 0); + /* + * Keep the ALARM interrupt enabled to allow the system to power up on + * alarm events. + */ + mask = rtc_read(rtc, OMAP_RTC_INTERRUPTS_REG); + mask &= OMAP_RTC_INTERRUPTS_IT_ALARM; + rtc_write(rtc, OMAP_RTC_INTERRUPTS_REG, mask); } static struct platform_driver omap_rtc_driver = {