mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
usb: dwc3: Set default mode for dwc_usb31
dwc_usb31 does 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. Signed-off-by: Thinh Nguyen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
This commit is contained in:
parent
39facfa01c
commit
a770046811
1 changed files with 8 additions and 0 deletions
|
|
@ -78,6 +78,14 @@ 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 does 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 && dwc3_is_usb31(dwc))
|
||||
mode = USB_DR_MODE_PERIPHERAL;
|
||||
}
|
||||
|
||||
if (mode != dwc->dr_mode) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue