aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBin Liu <b-liu@ti.com>2019-12-11 10:10:03 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-02-01 09:37:02 +0000
commit26962313b0adbc65c7354dac5a0a2ebb8a135d0a (patch)
treec05ce259d487301d84eab6d59d0f1d17bd8d990e
parentb271314b3ce1ff4bb780a9831fdb853ea9758317 (diff)
downloadlinux-yocto-26962313b0adbc65c7354dac5a0a2ebb8a135d0a.tar.gz
linux-yocto-26962313b0adbc65c7354dac5a0a2ebb8a135d0a.tar.bz2
linux-yocto-26962313b0adbc65c7354dac5a0a2ebb8a135d0a.zip
usb: dwc3: turn off VBUS when leaving host mode
commit 09ed259fac621634d51cd986aa8d65f035662658 upstream. VBUS should be turned off when leaving the host mode. Set GCTL_PRTCAP to device mode in teardown to de-assert DRVVBUS pin to turn off VBUS power. Fixes: 5f94adfeed97 ("usb: dwc3: core: refactor mode initialization to its own function") Cc: stable@vger.kernel.org Signed-off-by: Bin Liu <b-liu@ti.com> Signed-off-by: Felipe Balbi <balbi@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/dwc3/core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index f52fcbc5c971..6666d2a52bf5 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -1199,6 +1199,9 @@ static void dwc3_core_exit_mode(struct dwc3 *dwc)
/* do nothing */
break;
}
+
+ /* de-assert DRVVBUS for HOST and OTG mode */
+ dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_DEVICE);
}
static void dwc3_get_properties(struct dwc3 *dwc)