usb: dwc3: gadget: disable U1/U2 on disconnect
authorFelipe Balbi <balbi@ti.com>
Thu, 24 May 2012 07:30:01 +0000 (10:30 +0300)
committerFelipe Balbi <balbi@ti.com>
Sun, 3 Jun 2012 20:08:25 +0000 (23:08 +0300)
If we get a disconnect IRQ, we should take
the core out of low power mode so we can
reconnect afterwards.

Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc3/gadget.c

index 867c476853ecaa06360298fcb07aaaaf31bef1b2..054ee5ec5c130b824b895628db0136d9c6f1c876 100644 (file)
@@ -1906,11 +1906,9 @@ static void dwc3_clear_stall_all_ep(struct dwc3 *dwc)
 
 static void dwc3_gadget_disconnect_interrupt(struct dwc3 *dwc)
 {
+       int                     reg;
+
        dev_vdbg(dwc->dev, "%s\n", __func__);
-#if 0
-       XXX
-       U1/U2 is powersave optimization. Skip it for now. Anyway we need to
-       enable it before we can disable it.
 
        reg = dwc3_readl(dwc->regs, DWC3_DCTL);
        reg &= ~DWC3_DCTL_INITU1ENA;
@@ -1918,7 +1916,6 @@ static void dwc3_gadget_disconnect_interrupt(struct dwc3 *dwc)
 
        reg &= ~DWC3_DCTL_INITU2ENA;
        dwc3_writel(dwc->regs, DWC3_DCTL, reg);
-#endif
 
        dwc3_stop_active_transfers(dwc);
        dwc3_disconnect_gadget(dwc);