usb: dwc3: gadget: conditionally disable Link State change events
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Fri, 23 Sep 2016 08:20:40 +0000 (11:20 +0300)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 31 Oct 2016 09:15:35 +0000 (11:15 +0200)
Link State Change events are only needed for
debugging and to apply certain workarounds on known
errata. Let's save a few cycles by disabling these
events completely on working revisions of the core.

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

index 99ad3ca498aa7b4f40de44192e6fa7b990123981..ee949420ee26a47e3c36bf74a9adfe4d140df910 100644 (file)
@@ -1537,11 +1537,13 @@ static void dwc3_gadget_enable_irq(struct dwc3 *dwc)
                        DWC3_DEVTEN_CMDCMPLTEN |
                        DWC3_DEVTEN_ERRTICERREN |
                        DWC3_DEVTEN_WKUPEVTEN |
-                       DWC3_DEVTEN_ULSTCNGEN |
                        DWC3_DEVTEN_CONNECTDONEEN |
                        DWC3_DEVTEN_USBRSTEN |
                        DWC3_DEVTEN_DISCONNEVTEN);
 
+       if (dwc->revision < DWC3_REVISION_250A)
+               reg |= DWC3_DEVTEN_ULSTCNGEN;
+
        dwc3_writel(dwc->regs, DWC3_DEVTEN, reg);
 }