usb: dwc_otg: enable clk and exit suspend when usb_core_reset
authorlyz <lyz@rock-chips.com>
Tue, 17 Mar 2015 10:10:24 +0000 (18:10 +0800)
committerlyz <lyz@rock-chips.com>
Tue, 17 Mar 2015 10:43:17 +0000 (18:43 +0800)
Avoid this warning message "WARN::dwc_otg_core_reset:5543:
dwc_otg_core_reset() HANG! AHB Idle GRSTCTL=4000020"

drivers/usb/dwc_otg_310/dwc_otg_pcd_linux.c

index d234c06bb53f6fe10fe5f6727881c90636b651eb..cc3afa20b6fea14161e54bbe559c535a8bbd32ec 100755 (executable)
@@ -1584,11 +1584,13 @@ static void check_id(struct work_struct *work)
 
        if (last_id != id) {
                pr_info("[otg id chg] last id %d current id %d\n", last_id, id);
+
+               if (pldata->phy_status == USB_PHY_SUSPEND) {
+                       pldata->clock_enable(pldata, 1);
+                       pldata->phy_suspend(pldata, USB_PHY_ENABLED);
+               }
+
                if (!id) { /* Force Host */
-                       if (pldata->phy_status == USB_PHY_SUSPEND) {
-                               pldata->clock_enable(pldata, 1);
-                               pldata->phy_suspend(pldata, USB_PHY_ENABLED);
-       }
                        id_status_change(otg_dev->core_if, id);
                } else { /* Force Device */
                        id_status_change(otg_dev->core_if, id);