#include <linux/io.h>
#include <linux/bcd.h>
#include <linux/delay.h>
+#include <linux/pm_wakeirq.h>
#include <linux/slab.h>
/*
{
struct pl031_local *ldata = dev_get_drvdata(&adev->dev);
+ dev_pm_clear_wake_irq(&adev->dev);
+ device_init_wakeup(&adev->dev, false);
free_irq(adev->irq[0], ldata);
rtc_device_unregister(ldata->rtc);
iounmap(ldata->base);
}
}
- device_init_wakeup(&adev->dev, 1);
+ device_init_wakeup(&adev->dev, true);
ldata->rtc = rtc_device_register("pl031", &adev->dev, ops,
THIS_MODULE);
if (IS_ERR(ldata->rtc)) {
ret = -EIO;
goto out_no_irq;
}
-
+ dev_pm_set_wake_irq(&adev->dev, adev->irq[0]);
return 0;
out_no_irq:
.set_alarm = pl031_set_alarm,
.alarm_irq_enable = pl031_alarm_irq_enable,
},
- .irqflags = IRQF_NO_SUSPEND,
};
/* The First ST derivative */
},
.clockwatch = true,
.st_weekday = true,
- .irqflags = IRQF_NO_SUSPEND,
};
/* And the second ST derivative */
/*
* This variant shares the IRQ with another block and must not
* suspend that IRQ line.
+ * TODO check if it shares with IRQF_NO_SUSPEND user, else we can
+ * remove IRQF_COND_SUSPEND
*/
- .irqflags = IRQF_SHARED | IRQF_NO_SUSPEND,
+ .irqflags = IRQF_SHARED | IRQF_COND_SUSPEND,
};
static struct amba_id pl031_ids[] = {