summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSudeep Holla <Sudeep.Holla@arm.com>2015-09-21 11:46:57 -0400
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>2015-11-08 08:12:24 -0500
commiteff6dd41c2240f49e562b89d50ed3e86485cc4ad (patch)
tree0abf1c8eea4fe9a7b0938879d5c8c91edc720de6
parentc35300941656508d37315625d276c5a104823505 (diff)
rtc: pl031: remove misuse of IRQF_NO_SUSPEND flag
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>
-rw-r--r--drivers/rtc/rtc-pl031.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c
index 41dcb7ddb906..e1687e19c59f 100644
--- a/drivers/rtc/rtc-pl031.c
+++ b/drivers/rtc/rtc-pl031.c
@@ -23,6 +23,7 @@
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/bcd.h> 24#include <linux/bcd.h>
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <linux/pm_wakeirq.h>
26#include <linux/slab.h> 27#include <linux/slab.h>
27 28
28/* 29/*
@@ -305,6 +306,8 @@ static int pl031_remove(struct amba_device *adev)
305{ 306{
306 struct pl031_local *ldata = dev_get_drvdata(&adev->dev); 307 struct pl031_local *ldata = dev_get_drvdata(&adev->dev);
307 308
309 dev_pm_clear_wake_irq(&adev->dev);
310 device_init_wakeup(&adev->dev, false);
308 free_irq(adev->irq[0], ldata); 311 free_irq(adev->irq[0], ldata);
309 rtc_device_unregister(ldata->rtc); 312 rtc_device_unregister(ldata->rtc);
310 iounmap(ldata->base); 313 iounmap(ldata->base);
@@ -370,7 +373,7 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
370 } 373 }
371 } 374 }
372 375
373 device_init_wakeup(&adev->dev, 1); 376 device_init_wakeup(&adev->dev, true);
374 ldata->rtc = rtc_device_register("pl031", &adev->dev, ops, 377 ldata->rtc = rtc_device_register("pl031", &adev->dev, ops,
375 THIS_MODULE); 378 THIS_MODULE);
376 if (IS_ERR(ldata->rtc)) { 379 if (IS_ERR(ldata->rtc)) {
@@ -383,7 +386,7 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
383 ret = -EIO; 386 ret = -EIO;
384 goto out_no_irq; 387 goto out_no_irq;
385 } 388 }
386 389 dev_pm_set_wake_irq(&adev->dev, adev->irq[0]);
387 return 0; 390 return 0;
388 391
389out_no_irq: 392out_no_irq:
@@ -408,7 +411,6 @@ static struct pl031_vendor_data arm_pl031 = {
408 .set_alarm = pl031_set_alarm, 411 .set_alarm = pl031_set_alarm,
409 .alarm_irq_enable = pl031_alarm_irq_enable, 412 .alarm_irq_enable = pl031_alarm_irq_enable,
410 }, 413 },
411 .irqflags = IRQF_NO_SUSPEND,
412}; 414};
413 415
414/* The First ST derivative */ 416/* The First ST derivative */
@@ -422,7 +424,6 @@ static struct pl031_vendor_data stv1_pl031 = {
422 }, 424 },
423 .clockwatch = true, 425 .clockwatch = true,
424 .st_weekday = true, 426 .st_weekday = true,
425 .irqflags = IRQF_NO_SUSPEND,
426}; 427};
427 428
428/* And the second ST derivative */ 429/* And the second ST derivative */
@@ -439,8 +440,10 @@ static struct pl031_vendor_data stv2_pl031 = {
439 /* 440 /*
440 * This variant shares the IRQ with another block and must not 441 * This variant shares the IRQ with another block and must not
441 * suspend that IRQ line. 442 * suspend that IRQ line.
443 * TODO check if it shares with IRQF_NO_SUSPEND user, else we can
444 * remove IRQF_COND_SUSPEND
442 */ 445 */
443 .irqflags = IRQF_SHARED | IRQF_NO_SUSPEND, 446 .irqflags = IRQF_SHARED | IRQF_COND_SUSPEND,
444}; 447};
445 448
446static struct amba_id pl031_ids[] = { 449static struct amba_id pl031_ids[] = {