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

Neil Armstrong neil.armstrong at linaro.org
Wed Jan 14 15:35:33 CET 2026


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 <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 */
> +		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 <neil.armstrong at linaro.org>

Thanks,
Neil


More information about the U-Boot mailing list