summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/dwc2/gadget.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 5872db97699f..fcd2bb55ccca 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -3642,11 +3642,13 @@ static int s3c_hsotg_suspend(struct platform_device *pdev, pm_message_t state)
hsotg->driver->driver.name);
spin_lock_irqsave(&hsotg->lock, flags);
+ s3c_hsotg_core_disconnect(hsotg);
s3c_hsotg_disconnect(hsotg);
- s3c_hsotg_phy_disable(hsotg);
hsotg->gadget.speed = USB_SPEED_UNKNOWN;
spin_unlock_irqrestore(&hsotg->lock, flags);
+ s3c_hsotg_phy_disable(hsotg);
+
if (hsotg->driver) {
int ep;
for (ep = 0; ep < hsotg->num_of_eps; ep++)
@@ -3675,8 +3677,9 @@ static int s3c_hsotg_resume(struct platform_device *pdev)
hsotg->supplies);
}
- spin_lock_irqsave(&hsotg->lock, flags);
s3c_hsotg_phy_enable(hsotg);
+
+ spin_lock_irqsave(&hsotg->lock, flags);
s3c_hsotg_core_init_disconnected(hsotg);
s3c_hsotg_core_connect(hsotg);
spin_unlock_irqrestore(&hsotg->lock, flags);