Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 141819
b: refs/heads/master
c: faa9fa8
h: refs/heads/master
i:
  141817: 6524939
  141815: 86c7af1
v: v3
  • Loading branch information
Magnus Damm authored and Paul Mundt committed Apr 2, 2009
1 parent 4ebe4cf commit e5bbf2c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4ba50df685e85b9d912a290d9614ffbeb4d9f060
refs/heads/master: faa9fa8e448ba4c0a9d61778fd3cda1313bf1533
36 changes: 36 additions & 0 deletions trunk/drivers/rtc/rtc-sh.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,10 +795,46 @@ static int __devexit sh_rtc_remove(struct platform_device *pdev)

return 0;
}

static void sh_rtc_set_irq_wake(struct device *dev, int enabled)
{
struct platform_device *pdev = to_platform_device(dev);
struct sh_rtc *rtc = platform_get_drvdata(pdev);

set_irq_wake(rtc->periodic_irq, enabled);
if (rtc->carry_irq > 0) {
set_irq_wake(rtc->carry_irq, enabled);
set_irq_wake(rtc->alarm_irq, enabled);
}

}

static int sh_rtc_suspend(struct device *dev)
{
if (device_may_wakeup(dev))
sh_rtc_set_irq_wake(dev, 1);

return 0;
}

static int sh_rtc_resume(struct device *dev)
{
if (device_may_wakeup(dev))
sh_rtc_set_irq_wake(dev, 0);

return 0;
}

static struct dev_pm_ops sh_rtc_dev_pm_ops = {
.suspend = sh_rtc_suspend,
.resume = sh_rtc_resume,
};

static struct platform_driver sh_rtc_platform_driver = {
.driver = {
.name = DRV_NAME,
.owner = THIS_MODULE,
.pm = &sh_rtc_dev_pm_ops,
},
.probe = sh_rtc_probe,
.remove = __devexit_p(sh_rtc_remove),
Expand Down

0 comments on commit e5bbf2c

Please sign in to comment.