diff options
Diffstat (limited to 'drivers/usb/gadget/at91_udc.c')
-rw-r--r-- | drivers/usb/gadget/at91_udc.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index 5a72743606fd..f39050145f1f 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c | |||
@@ -1807,16 +1807,13 @@ static int at91udc_suspend(struct platform_device *pdev, pm_message_t mesg) | |||
1807 | || !wake | 1807 | || !wake |
1808 | || at91_suspend_entering_slow_clock()) { | 1808 | || at91_suspend_entering_slow_clock()) { |
1809 | pullup(udc, 0); | 1809 | pullup(udc, 0); |
1810 | disable_irq_wake(udc->udp_irq); | 1810 | wake = 0; |
1811 | } else | 1811 | } else |
1812 | enable_irq_wake(udc->udp_irq); | 1812 | enable_irq_wake(udc->udp_irq); |
1813 | 1813 | ||
1814 | if (udc->board.vbus_pin > 0) { | 1814 | udc->active_suspend = wake; |
1815 | if (wake) | 1815 | if (udc->board.vbus_pin > 0 && wake) |
1816 | enable_irq_wake(udc->board.vbus_pin); | 1816 | enable_irq_wake(udc->board.vbus_pin); |
1817 | else | ||
1818 | disable_irq_wake(udc->board.vbus_pin); | ||
1819 | } | ||
1820 | return 0; | 1817 | return 0; |
1821 | } | 1818 | } |
1822 | 1819 | ||
@@ -1824,8 +1821,14 @@ static int at91udc_resume(struct platform_device *pdev) | |||
1824 | { | 1821 | { |
1825 | struct at91_udc *udc = platform_get_drvdata(pdev); | 1822 | struct at91_udc *udc = platform_get_drvdata(pdev); |
1826 | 1823 | ||
1824 | if (udc->board.vbus_pin > 0 && udc->active_suspend) | ||
1825 | disable_irq_wake(udc->board.vbus_pin); | ||
1826 | |||
1827 | /* maybe reconnect to host; if so, clocks on */ | 1827 | /* maybe reconnect to host; if so, clocks on */ |
1828 | pullup(udc, 1); | 1828 | if (udc->active_suspend) |
1829 | disable_irq_wake(udc->udp_irq); | ||
1830 | else | ||
1831 | pullup(udc, 1); | ||
1829 | return 0; | 1832 | return 0; |
1830 | } | 1833 | } |
1831 | #else | 1834 | #else |