Commit 5f82279a authored by Felipe Balbi's avatar Felipe Balbi

usb: dwc3: core: fixup dr_mode fallback selection

We shouldn't change a host-only dwc3 to gadget-only
if driver is built as gadget-only. Fix that up here.
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent e6fe66fe
......@@ -975,9 +975,13 @@ static int dwc3_probe(struct platform_device *pdev)
goto err0;
}
if (IS_ENABLED(CONFIG_USB_DWC3_HOST))
if (IS_ENABLED(CONFIG_USB_DWC3_HOST) &&
(dwc->dr_mode == USB_DR_MODE_OTG ||
dwc->dr_mode == USB_DR_MODE_UNKNOWN))
dwc->dr_mode = USB_DR_MODE_HOST;
else if (IS_ENABLED(CONFIG_USB_DWC3_GADGET))
else if (IS_ENABLED(CONFIG_USB_DWC3_GADGET) &&
(dwc->dr_mode == USB_DR_MODE_OTG ||
dwc->dr_mode == USB_DR_MODE_UNKNOWN))
dwc->dr_mode = USB_DR_MODE_PERIPHERAL;
if (dwc->dr_mode == USB_DR_MODE_UNKNOWN)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment