From: Mattijs Korpershoek <mkorpershoek@kernel.org>
To: Jonas Karlman <jonas@kwiboo.se>, Marek Vasut <marex@denx.de>,
Lukasz Majewski <lukma@denx.de>, Tom Rini <trini@konsulko.com>
Cc: Jonas Karlman <jonas@kwiboo.se>, u-boot@lists.denx.de
Subject: Re: [PATCH v2] usb: gadget: dwc2: Move dr_mode check from of_to_plat() to bind()
Date: Thu, 29 Jan 2026 21:13:42 +0100 [thread overview]
Message-ID: <87fr7omb2h.fsf@kernel.org> (raw)
In-Reply-To: <20260129195207.2260264-1-jonas@kwiboo.se>
Hi Jonas,
Thank you for the patch.
On Thu, Jan 29, 2026 at 19:52, Jonas Karlman <jonas@kwiboo.se> wrote:
> Rockchip RK3288 and RK3506 contain two DWC2 USB controllers, typically
> one controller use dr_mode=otg and the other one use dr_mode=host.
>
> With USB_GADGET_DWC2_OTG, DM_USB_GADGET and USB_DWC2 enabled this result
> in the dwc2-udc-otg driver binding to both controllers, however only one
> will probe due to use of dr_mode=host on the other one.
>
> After the commit 6668b8e7cc68 ("dm: core: Support multiple drivers with
> same compatibles") it is possible to bind one controller to the
> dwc2-udc-otg driver and the other one to the dwc2_usb driver.
>
> Move the dr_mode check from of_to_plat() to bind() to allow dm core to
> bind the dwc2 host driver to dr_mode=host controllers.
>
> Before this:
>
> => dm tree
> ...
> usb_gadget 0 [ ] dwc2-udc-otg | |-- usb@ff740000
> usb_gadget 1 [ ] dwc2-udc-otg | |-- usb@ff780000
>
> => usb start
> starting USB...
> No USB controllers found
>
> After this:
>
> dwc2-udc-otg usb@ff780000: Invalid dr_mode 1
>
> => dm tree
> ...
> usb_gadget 0 [ ] dwc2-udc-otg | |-- usb@ff740000
> usb 0 [ ] dwc2_usb | |-- usb@ff780000
>
> => usb start
> starting USB...
> USB DWC2
> Bus usb@ff780000: 1 USB Device(s) found
>
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Marek, can I pick this up since it's gadget or do you want to take it?
> ---
> v2: Update dev_dbg message to include current dr_mode
> ---
> drivers/usb/gadget/dwc2_udc_otg.c | 19 +++++++++++++------
> 1 file changed, 13 insertions(+), 6 deletions(-)
>
next prev parent reply other threads:[~2026-01-29 20:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-29 19:52 [PATCH v2] usb: gadget: dwc2: Move dr_mode check from of_to_plat() to bind() Jonas Karlman
2026-01-29 20:13 ` Mattijs Korpershoek [this message]
2026-01-29 20:32 ` Marek Vasut
2026-01-30 8:02 ` 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=87fr7omb2h.fsf@kernel.org \
--to=mkorpershoek@kernel.org \
--cc=jonas@kwiboo.se \
--cc=lukma@denx.de \
--cc=marex@denx.de \
--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.