From 669a7f8d4f3e191ccf28a7ac12a403700f7809d6 Mon Sep 17 00:00:00 2001 From: Jack Pham Date: Wed, 9 Oct 2019 09:06:42 -0700 Subject: [PATCH] usb: dwc3: Allow dwc_usb31 to operate in dual-role According to the comment in dwc3_get_dr_mode() controller revisions > 3.30a, including dwc_usb31, do not support OTG. However, dual-role switching can still be supported with the use of an extcon or usb_role_switch driver, so there is no need to restrict the operation to host-only or peripheral-only. Change-Id: I7dea9ff15f5ac15f673c4569ffe401981de04f22 Signed-off-by: Jack Pham --- drivers/usb/dwc3/core.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 1820b742c3f4..80d97c71e5c2 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -84,15 +84,6 @@ static int dwc3_get_dr_mode(struct dwc3 *dwc) mode = USB_DR_MODE_HOST; else if (IS_ENABLED(CONFIG_USB_DWC3_GADGET)) mode = USB_DR_MODE_PERIPHERAL; - - /* - * DWC_usb31 and DWC_usb3 v3.30a and higher do not support OTG - * mode. If the controller supports DRD but the dr_mode is not - * specified or set to OTG, then set the mode to peripheral. - */ - if (mode == USB_DR_MODE_OTG && - dwc->revision >= DWC3_REVISION_330A) - mode = USB_DR_MODE_PERIPHERAL; } if (mode != dwc->dr_mode) {