public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
To: Amelie Delaunay <amelie.delaunay@foss.st.com>,
	Greg Kroah-Hartman <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>,
	Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Subject: Re: [PATCH 1/1] usb: dwc2: fix STM ID/VBUS detection startup delay in dwc2_driver_probe
Date: Tue, 14 Dec 2021 06:23:32 +0000	[thread overview]
Message-ID: <8034e712-1fb1-c8ea-d120-e8381a5f20a3@synopsys.com> (raw)
In-Reply-To: <20211207124510.268841-1-amelie.delaunay@foss.st.com>

On 12/7/2021 4:45 PM, Amelie Delaunay wrote:
> When activate_stm_id_vb_detection is enabled, ID and Vbus detection relies
> on sensing comparators. This detection needs time to stabilize.
> A delay was already applied in dwc2_resume() when reactivating the
> detection, but it wasn't done in dwc2_probe().
> This patch adds delay after enabling STM ID/VBUS detection. Then, ID state
> is good when initializing gadget and host, and avoid to get a wrong
> Connector ID Status Change interrupt.
> 
> Fixes: a415083a11cc ("usb: dwc2: add support for STM32MP15 SoCs USB OTG HS and FS")
> Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>

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

> ---
>   drivers/usb/dwc2/platform.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
> index a1feaa09be57..55d7fca6f95c 100644
> --- a/drivers/usb/dwc2/platform.c
> +++ b/drivers/usb/dwc2/platform.c
> @@ -555,6 +555,9 @@ static int dwc2_driver_probe(struct platform_device *dev)
>   		ggpio |= GGPIO_STM32_OTG_GCCFG_IDEN;
>   		ggpio |= GGPIO_STM32_OTG_GCCFG_VBDEN;
>   		dwc2_writel(hsotg, ggpio, GGPIO);
> +
> +		/* ID/VBUS detection startup time */
> +		usleep_range(5000, 7000);
>   	}
>   
>   	retval = dwc2_drd_init(hsotg);


      reply	other threads:[~2021-12-14  6:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-07 12:45 [PATCH 1/1] usb: dwc2: fix STM ID/VBUS detection startup delay in dwc2_driver_probe Amelie Delaunay
2021-12-14  6:23 ` 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=8034e712-1fb1-c8ea-d120-e8381a5f20a3@synopsys.com \
    --to=minas.harutyunyan@synopsys.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