[PATCH v2 01/11] usb: dwc3: Handle unknown mode as otg

Julien Panis jpanis at baylibre.com
Mon Jul 10 15:54:09 CEST 2023


In case dr_mode attribute is not passed via DT,
USB DRD controllers should default to OTG.

Signed-off-by: Julien Panis <jpanis at baylibre.com>
---
 drivers/usb/dwc3/dwc3-generic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
index 66da5a8d6f8c..857ae806e11d 100644
--- a/drivers/usb/dwc3/dwc3-generic.c
+++ b/drivers/usb/dwc3/dwc3-generic.c
@@ -182,8 +182,8 @@ static int dwc3_generic_of_to_plat(struct udevice *dev)
 		node = dev_ofnode(dev->parent);
 		plat->dr_mode = usb_get_dr_mode(node);
 		if (plat->dr_mode == USB_DR_MODE_UNKNOWN) {
-			pr_err("Invalid usb mode setup\n");
-			return -ENODEV;
+			pr_info("No USB mode specified. Using OTG.\n");
+			plat->dr_mode = USB_DR_MODE_OTG;
 		}
 	}
 

-- 
2.37.3



More information about the U-Boot mailing list