#include <linux/rtc.h>
#include <linux/bcd.h>
#include <linux/pm.h>
+#include <linux/pm_wakeirq.h>
#include <linux/slab.h>
#define DS1343_DRV_VERSION "01.00"
if (priv->irq >= 0) {
res = devm_request_threaded_irq(&spi->dev, spi->irq, NULL,
- ds1343_thread,
- IRQF_NO_SUSPEND | IRQF_ONESHOT,
+ ds1343_thread, IRQF_ONESHOT,
"ds1343", priv);
if (res) {
priv->irq = -1;
dev_err(&spi->dev,
"unable to request irq for rtc ds1343\n");
} else {
- device_set_wakeup_capable(&spi->dev, 1);
+ device_init_wakeup(&spi->dev, true);
+ dev_pm_set_wake_irq(&spi->dev, spi->irq);
}
}
priv->irqen &= ~RTC_AF;
mutex_unlock(&priv->mutex);
+ dev_pm_clear_wake_irq(&spi->dev);
+ device_init_wakeup(&spi->dev, false);
devm_free_irq(&spi->dev, spi->irq, priv);
}