Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82509
b: refs/heads/master
c: 8f8e9b3
h: refs/heads/master
i:
  82507: 130d059
v: v3
  • Loading branch information
Dmitry Baryshkov authored and Anton Vorontsov committed Feb 1, 2008
1 parent 8dc2303 commit 61dd3db
Show file tree
Hide file tree
Showing 2 changed files with 34 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: c7cc930f9a5c26385a08cd7dc28cb5e3ed186d72
refs/heads/master: 8f8e9b387e07cbb96f10936cc455229d7aff4790
33 changes: 33 additions & 0 deletions trunk/drivers/power/pda_power.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ static int pda_power_probe(struct platform_device *pdev)
}
}

device_init_wakeup(&pdev->dev, 1);

return 0;

usb_irq_failed:
Expand Down Expand Up @@ -239,12 +241,43 @@ static int pda_power_remove(struct platform_device *pdev)
return 0;
}

#ifdef CONFIG_PM
static int pda_power_suspend(struct platform_device *pdev, pm_message_t state)
{
if (device_may_wakeup(&pdev->dev)) {
if (ac_irq)
enable_irq_wake(ac_irq->start);
if (usb_irq)
enable_irq_wake(usb_irq->start);
}

return 0;
}

static int pda_power_resume(struct platform_device *pdev)
{
if (device_may_wakeup(&pdev->dev)) {
if (usb_irq)
disable_irq_wake(usb_irq->start);
if (ac_irq)
disable_irq_wake(ac_irq->start);
}

return 0;
}
#else
#define pda_power_suspend NULL
#define pda_power_resume NULL
#endif /* CONFIG_PM */

static struct platform_driver pda_power_pdrv = {
.driver = {
.name = "pda-power",
},
.probe = pda_power_probe,
.remove = pda_power_remove,
.suspend = pda_power_suspend,
.resume = pda_power_resume,
};

static int __init pda_power_init(void)
Expand Down

0 comments on commit 61dd3db

Please sign in to comment.