On 1/14/26 15:13, Casey Connolly wrote:
DT bindings dictate that dr_mode being unset on a DRD capable USB
controller means we should default to OTG mode. Adjust usb_get_dr_mode()
to reflect this.
Signed-off-by: Casey Connolly <[email protected]>
---
drivers/usb/common/common.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/common/common.c b/drivers/usb/common/common.c
index 13e9a61072a9..e3bd7339e68e 100644
--- a/drivers/usb/common/common.c
+++ b/drivers/usb/common/common.c
@@ -29,9 +29,10 @@ enum usb_dr_mode usb_get_dr_mode(ofnode node)
dr_mode = ofnode_read_string(node, "dr_mode");
if (!dr_mode) {
pr_debug("usb dr_mode not found\n");
- return USB_DR_MODE_UNKNOWN;
+ /* Default to OTG mode as per DT bindings */
+ return USB_DR_MODE_OTG;
}
for (i = 0; i < ARRAY_SIZE(usb_dr_modes); i++)
if (!strcmp(dr_mode, usb_dr_modes[i]))
Reviewed-by: Neil Armstrong <[email protected]>
Thanks,
Neil