Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8f8e9b387e07cbb96f10936cc455229d7aff4790
Commit:     8f8e9b387e07cbb96f10936cc455229d7aff4790
Parent:     c7cc930f9a5c26385a08cd7dc28cb5e3ed186d72
Author:     Dmitry Baryshkov <[EMAIL PROTECTED]>
AuthorDate: Sun Jan 13 02:35:43 2008 +0300
Committer:  Anton Vorontsov <[EMAIL PROTECTED]>
CommitDate: Sat Feb 2 02:43:00 2008 +0300

    pda_power: add suspend/resume support
    
    Add suspend/resume/wakeup support for pda_power.
    
    Signed-off-by: Dmitry Baryshkov <[EMAIL PROTECTED]>
    Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
---
 drivers/power/pda_power.c |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/drivers/power/pda_power.c b/drivers/power/pda_power.c
index d98622f..35dc259 100644
--- a/drivers/power/pda_power.c
+++ b/drivers/power/pda_power.c
@@ -207,6 +207,8 @@ static int pda_power_probe(struct platform_device *pdev)
                }
        }
 
+       device_init_wakeup(&pdev->dev, 1);
+
        return 0;
 
 usb_irq_failed:
@@ -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)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to