Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 77541
b: refs/heads/master
c: 6bc54e6
h: refs/heads/master
i:
  77539: d336fbb
v: v3
  • Loading branch information
Russell King authored and Russell King committed Jan 26, 2008
1 parent da9458a commit 8d51e43
Show file tree
Hide file tree
Showing 2 changed files with 32 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: 4ae7806f8b4bf9a1e74c82f3bd4e91d59bd3d697
refs/heads/master: 6bc54e69921a64e8f813de658aef645c960a2904
31 changes: 31 additions & 0 deletions trunk/drivers/rtc/rtc-sa1100.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ static int sa1100_rtc_probe(struct platform_device *pdev)
if (IS_ERR(rtc))
return PTR_ERR(rtc);

device_init_wakeup(&pdev->dev, 1);

platform_set_drvdata(pdev, rtc);

return 0;
Expand All @@ -352,9 +354,38 @@ static int sa1100_rtc_remove(struct platform_device *pdev)
return 0;
}

#ifdef CONFIG_PM
static int sa1100_rtc_suspend(struct platform_device *pdev, pm_message_t state)
{
if (pdev->dev.power.power_state.event != state.event) {
if (state.event == PM_EVENT_SUSPEND &&
device_may_wakeup(&pdev->dev))
enable_irq_wake(IRQ_RTCAlrm);

pdev->dev.power.power_state = state;
}
return 0;
}

static int sa1100_rtc_resume(struct platform_device *pdev)
{
if (pdev->dev.power.power_state.event != PM_EVENT_ON) {
if (device_may_wakeup(&pdev->dev))
disable_irq_wake(IRQ_RTCAlrm);
pdev->dev.power.power_state = PMSG_ON;
}
return 0;
}
#else
#define sa1100_rtc_suspend NULL
#define sa1100_rtc_resume NULL
#endif

static struct platform_driver sa1100_rtc_driver = {
.probe = sa1100_rtc_probe,
.remove = sa1100_rtc_remove,
.suspend = sa1100_rtc_suspend,
.resume = sa1100_rtc_resume,
.driver = {
.name = "sa1100-rtc",
},
Expand Down

0 comments on commit 8d51e43

Please sign in to comment.