[PATCH v3 01/12] usb: dwc3: Handle unknown mode as otg

Julien Panis jpanis at baylibre.com
Thu Jul 13 15:45:34 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>
Acked-by: Roger Quadros <rogerq at kernel.org>
---
 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