usb: dwc_otg: fix bug in FORCE_HOST_MODE
authorlyz <lyz@rock-chips.com>
Mon, 23 Mar 2015 08:57:46 +0000 (16:57 +0800)
committerlyz <lyz@rock-chips.com>
Mon, 23 Mar 2015 09:42:28 +0000 (17:42 +0800)
drivers/usb/dwc_otg_310/dwc_otg_driver.c

index 58abce5e7a3f4e162649723517013d2abe172796..3aa41733671f000a950ee3df0b60bd9889c3ad51 100755 (executable)
@@ -1520,7 +1520,8 @@ static int otg20_driver_probe(struct platform_device *_dev)
         * perform initial actions required for Internal ADP logic.
         */
        if (!dwc_otg_get_param_adp_enable(dwc_otg_device->core_if)) {
-               if (pldata->phy_status == USB_PHY_ENABLED) {
+               if (dwc_otg_device->core_if->usb_mode == USB_MODE_NORMAL &&
+                   pldata->phy_status == USB_PHY_ENABLED) {
                        pldata->phy_suspend(pldata, USB_PHY_SUSPEND);
                        udelay(3);
                        pldata->clock_enable(pldata, 0);