[PATCH 1/3] usb: common: default dr_mode to OTG when not set

Mattijs Korpershoek mkorpershoek at kernel.org
Thu Jan 15 10:17:43 CET 2026


Hi Casey,

Thank you for the patch.

On Wed, Jan 14, 2026 at 15:13, Casey Connolly <casey.connolly at linaro.org> wrote:

> DT bindings dictate that dr_mode being unset on a DRD capable USB

For the curious, this is defined in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/usb/usb-drd.yaml#n23

> controller means we should default to OTG mode. Adjust usb_get_dr_mode()
> to reflect this.
>
> Signed-off-by: Casey Connolly <casey.connolly at linaro.org>
> ---
>  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 */

Nitpick: can we change the comment to:
/* Default to OTG mode as per devicetree/bindings/usb/usb-drd.yaml */

This tells the same but is more precise and is imho, a more helpful
comment.

Reviewed-by: Mattijs Korpershoek <mkorpershoek at kernel.org>


> +		return USB_DR_MODE_OTG;
>  	}
>  
>  	for (i = 0; i < ARRAY_SIZE(usb_dr_modes); i++)
>  		if (!strcmp(dr_mode, usb_dr_modes[i]))
>
> -- 
> 2.51.0


More information about the U-Boot mailing list