From d765e373a1e10744d65b6f02e0f090b98501772e Mon Sep 17 00:00:00 2001 From: lyz Date: Thu, 7 Aug 2014 21:16:14 +0800 Subject: [PATCH] usb: dwc_otg: put usb phy back to normal state when shutdown --- drivers/usb/dwc_otg_310/dwc_otg_driver.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/dwc_otg_310/dwc_otg_driver.c b/drivers/usb/dwc_otg_310/dwc_otg_driver.c index 57034a80f4ee..2befa34ec6af 100755 --- a/drivers/usb/dwc_otg_310/dwc_otg_driver.c +++ b/drivers/usb/dwc_otg_310/dwc_otg_driver.c @@ -1217,12 +1217,18 @@ static int dwc_otg_driver_resume(struct platform_device *_dev) static void dwc_otg_driver_shutdown(struct platform_device *_dev) { struct device *dev = &_dev->dev; + struct dwc_otg_platform_data *pldata = dev->platform_data; dwc_otg_device_t *otg_dev = dev->platform_data; dwc_otg_core_if_t *core_if = otg_dev->core_if; dctl_data_t dctl = {.d32 = 0 }; DWC_PRINTF("%s: disconnect USB %s mode\n", __func__, dwc_otg_is_host_mode(core_if) ? "host" : "device"); + + if( pldata->dwc_otg_uart_mode != NULL) + pldata->dwc_otg_uart_mode( pldata, PHY_USB_MODE); + if(pldata->phy_suspend != NULL) + pldata->phy_suspend(pldata, USB_PHY_ENABLED); if (dwc_otg_is_host_mode(core_if)) { if (core_if->hcd_cb && core_if->hcd_cb->stop) core_if->hcd_cb->stop(core_if->hcd_cb_p); -- 2.34.1