From: Richard Leitner - SKIDATA <Richard.Leitner@skidata.com>
To: Daniels Umanovskis <du@axentia.se>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"robh+dt@kernel.org" <robh+dt@kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Greg KH <gregkh@linuxfoundation.org>
Subject: Re: [PATCH 2/2] usb: usb251xb: make power-up reset delay configurable in device tree
Date: Wed, 27 Apr 2022 07:38:51 +0000 [thread overview]
Message-ID: <YmjzCyRM3xIWpOXx@ltleri2> (raw)
In-Reply-To: <20220426123329.775-3-du@axentia.se>
On Tue, Apr 26, 2022 at 12:34:13PM +0000, Daniels Umanovskis wrote:
> According to the datasheet, the hub should be operational 500us after
> the reset has been deasserted. Some individual circuits have been
> observed not to reset within the specified 500us and require a longer
> wait for subsequent configuration to succeed.
>
> Signed-off-by: Daniels Umanovskis <du@axentia.se>
LGTM.
Reviewed-by: Richard Leitner <richard.leitner@skidata.com>
> ---
> drivers/usb/misc/usb251xb.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c
> index 04c4e3fed094..e287e241ef96 100644
> --- a/drivers/usb/misc/usb251xb.c
> +++ b/drivers/usb/misc/usb251xb.c
> @@ -115,6 +115,7 @@ struct usb251xb {
> struct regulator *vdd;
> u8 skip_config;
> struct gpio_desc *gpio_reset;
> + u32 reset_delay_us;
> u16 vendor_id;
> u16 product_id;
> u16 device_id;
> @@ -278,7 +279,7 @@ static void usb251xb_reset(struct usb251xb *hub)
> gpiod_set_value_cansleep(hub->gpio_reset, 0);
>
> /* wait for hub recovery/stabilization */
> - usleep_range(500, 750); /* >=500us after RESET_N deasserted */
> + fsleep(hub->reset_delay_us);
>
> i2c_unlock_bus(hub->i2c->adapter, I2C_LOCK_SEGMENT);
> }
> @@ -424,6 +425,9 @@ static int usb251xb_get_ofdata(struct usb251xb *hub,
> return err;
> }
>
> + if (of_property_read_u32(np, "reset-delay-us", &hub->reset_delay_us))
> + hub->reset_delay_us = 500;
> +
> if (of_property_read_u16_array(np, "vendor-id", &hub->vendor_id, 1))
> hub->vendor_id = USB251XB_DEF_VENDOR_ID;
>
> --
> 2.30.2
>
prev parent reply other threads:[~2022-04-27 7:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-26 12:33 [PATCH 0/2] usb: usb251xb: configurable reset delay Daniels Umanovskis
2022-04-26 12:33 ` [PATCH 1/2] dt-bindings: usb: usb251xb: add documentation for reset-delay-us Daniels Umanovskis
2022-04-27 7:37 ` Richard Leitner - SKIDATA
2022-05-03 0:20 ` Rob Herring
2022-05-03 7:49 ` Daniels Umanovskis
2022-05-03 9:21 ` Richard Leitner - SKIDATA
2022-05-03 9:41 ` Daniels Umanovskis
2022-05-04 14:09 ` Rob Herring
2022-04-26 12:34 ` [PATCH 2/2] usb: usb251xb: make power-up reset delay configurable in device tree Daniels Umanovskis
2022-04-26 12:46 ` Greg KH
2022-04-26 13:06 ` Daniels Umanovskis
2022-04-26 13:56 ` Greg KH
2022-04-27 7:38 ` Richard Leitner - SKIDATA [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=YmjzCyRM3xIWpOXx@ltleri2 \
--to=richard.leitner@skidata.com \
--cc=devicetree@vger.kernel.org \
--cc=du@axentia.se \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
--cc=robh+dt@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;
as well as URLs for NNTP newsgroup(s).