projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8cc6d55
)
usb: dwc3: core: Use role-switch default dr_mode
author
Thinh Nguyen
<Thinh.Nguyen@synopsys.com>
Mon, 30 Mar 2020 00:10:05 +0000
(17:10 -0700)
committer
Felipe Balbi
<balbi@kernel.org>
Tue, 5 May 2020 08:00:12 +0000
(11:00 +0300)
If the driver is configured to use DRD role-switch, let the drd code
path decide the default dr_mode.
Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
drivers/usb/dwc3/core.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/usb/dwc3/core.c
b/drivers/usb/dwc3/core.c
index 7046c681fece70a4a8952123db35db6ae85b0cd6..ab6323b8e3235655fc306fae25a2af4d36bef12a 100644
(file)
--- a/
drivers/usb/dwc3/core.c
+++ b/
drivers/usb/dwc3/core.c
@@
-85,6
+85,8
@@
static int dwc3_get_dr_mode(struct dwc3 *dwc)
* specified or set to OTG, then set the mode to peripheral.
*/
if (mode == USB_DR_MODE_OTG &&
+ (!IS_ENABLED(CONFIG_USB_ROLE_SWITCH) ||
+ !device_property_read_bool(dwc->dev, "usb-role-switch")) &&
dwc->revision >= DWC3_REVISION_330A)
mode = USB_DR_MODE_PERIPHERAL;
}