mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
To: Fabrice Gasnier <fabrice.gasnier@foss.st.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-stm32@st-md-mailman.stormreply.com" 
	<linux-stm32@st-md-mailman.stormreply.com>,
	"amelie.delaunay@foss.st.com" <amelie.delaunay@foss.st.com>,
	"alexandre.torgue@foss.st.com" <alexandre.torgue@foss.st.com>
Subject: Re: [PATCH] usb: dwc2: gadget: remove D+ pull-up while no vbus with usb-role-switch
Date: Fri, 24 Jun 2022 06:01:35 +0000	[thread overview]
Message-ID: <48d301b6-d401-de3d-7636-c73c79a584a1@synopsys.com> (raw)
In-Reply-To: <20220622160717.314580-1-fabrice.gasnier@foss.st.com>

On 6/22/2022 8:07 PM, Fabrice Gasnier wrote:
> From: Amelie Delaunay <amelie.delaunay@foss.st.com>
> 
> When using usb-role-switch, D+ pull-up is set as soon as DTCL_SFTDISCON is
> cleared, whatever the vbus valid signal state is. The pull-up should not
> be set when vbus isn't present (this is determined by the drd controller).
> 
> This patch ensures that B-Session (so Peripheral role + vbus valid signal)
> is valid before clearing the DCTL_SFTDISCON bit when role switch is used.
> Keep original behavior when usb-role-switch isn't used.
> 
> Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>

Acked-by: Minas Harutyunyan <hminas@synopsys.com>

> ---
>   drivers/usb/dwc2/gadget.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
> index fe2a58c758610..8b15742d9e8aa 100644
> --- a/drivers/usb/dwc2/gadget.c
> +++ b/drivers/usb/dwc2/gadget.c
> @@ -3594,7 +3594,8 @@ void dwc2_hsotg_core_disconnect(struct dwc2_hsotg *hsotg)
>   void dwc2_hsotg_core_connect(struct dwc2_hsotg *hsotg)
>   {
>   	/* remove the soft-disconnect and let's go */
> -	dwc2_clear_bit(hsotg, DCTL, DCTL_SFTDISCON);
> +	if (!hsotg->role_sw || (dwc2_readl(hsotg, GOTGCTL) & GOTGCTL_BSESVLD))
> +		dwc2_clear_bit(hsotg, DCTL, DCTL_SFTDISCON);
>   }
>   
>   /**


      reply	other threads:[~2022-06-24  6:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-22 16:07 Fabrice Gasnier
2022-06-24  6:01 ` Minas Harutyunyan [this message]

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=48d301b6-d401-de3d-7636-c73c79a584a1@synopsys.com \
    --to=minas.harutyunyan@synopsys.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=amelie.delaunay@foss.st.com \
    --cc=fabrice.gasnier@foss.st.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux-usb@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®