All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mattijs Korpershoek <mkorpershoek@kernel.org>
To: Mattijs Korpershoek <mkorpershoek@kernel.org>,
	Casey Connolly <casey.connolly@linaro.org>,
	u-boot@lists.denx.de
Cc: Marek Vasut <marex@denx.de>, Tom Rini <trini@konsulko.com>,
	Mattijs Korpershoek <mkorpershoek@kernel.org>,
	Casey Connolly <casey.connolly@linaro.org>,
	Kaustabh Chakraborty <kauschluss@disroot.org>,
	Jonas Karlman <jonas@kwiboo.se>,
	Sam Protsenko <semen.protsenko@linaro.org>,
	Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>,
	Patrice Chotard <patrice.chotard@foss.st.com>
Subject: Re: [PATCH 1/3] usb: common: default dr_mode to OTG when not set
Date: Fri, 16 Jan 2026 13:30:28 +0100	[thread overview]
Message-ID: <877btheo4b.fsf@kernel.org> (raw)
In-Reply-To: <875x93fd54.fsf@kernel.org>

On Thu, Jan 15, 2026 at 10:17, Mattijs Korpershoek <mkorpershoek@kernel.org> wrote:

> Hi Casey,
>
> Thank you for the patch.
>
> On Wed, Jan 14, 2026 at 15:13, Casey Connolly <casey.connolly@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@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@kernel.org>

Also, I just noticed, but there is another similar change here:
https://lore.kernel.org/all/20260108-usb-dwc3-exynos7870-v3-1-343fa1e81e48@disroot.org/

Casey, can you see if the above is useful to you?

>
>
>> +		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

  reply	other threads:[~2026-01-16 12:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-14 14:13 [PATCH 0/3] usb: dwc3-generic: improve DT parsing and support qcom flat DT Casey Connolly
2026-01-14 14:13 ` [PATCH 1/3] usb: common: default dr_mode to OTG when not set Casey Connolly
2026-01-14 14:35   ` Neil Armstrong
2026-01-15  9:17   ` Mattijs Korpershoek
2026-01-16 12:30     ` Mattijs Korpershoek [this message]
2026-01-16 17:05       ` Casey Connolly
2026-01-14 14:13 ` [PATCH 2/3] usb: dwc3-generic: support Qualcomm flattened DT Casey Connolly
2026-01-14 14:36   ` Neil Armstrong
2026-01-15  9:21   ` Mattijs Korpershoek
2026-01-16 17:54     ` Casey Connolly
2026-01-19 12:23       ` Mattijs Korpershoek
2026-01-14 14:13 ` [PATCH 3/3] usb: dwc3-generic: respect role-switch-default-mode Casey Connolly
2026-01-14 14:39   ` Neil Armstrong
2026-01-14 14:42     ` Casey Connolly
2026-01-15  9:27   ` Mattijs Korpershoek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877btheo4b.fsf@kernel.org \
    --to=mkorpershoek@kernel.org \
    --cc=balaji.selvanathan@oss.qualcomm.com \
    --cc=casey.connolly@linaro.org \
    --cc=jonas@kwiboo.se \
    --cc=kauschluss@disroot.org \
    --cc=marex@denx.de \
    --cc=patrice.chotard@foss.st.com \
    --cc=semen.protsenko@linaro.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.