From: Wu Liang feng Date: Wed, 31 Dec 2014 10:13:01 +0000 (+0800) Subject: USB: DWC_OTG: fix otg device clk repeatedly disable X-Git-Tag: firefly_0821_release~4350 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4a1bab8fa980387a172156336bf8d9ef3a16685f;p=firefly-linux-kernel-4.4.55.git USB: DWC_OTG: fix otg device clk repeatedly disable The commit 28e9901cf058f17092b91347c0df0bad62962e5e set otg device phy enter suspend and resume it after system wakeup. But we don't control the clk, and it will cause otg device repeatedly disable clk when resume from suspend. Signed-off-by: Wu Liang feng --- diff --git a/drivers/usb/dwc_otg_310/dwc_otg_driver.c b/drivers/usb/dwc_otg_310/dwc_otg_driver.c index f43627f3b8d8..21b05a8eeb42 100755 --- a/drivers/usb/dwc_otg_310/dwc_otg_driver.c +++ b/drivers/usb/dwc_otg_310/dwc_otg_driver.c @@ -1536,9 +1536,13 @@ static int dwc_otg_pm_suspend(struct device *dev) dwc_otg_device_t *dwc_otg_device; struct dwc_otg_platform_data *pdata_otg; + dwc_otg_device = dev_get_platdata(dev); + dev_dbg(dev, "dwc_otg PM suspend\n"); - dwc_otg_device = dev_get_platdata(dev); + if (dwc_otg_device->core_if->op_state == B_PERIPHERAL) + return 0; + pdata_otg = dwc_otg_device->pldata; pdata_otg->phy_suspend(pdata_otg, USB_PHY_SUSPEND); @@ -1550,9 +1554,13 @@ static int dwc_otg_pm_resume(struct device *dev) dwc_otg_device_t *dwc_otg_device; struct dwc_otg_platform_data *pdata_otg; + dwc_otg_device = dev_get_platdata(dev); + dev_dbg(dev, "dwc_otg PM resume\n"); - dwc_otg_device = dev_get_platdata(dev); + if (dwc_otg_device->core_if->op_state == B_PERIPHERAL) + return 0; + pdata_otg = dwc_otg_device->pldata; pdata_otg->phy_suspend(pdata_otg, USB_PHY_ENABLED);