summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdrivers/usb/gadget/arcotg_udc.c14
-rwxr-xr-xdrivers/usb/otg/fsl_otg.c2
2 files changed, 11 insertions, 5 deletions
diff --git a/drivers/usb/gadget/arcotg_udc.c b/drivers/usb/gadget/arcotg_udc.c
index 83972444455f..f7a0e7609277 100755
--- a/drivers/usb/gadget/arcotg_udc.c
+++ b/drivers/usb/gadget/arcotg_udc.c
@@ -3453,6 +3453,15 @@ static int fsl_udc_resume(struct platform_device *pdev)
goto end;
}
+ /*
+ * To fix suspend issue connected to usb charger,if stopped is 0
+ * suspended is 1,clock on and out of low power mode to avoid
+ * next system suspend no clock to cause system hang.
+ */
+ if (udc_controller->suspended && !udc_controller->stopped) {
+ dr_clk_gate(true);
+ dr_phy_low_power_mode(udc_controller, false);
+ }
/* Enable DR irq reg and set controller Run */
if (udc_controller->stopped) {
/* the clock is already on at usb wakeup routine */
@@ -3491,10 +3500,7 @@ end:
dr_clk_gate(false);
}
- if (!(--udc_controller->suspended) && !udc_controller->stopped) {
- dr_clk_gate(true);
- dr_phy_low_power_mode(udc_controller, false);
- }
+ --udc_controller->suspended;
enable_irq(udc_controller->irq);
mutex_unlock(&udc_resume_mutex);
printk(KERN_DEBUG "USB Gadget resume ends\n");
diff --git a/drivers/usb/otg/fsl_otg.c b/drivers/usb/otg/fsl_otg.c
index 186fdafe4dbc..4205ed9aaec9 100755
--- a/drivers/usb/otg/fsl_otg.c
+++ b/drivers/usb/otg/fsl_otg.c
@@ -747,7 +747,7 @@ static void fsl_otg_event(struct work_struct *work)
fsm->a_conn = 0;
if (fsm->id) { /* switch to gadget */
- if (pdata->dr_discharge_line)
+ if ((og->host_first_call == false) && pdata->dr_discharge_line)
pdata->dr_discharge_line(true);
fsl_otg_start_host(fsm, 0);
if (pdata->wake_up_enable)