UPSTREAM: usb: dwc2: gadget: Add Incomplete ISO IN/OUT Interrupt handlers
authorVardan Mikayelyan <mvardan@synopsys.com>
Thu, 26 May 2016 01:07:17 +0000 (18:07 -0700)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 3 Jan 2017 10:48:48 +0000 (18:48 +0800)
commit84e6782ac8cb46e2a6edce1bd3bf33e0c8b7f67b
tree653cc020b3ce685b1a50c46f052e75362a5b95b6
parent29a67f7e3e450b509bb15252742d9d2e2bcd9c8e
UPSTREAM: usb: dwc2: gadget: Add Incomplete ISO IN/OUT Interrupt handlers

Incomplete ISO IN interrupt indicates one of the following conditions
occurred while transmitting an ISOC transaction.
- Corrupted IN Token for ISOC EP.
- Packet not complete in FIFO.

Incomplete ISO OUT indicates that there is at least one isochronous OUT
endpoint on which the transfer is not completed in the current
microframe.

The following actions will be taken:

In case of EP-IN
- Determine the EP
- Disable EP directly from this handler; when "Endpoint Disabled"
  interrupt is received flush FIFO

In case of EP-OUT
- Determine the EP
- If target frame elapsed set DCTL_SGOUTNAK, unmask GOUTNAKEFF and
  proceed as described in section 7.5.1 of DWC-HSOTG Programming Guide

Also added dwc2_gadget_target_frame_elapsed() helper function which
will be used in Incomplete ISO IN/OUT Interrupt handlers.

Change-Id: Id9832f7832eafc2c510f0d87bd38e4b820111352
Tested-by: John Keeping <john@metanate.com>
Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 381fc8f8228923026b3d75c8230fa2ee4d688f32)
drivers/usb/dwc2/gadget.c