musb: sunxi: Force EP0 on re-enable
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Tue, 4 Aug 2015 15:04:10 +0000 (17:04 +0200)
committerMarek Vasut <marex@denx.de>
Wed, 5 Aug 2015 15:20:34 +0000 (17:20 +0200)
Currently, the second use of a gadget will fail, while the first one works.

Forcing the EP0 at every enable fix this issue.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
drivers/usb/musb-new/sunxi.c

index 85ac28d..16a264a 100644 (file)
@@ -200,6 +200,9 @@ static int sunxi_musb_enable(struct musb *musb)
 
        pr_debug("%s():\n", __func__);
 
+       musb_ep_select(musb->mregs, 0);
+       musb_writeb(musb->mregs, MUSB_FADDR, 0);
+
        if (enabled)
                return 0;