All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mattijs Korpershoek <mkorpershoek@kernel.org>
To: 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 2/3] usb: dwc3-generic: support Qualcomm flattened DT
Date: Thu, 15 Jan 2026 10:21:44 +0100	[thread overview]
Message-ID: <873447fcyf.fsf@kernel.org> (raw)
In-Reply-To: <20260114-casey-usb-role-switch-v1-2-fb7a626466b9@linaro.org>

Hi Casey,

Thank you for the patch.

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

> Qualcomm devicetrees are moving away from having a glue node with dwc3
> as a subnode and now may just have a single flattened node.

In the commit message, could you provide a link to an example dt who has
this single flattened node?

>
> Rockchip already have a glue_get_ctrl_dev op which returns the node for
> the glue device itself, commonise this and reuse it for the new Qualcomm
> node.
>
> Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
> ---
>  drivers/usb/dwc3/dwc3-generic.c | 21 +++++++++++++++------
>  1 file changed, 15 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
> index 02c02b1d80e4..7044696ced0c 100644
> --- a/drivers/usb/dwc3/dwc3-generic.c
> +++ b/drivers/usb/dwc3/dwc3-generic.c
> @@ -6,8 +6,10 @@
>   *
>   * Based on dwc3-omap.c.
>   */
>  
> +#define LOG_DEBUG
> +

Debug leftover? Please drop for v2.

>  #include <dm.h>
>  #include <reset.h>
>  #include <asm/gpio.h>
>  #include <dm/device_compat.h>
> @@ -488,23 +490,29 @@ static void dwc3_qcom_glue_configure(struct udevice *dev, int index,
>  	if (mode != USB_DR_MODE_HOST)
>  		dwc3_qcom_vbus_override_enable(qscratch_base, true);
>  }
>  
> -struct dwc3_glue_ops qcom_ops = {
> -	.glue_configure = dwc3_qcom_glue_configure,
> -};
> -
> -static int dwc3_rk_glue_get_ctrl_dev(struct udevice *dev, ofnode *node)
> +/* In cases where there is no dwc3 node and it's flattened into the glue node */
> +static int dwc3_flat_dt_get_ctrl_dev(struct udevice *dev, ofnode *node)
>  {
>  	*node = dev_ofnode(dev);
>  	if (!ofnode_valid(*node))
>  		return -EINVAL;
>  
>  	return 0;
>  }
>  
> +struct dwc3_glue_ops qcom_ops = {
> +	.glue_configure = dwc3_qcom_glue_configure,
> +};
> +
> +struct dwc3_glue_ops qcom_flat_dt_ops = {
> +	.glue_configure = dwc3_qcom_glue_configure,
> +	.glue_get_ctrl_dev = dwc3_flat_dt_get_ctrl_dev,
> +};
> +
>  struct dwc3_glue_ops rk_ops = {
> -	.glue_get_ctrl_dev = dwc3_rk_glue_get_ctrl_dev,
> +	.glue_get_ctrl_dev = dwc3_flat_dt_get_ctrl_dev,
>  };
>  
>  static int dwc3_glue_bind_common(struct udevice *parent, ofnode node)
>  {
> @@ -711,8 +719,9 @@ static const struct udevice_id dwc3_glue_ids[] = {
>  	{ .compatible = "rockchip,rk3568-dwc3", .data = (ulong)&rk_ops },
>  	{ .compatible = "rockchip,rk3576-dwc3", .data = (ulong)&rk_ops },
>  	{ .compatible = "rockchip,rk3588-dwc3", .data = (ulong)&rk_ops },
>  	{ .compatible = "qcom,dwc3", .data = (ulong)&qcom_ops },
> +	{ .compatible = "qcom,snps-dwc3", .data = (ulong)&qcom_flat_dt_ops },
>  	{ .compatible = "fsl,imx8mp-dwc3", .data = (ulong)&imx8mp_ops },
>  	{ .compatible = "fsl,imx8mq-dwc3" },
>  	{ .compatible = "intel,tangier-dwc3" },
>  	{ .compatible = "samsung,exynos7870-dwusb3" },
>
> -- 
> 2.51.0

  parent reply	other threads:[~2026-01-15  9:21 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
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 [this message]
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=873447fcyf.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.