]> git.karo-electronics.de Git - linux-beck.git/commitdiff
usb: chipidea: otg: don't wait vbus drops below BSV when starts host
authorLi Jun <jun.li@freescale.com>
Fri, 16 Oct 2015 05:53:20 +0000 (13:53 +0800)
committerPeter Chen <peter.chen@freescale.com>
Thu, 22 Oct 2015 01:36:23 +0000 (09:36 +0800)
Some HW design may use ID pin state to control vbus for otg port,
so before host role start, the vbus is already turned on, in this
case, we do not need wait vbus dropping below BSV.

Signed-off-by: Li Jun <jun.li@freescale.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
drivers/usb/chipidea/otg.c

index ab4bd0c2d4ef546455f533d79e3646cb7f4bdb33..45f86da1d6d37b4650ddfaf216879195ca9c6542 100644 (file)
@@ -114,9 +114,12 @@ static void ci_handle_id_switch(struct ci_hdrc *ci)
                        ci_role(ci)->name, ci->roles[role]->name);
 
                ci_role_stop(ci);
-               /* wait vbus lower than OTGSC_BSV */
-               hw_wait_reg(ci, OP_OTGSC, OTGSC_BSV, 0,
-                               CI_VBUS_STABLE_TIMEOUT_MS);
+
+               if (role == CI_ROLE_GADGET)
+                       /* wait vbus lower than OTGSC_BSV */
+                       hw_wait_reg(ci, OP_OTGSC, OTGSC_BSV, 0,
+                                       CI_VBUS_STABLE_TIMEOUT_MS);
+
                ci_role_start(ci, role);
        }
 }