usb: dwc3: Fix enabling USB_DR_MODE_HOST

The original logic always enables USB_DR_MODE_HOST operation mode in
dwc3_layerscape_bind() in u-boot. Prevent choosing USB_DR_MODE_HOST
operation mode if USB_HOST is not enabled.

Fixes: 2b0b51d0be ("usb: dwc3: add layerscape support")
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
This commit is contained in:
Oleksandr Suvorov 2023-08-25 13:42:40 +03:00 committed by Marek Vasut
parent da93ea6a9a
commit 7f4b73fe69

View file

@ -193,7 +193,7 @@ static int dwc3_layerscape_bind(struct udevice *dev)
driver = "dwc3-layerscape-peripheral";
break;
#endif
#if defined(CONFIG_SPL_USB_HOST) || !defined(CONFIG_SPL_BUILD)
#if CONFIG_IS_ENABLED(USB_HOST)
case USB_DR_MODE_HOST:
dev_dbg(dev, "Using host mode\n");
driver = "dwc3-layerscape-host";