From: Li Jun Date: Fri, 16 Oct 2015 05:53:20 +0000 (+0800) Subject: usb: chipidea: otg: don't wait vbus drops below BSV when starts host X-Git-Tag: KARO-TX6UL-2015-11-03~36^2~11^2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=851ce932242d5a79bef8fe625fce37cc2f27033e;p=karo-tx-linux.git usb: chipidea: otg: don't wait vbus drops below BSV when starts host 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 Signed-off-by: Peter Chen --- diff --git a/drivers/usb/chipidea/otg.c b/drivers/usb/chipidea/otg.c index ab4bd0c2d4ef..45f86da1d6d3 100644 --- a/drivers/usb/chipidea/otg.c +++ b/drivers/usb/chipidea/otg.c @@ -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); } }