diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/power/pda_power.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/power/pda_power.c b/drivers/power/pda_power.c index 0471ec743ab9..d30bb766fcef 100644 --- a/drivers/power/pda_power.c +++ b/drivers/power/pda_power.c | |||
@@ -334,13 +334,16 @@ static int pda_power_remove(struct platform_device *pdev) | |||
334 | } | 334 | } |
335 | 335 | ||
336 | #ifdef CONFIG_PM | 336 | #ifdef CONFIG_PM |
337 | static int ac_wakeup_enabled; | ||
338 | static int usb_wakeup_enabled; | ||
339 | |||
337 | static int pda_power_suspend(struct platform_device *pdev, pm_message_t state) | 340 | static int pda_power_suspend(struct platform_device *pdev, pm_message_t state) |
338 | { | 341 | { |
339 | if (device_may_wakeup(&pdev->dev)) { | 342 | if (device_may_wakeup(&pdev->dev)) { |
340 | if (ac_irq) | 343 | if (ac_irq) |
341 | enable_irq_wake(ac_irq->start); | 344 | ac_wakeup_enabled = !enable_irq_wake(ac_irq->start); |
342 | if (usb_irq) | 345 | if (usb_irq) |
343 | enable_irq_wake(usb_irq->start); | 346 | usb_wakeup_enabled = !enable_irq_wake(usb_irq->start); |
344 | } | 347 | } |
345 | 348 | ||
346 | return 0; | 349 | return 0; |
@@ -349,9 +352,9 @@ static int pda_power_suspend(struct platform_device *pdev, pm_message_t state) | |||
349 | static int pda_power_resume(struct platform_device *pdev) | 352 | static int pda_power_resume(struct platform_device *pdev) |
350 | { | 353 | { |
351 | if (device_may_wakeup(&pdev->dev)) { | 354 | if (device_may_wakeup(&pdev->dev)) { |
352 | if (usb_irq) | 355 | if (usb_irq && usb_wakeup_enabled) |
353 | disable_irq_wake(usb_irq->start); | 356 | disable_irq_wake(usb_irq->start); |
354 | if (ac_irq) | 357 | if (ac_irq && ac_wakeup_enabled) |
355 | disable_irq_wake(ac_irq->start); | 358 | disable_irq_wake(ac_irq->start); |
356 | } | 359 | } |
357 | 360 | ||