Skip to content

Commit

Permalink
rtc: ab8500: remove misuse of IRQF_NO_SUSPEND flag
Browse files Browse the repository at this point in the history
The IRQF_NO_SUSPEND flag is used to identify the interrupts that should
be left enabled so as to allow them to work as expected during the
suspend-resume cycle, but doesn't guarantee that it will wake the system
from a suspended state, enable_irq_wake is recommended to be used for
the wakeup.

This patch removes the use of IRQF_NO_SUSPEND flags and uses newly
introduce PM wakeup APIs dev_pm_{set,clear}_wake_irq.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: rtc-linux@googlegroups.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
  • Loading branch information
Sudeep Holla authored and Alexandre Belloni committed Nov 8, 2015
1 parent eff6dd4 commit 93a6f91
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/rtc/rtc-ab8500.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <linux/mfd/abx500/ab8500.h>
#include <linux/delay.h>
#include <linux/of.h>
#include <linux/pm_wakeirq.h>

#define AB8500_RTC_SOFF_STAT_REG 0x00
#define AB8500_RTC_CC_CONF_REG 0x01
Expand Down Expand Up @@ -493,11 +494,12 @@ static int ab8500_rtc_probe(struct platform_device *pdev)
}

err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
rtc_alarm_handler, IRQF_NO_SUSPEND | IRQF_ONESHOT,
rtc_alarm_handler, IRQF_ONESHOT,
"ab8500-rtc", rtc);
if (err < 0)
return err;

dev_pm_set_wake_irq(&pdev->dev, irq);
platform_set_drvdata(pdev, rtc);

err = ab8500_sysfs_rtc_register(&pdev->dev);
Expand All @@ -513,6 +515,8 @@ static int ab8500_rtc_probe(struct platform_device *pdev)

static int ab8500_rtc_remove(struct platform_device *pdev)
{
dev_pm_clear_wake_irq(&pdev->dev);
device_init_wakeup(&pdev->dev, false);
ab8500_sysfs_rtc_unregister(&pdev->dev);

return 0;
Expand Down

0 comments on commit 93a6f91

Please sign in to comment.