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)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 21 Jun 2016 07:50:00 +0000 (10:50 +0300)
commit381fc8f8228923026b3d75c8230fa2ee4d688f32
tree539aa6bfd43d28496359f7c199ec85a8a22c1841
parent5321922cb6fa0f513fdd8ce73b281f4b9957886b
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.

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>
drivers/usb/dwc2/gadget.c