]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb: dwc2: force reset assert before to probe the driver
authorPatrick Delaunay <patrick.delaunay@st.com>
Fri, 29 Mar 2019 14:42:16 +0000 (15:42 +0100)
committerMarek Vasut <marex@denx.de>
Sun, 21 Apr 2019 08:26:52 +0000 (10:26 +0200)
Reset the hardware to be sure of the device state.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
drivers/usb/gadget/dwc2_udc_otg.c

index af16fc1ed4c8b97c7193c226dc8dff97a435fe60..8169fdbb110cad7f511dd4160675e40d5785a10a 100644 (file)
@@ -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;