diff options
author | Deepak Sikri <deepak.sikri@st.com> | 2012-03-23 18:02:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-23 19:58:38 -0400 |
commit | cd0e08a8c9fb9c50d182d20e3bc52452c1ce1bfb (patch) | |
tree | a05e21431c9f8812b3503dc6fe9c966743b0a4c4 /drivers/rtc/rtc-spear.c | |
parent | 0e0cb892a8dac7c76321c899934705e5f0812574 (diff) |
rtc-spear: fix for balancing the enable_irq_wake in Power Mgmt
Handle the fix for unbalanced irq for the cases when enable_irq_wake
fails, and a warning related to same is displayed on the console. The
workaround is handled at the driver level.
Signed-off-by: Deepak Sikri <deepak.sikri@st.com>
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Acked-by: Rajeev Kumar <rajeev-dlh.kumar@st.com>
Cc: Shiraz Hashim <shiraz.hashim@st.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-spear.c')
-rw-r--r-- | drivers/rtc/rtc-spear.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/rtc/rtc-spear.c b/drivers/rtc/rtc-spear.c index 19a28a671a8e..4f068e9ec0f8 100644 --- a/drivers/rtc/rtc-spear.c +++ b/drivers/rtc/rtc-spear.c | |||
@@ -80,6 +80,7 @@ struct spear_rtc_config { | |||
80 | struct clk *clk; | 80 | struct clk *clk; |
81 | spinlock_t lock; | 81 | spinlock_t lock; |
82 | void __iomem *ioaddr; | 82 | void __iomem *ioaddr; |
83 | unsigned int irq_wake; | ||
83 | }; | 84 | }; |
84 | 85 | ||
85 | static inline void spear_rtc_clear_interrupt(struct spear_rtc_config *config) | 86 | static inline void spear_rtc_clear_interrupt(struct spear_rtc_config *config) |
@@ -463,9 +464,10 @@ static int spear_rtc_suspend(struct platform_device *pdev, pm_message_t state) | |||
463 | int irq; | 464 | int irq; |
464 | 465 | ||
465 | irq = platform_get_irq(pdev, 0); | 466 | irq = platform_get_irq(pdev, 0); |
466 | if (device_may_wakeup(&pdev->dev)) | 467 | if (device_may_wakeup(&pdev->dev)) { |
467 | enable_irq_wake(irq); | 468 | if (!enable_irq_wake(irq)) |
468 | else { | 469 | config->irq_wake = 1; |
470 | } else { | ||
469 | spear_rtc_disable_interrupt(config); | 471 | spear_rtc_disable_interrupt(config); |
470 | clk_disable(config->clk); | 472 | clk_disable(config->clk); |
471 | } | 473 | } |
@@ -481,9 +483,12 @@ static int spear_rtc_resume(struct platform_device *pdev) | |||
481 | 483 | ||
482 | irq = platform_get_irq(pdev, 0); | 484 | irq = platform_get_irq(pdev, 0); |
483 | 485 | ||
484 | if (device_may_wakeup(&pdev->dev)) | 486 | if (device_may_wakeup(&pdev->dev)) { |
485 | disable_irq_wake(irq); | 487 | if (config->irq_wake) { |
486 | else { | 488 | disable_irq_wake(irq); |
489 | config->irq_wake = 0; | ||
490 | } | ||
491 | } else { | ||
487 | clk_enable(config->clk); | 492 | clk_enable(config->clk); |
488 | spear_rtc_enable_interrupt(config); | 493 | spear_rtc_enable_interrupt(config); |
489 | } | 494 | } |