@@ -538,11 +538,15 @@ static struct bin_attribute nvram = {
static struct cmos_rtc cmos_rtc;
+static struct wakeup_source *rtc_cmos_wakelock;
+
static irqreturn_t cmos_interrupt(int irq, void *p)
{
u8 irqstat;
u8 rtc_control;
+ __pm_stay_awake(rtc_cmos_wakelock);
+
spin_lock(&rtc_lock);
/* When the HPET interrupt handler calls us, the interrupt
@@ -573,9 +577,12 @@ static irqreturn_t cmos_interrupt(int irq, void *p)
if (is_intr(irqstat)) {
rtc_update_irq(p, 1, irqstat);
+ __pm_relax(rtc_cmos_wakelock);
return IRQ_HANDLED;
- } else
- return IRQ_NONE;
+ }
+
+ __pm_relax(rtc_cmos_wakelock);
+ return IRQ_NONE;
}
#ifdef CONFIG_PNP
@@ -1153,6 +1160,8 @@ static int __init cmos_init(void)
{
int retval = 0;
+ rtc_cmos_wakelock = wakeup_source_register("rtc_cmos");
+
#ifdef CONFIG_PNP
retval = pnp_register_driver(&cmos_pnp_driver);
if (retval == 0)
Flag the rtc-cmos IRQ event as a wakeup event using pm_stay_awake and pm_relax() Signed-off-by: John Stultz <john.stultz@linaro.org> --- drivers/rtc/rtc-cmos.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-)