OSDN Git Service

drivers: usb: dwc3: Add XMIT_DEV command
authorIdo Shayevitz <idos@codeaurora.org>
Thu, 14 Aug 2014 07:20:49 +0000 (10:20 +0300)
committerDavid Keitel <dkeitel@codeaurora.org>
Tue, 22 Mar 2016 18:06:50 +0000 (11:06 -0700)
Starting with synopsis version 220A the command to wake up the
host changed from 0x3 to 0x7. The code is fixed accordingly.
The problem that was seen is that upon MBIM function
suspend, a remote wakeup from the IPA side wouldn't
wake up the host, and at some point a stall in the IPA would be
seen.

CRs-fixed: 695414
Change-Id: I6ef5c649f263f388a1cc92a3db71c14c741b5b71
Signed-off-by: Lena Salman <esalman@codeaurora.org>
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
drivers/usb/dwc3/core.h
drivers/usb/dwc3/gadget.c

index 8997c5c..f24c119 100644 (file)
 #define DWC3_DGCMD_SET_LMP             0x01
 #define DWC3_DGCMD_SET_PERIODIC_PAR    0x02
 #define DWC3_DGCMD_XMIT_FUNCTION       0x03
+#define DWC3_DGCMD_XMIT_DEV            0x07
 
 /* These apply for core versions 1.94a and later */
 #define DWC3_DGCMD_SET_SCRATCHPAD_ADDR_LO      0x04
index ca8cedf..0a77517 100644 (file)
@@ -1624,8 +1624,13 @@ static int dwc_gadget_func_wakeup(struct usb_gadget *g, int interface_id)
                return -EAGAIN;
        }
 
-       ret = dwc3_send_gadget_generic_command(dwc,
-               DWC3_DGCMD_XMIT_FUNCTION, interface_id);
+       if (dwc->revision < DWC3_REVISION_220A) {
+               ret = dwc3_send_gadget_generic_command(dwc,
+                       DWC3_DGCMD_XMIT_FUNCTION, interface_id);
+       } else {
+               ret = dwc3_send_gadget_generic_command(dwc,
+                       DWC3_DGCMD_XMIT_DEV, 0x1 | (interface_id << 4));
+       }
 
        if (ret)
                pr_err("Function wakeup HW command failed.\n");