usb: dwc3: gadget: Enable XferComplete event
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Wed, 6 May 2020 02:46:45 +0000 (19:46 -0700)
committerFelipe Balbi <balbi@kernel.org>
Mon, 25 May 2020 08:09:41 +0000 (11:09 +0300)
To switch from one stream to another, this requires the driver to start
a new transfer with a specific stream ID. For a transfer to complete,
the driver needs to indicate the last TRB of a transfer, and it needs to
enable XferComplete event to handle completed TRBs of a transfer. Let's
enable this event only for stream capable endpoints.

Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
drivers/usb/dwc3/gadget.c

index 5f98b424f20b54b42bc49ce4b0c91e93e129b153..81aa7de4cb1791fc8bdb2a59d5ca29bed86f1078 100644 (file)
@@ -579,6 +579,7 @@ static int dwc3_gadget_set_ep_config(struct dwc3_ep *dep, unsigned int action)
 
        if (usb_ss_max_streams(comp_desc) && usb_endpoint_xfer_bulk(desc)) {
                params.param1 |= DWC3_DEPCFG_STREAM_CAPABLE
+                       | DWC3_DEPCFG_XFER_COMPLETE_EN
                        | DWC3_DEPCFG_STREAM_EVENT_EN;
                dep->stream_capable = true;
        }