Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 295234
b: refs/heads/master
c: cd0e08a
h: refs/heads/master
v: v3
  • Loading branch information
Deepak Sikri authored and Linus Torvalds committed Mar 23, 2012
1 parent 42c5344 commit faf75eb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0e0cb892a8dac7c76321c899934705e5f0812574
refs/heads/master: cd0e08a8c9fb9c50d182d20e3bc52452c1ce1bfb
17 changes: 11 additions & 6 deletions trunk/drivers/rtc/rtc-spear.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ struct spear_rtc_config {
struct clk *clk;
spinlock_t lock;
void __iomem *ioaddr;
unsigned int irq_wake;
};

static inline void spear_rtc_clear_interrupt(struct spear_rtc_config *config)
Expand Down Expand Up @@ -463,9 +464,10 @@ static int spear_rtc_suspend(struct platform_device *pdev, pm_message_t state)
int irq;

irq = platform_get_irq(pdev, 0);
if (device_may_wakeup(&pdev->dev))
enable_irq_wake(irq);
else {
if (device_may_wakeup(&pdev->dev)) {
if (!enable_irq_wake(irq))
config->irq_wake = 1;
} else {
spear_rtc_disable_interrupt(config);
clk_disable(config->clk);
}
Expand All @@ -481,9 +483,12 @@ static int spear_rtc_resume(struct platform_device *pdev)

irq = platform_get_irq(pdev, 0);

if (device_may_wakeup(&pdev->dev))
disable_irq_wake(irq);
else {
if (device_may_wakeup(&pdev->dev)) {
if (config->irq_wake) {
disable_irq_wake(irq);
config->irq_wake = 0;
}
} else {
clk_enable(config->clk);
spear_rtc_enable_interrupt(config);
}
Expand Down

0 comments on commit faf75eb

Please sign in to comment.