UPSTREAM: usb: dwc3: gadget: update transfer needs transfer resource
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 30 May 2016 10:29:35 +0000 (13:29 +0300)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 16 Aug 2016 12:48:19 +0000 (20:48 +0800)
According to SNPS databook, we need to pass transfer
resource on update transfer command, let's do it.

Change-Id: I972007913ca2511f76e565a624721300c9fb754e
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit b6b1c6db4c7f04ffe3fd411baa9df31f4dd355dd)

drivers/usb/dwc3/gadget.c

index e4ff991b43b2eedf371240cf2ed712fc3ef3adcf..26eb7f013ce6f36121dc2ccb286a0ce77118946f 100644 (file)
@@ -994,12 +994,13 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep, u16 cmd_param)
        if (starting) {
                params.param0 = upper_32_bits(req->trb_dma);
                params.param1 = lower_32_bits(req->trb_dma);
-               cmd = DWC3_DEPCMD_STARTTRANSFER;
+               cmd = DWC3_DEPCMD_STARTTRANSFER |
+                       DWC3_DEPCMD_PARAM(cmd_param);
        } else {
-               cmd = DWC3_DEPCMD_UPDATETRANSFER;
+               cmd = DWC3_DEPCMD_UPDATETRANSFER |
+                       DWC3_DEPCMD_PARAM(dep->resource_index);
        }
 
-       cmd |= DWC3_DEPCMD_PARAM(cmd_param);
        ret = dwc3_send_gadget_ep_cmd(dep, cmd, &params);
        if (ret < 0) {
                /*