diff mbox series

usb: dwc3: xilinx: Prevent spike in reset signal

Message ID 20250314155706.31058-1-mike.looijmans@topic.nl (mailing list archive)
State New
Headers show
Series usb: dwc3: xilinx: Prevent spike in reset signal | expand

Commit Message

Mike Looijmans March 14, 2025, 3:56 p.m. UTC
Set the gpio to "high" on acquisition, instead of acquiring it in low
state and then immediately setting it high again. This prevents a
short "spike" on the reset signal.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
---

 drivers/usb/dwc3/dwc3-xilinx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Thinh Nguyen March 14, 2025, 9:14 p.m. UTC | #1
On Fri, Mar 14, 2025, Mike Looijmans wrote:
> Set the gpio to "high" on acquisition, instead of acquiring it in low
> state and then immediately setting it high again. This prevents a
> short "spike" on the reset signal.

How does this affect the current programming flow beside preventing a
spike to the reset signal?

> 
> Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
> ---
> 
>  drivers/usb/dwc3/dwc3-xilinx.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c
> index a33a42ba0249..a159a511483b 100644
> --- a/drivers/usb/dwc3/dwc3-xilinx.c
> +++ b/drivers/usb/dwc3/dwc3-xilinx.c
> @@ -207,7 +207,7 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
>  
>  skip_usb3_phy:
>  	/* ulpi reset via gpio-modepin or gpio-framework driver */
> -	reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
> +	reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
>  	if (IS_ERR(reset_gpio)) {
>  		return dev_err_probe(dev, PTR_ERR(reset_gpio),
>  				     "Failed to request reset GPIO\n");
> @@ -215,7 +215,6 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
>  
>  	if (reset_gpio) {
>  		/* Toggle ulpi to reset the phy. */

Does the comment above still apply?

> -		gpiod_set_value_cansleep(reset_gpio, 1);
>  		usleep_range(5000, 10000);

Do we still need this usleep_range here?

BR,
Thinh

>  		gpiod_set_value_cansleep(reset_gpio, 0);
>  		usleep_range(5000, 10000);
> -- 
> 2.43.0
> 
> 
> Met vriendelijke groet / kind regards,
> 
> Mike Looijmans
> System Expert
> 
> 
> TOPIC Embedded Products B.V.
> Materiaalweg 4, 5681 RJ Best
> The Netherlands
> 
> T: +31 (0) 499 33 69 69
> E: mike.looijmans@topic.nl
> W: https://urldefense.com/v3/__http://www.topic.nl__;!!A4F2R9G_pg!dt2SxHPWske2gY2PNQ9GrJEr5lXXkUCMb5CMBd2ymPEYpU1TEemM__y9_6QwiMTyCIX9wXKKAOzhX5Ex5x5FWa1QV5I98u0$ 
> 
> Please consider the environment before printing this e-mail
diff mbox series

Patch

diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c
index a33a42ba0249..a159a511483b 100644
--- a/drivers/usb/dwc3/dwc3-xilinx.c
+++ b/drivers/usb/dwc3/dwc3-xilinx.c
@@ -207,7 +207,7 @@  static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
 
 skip_usb3_phy:
 	/* ulpi reset via gpio-modepin or gpio-framework driver */
-	reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
+	reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
 	if (IS_ERR(reset_gpio)) {
 		return dev_err_probe(dev, PTR_ERR(reset_gpio),
 				     "Failed to request reset GPIO\n");
@@ -215,7 +215,6 @@  static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
 
 	if (reset_gpio) {
 		/* Toggle ulpi to reset the phy. */
-		gpiod_set_value_cansleep(reset_gpio, 1);
 		usleep_range(5000, 10000);
 		gpiod_set_value_cansleep(reset_gpio, 0);
 		usleep_range(5000, 10000);