]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
usb: host: xhci: add support for Light Reset for DWC3 DRD
authorManish Narani <manish.narani@xilinx.com>
Fri, 27 Jan 2017 10:06:14 +0000 (15:36 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 30 Jan 2017 10:09:09 +0000 (11:09 +0100)
This patch adds support for Light Reset in Host Driver when
the core is in DRD mode.

There is a requirement of LRESET instead of RESET (Hard) in DWC3
controller when it is switching to the peripheral mode.

Signed-off-by: Manish Narani <mnarani@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/usb/host/xhci.c

index 1a4ca02729c274cb83762636e5556ca75e840144..3325c7dff02ca8b596ef216b0516d19f63daa51a 100644 (file)
@@ -174,7 +174,11 @@ int xhci_reset(struct xhci_hcd *xhci)
 
        xhci_dbg_trace(xhci, trace_xhci_dbg_init, "// Reset the HC");
        command = readl(&xhci->op_regs->command);
+#ifdef CONFIG_USB_DWC3_DUAL_ROLE
+       command |= CMD_LRESET;
+#else
        command |= CMD_RESET;
+#endif
        writel(command, &xhci->op_regs->command);
 
        /* Existing Intel xHCI controllers require a delay of 1 mS,
@@ -188,7 +192,12 @@ int xhci_reset(struct xhci_hcd *xhci)
                udelay(1000);
 
        ret = xhci_handshake(&xhci->op_regs->command,
-                       CMD_RESET, 0, 10 * 1000 * 1000);
+#ifdef CONFIG_USB_DWC3_DUAL_ROLE
+                       CMD_LRESET,
+#else
+                       CMD_RESET,
+#endif
+                       0, 10 * 1000 * 1000);
        if (ret)
                return ret;