Re: [PATCH v2 08/22] usb: dwc2: gadget: use reset detect interrupt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

On 03/20/2015 06:36 PM, Mian Yousaf Kaukab wrote:

From: Gregory Herrero <gregory.herrero@xxxxxxxxx>

ResetDet interrupt is used to detect a reset of the bus
while the controller is suspended.
This may happens for example when using Command Verifier.

Signed-off-by: Gregory Herrero <gregory.herrero@xxxxxxxxx>
---
  drivers/usb/dwc2/gadget.c | 19 ++++++++++++++++---
  1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index bed56dc..d528c02 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
[...]
@@ -2475,7 +2476,19 @@ irq_retry:
  		}
  	}

-	if (gintsts & GINTSTS_USBRST) {
+	if (gintsts & GINTSTS_RESETDET) {
+		dev_dbg(hsotg->dev, "%s: USBRstDet\n", __func__);
+
+		writel(GINTSTS_RESETDET, hsotg->regs + GINTSTS);
+
+		/* This event must be used only if controller is suspended */
+		if (hsotg->lx_state == DWC2_L2) {
+			dwc2_exit_hibernation(hsotg, true);
+			hsotg->lx_state = DWC2_L0;
+		}
+	}
+
+	if ((gintsts & GINTSTS_USBRST) || (gintsts & GINTSTS_RESETDET)) {

	if (gintsts & (GINTSTS_USBRST | GINTSTS_RESETDET)) {

[...]

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux