On 1/14/26 15:13, Casey Connolly wrote:
Respect the default mode configured in DT if it is set and dr_mode is
OTG. This allows the board to prefer host mode even on a DRD capable
controller.

Signed-off-by: Casey Connolly <[email protected]>
---
  drivers/usb/dwc3/dwc3-generic.c | 5 +++++
  1 file changed, 5 insertions(+)

diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
index 7044696ced0c..1aa9fc933282 100644
--- a/drivers/usb/dwc3/dwc3-generic.c
+++ b/drivers/usb/dwc3/dwc3-generic.c
@@ -528,8 +528,13 @@ static int dwc3_glue_bind_common(struct udevice *parent, 
ofnode node)
        dr_mode = usb_get_dr_mode(dev_ofnode(parent));
        if (!dr_mode)
                dr_mode = usb_get_dr_mode(node);
+ /* check default role for DRD controllers */
+       if ((dr_mode == USB_DR_MODE_OTG || dr_mode == USB_DR_MODE_UNKNOWN) &&
+           ofnode_read_bool(node, "usb-role-switch"))
+               dr_mode = usb_get_role_switch_default_mode(node);
+
        /* usb mode must fallback to peripheral if not known */
        if (dr_mode == USB_DR_MODE_UNKNOWN)
                dr_mode = USB_DR_MODE_OTG;

So it means that,on phone platforms, the controller will default to host ?

Neil

Reply via email to