[U-Boot] [PATCH 08/16] usb: dwc2: force reset assert before to probe the driver

Lukasz Majewski
2019-04-08T21:55:24Z

On Fri, 29 Mar 2019 15:42:16 +0100
Patrick Delaunay <patrick.delaunay@st.com> wrote:

> Reset the hardware to be sure of the device state.
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> ---
>
> drivers/usb/gadget/dwc2_udc_otg.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/dwc2_udc_otg.c
> b/drivers/usb/gadget/dwc2_udc_otg.c index af16fc1..8169fdb 100644
> --- a/drivers/usb/gadget/dwc2_udc_otg.c
> +++ b/drivers/usb/gadget/dwc2_udc_otg.c
> @@ -1049,7 +1049,12 @@ static int dwc2_udc_otg_reset_init(struct
> udevice *dev, if (ret)
> return ret;
>
> - ret = reset_deassert_bulk(resets);
> + ret = reset_assert_bulk(resets);
> +
> + if (!ret) {
> + udelay(2);
> + ret = reset_deassert_bulk(resets);
> + }
> if (ret) {
> reset_release_bulk(resets);
> return ret;

Reviewed-by: Lukasz Majewski <lukma@denx.de>

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190408/01f94779/attachment.sig>