Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b217bf15 authored by Pratham Pratap's avatar Pratham Pratap
Browse files

Revert "usb: dwc3: gadget: Enable SUSPEND event after CONNECT DONE"



This reverts commit 74cc257a.

Instead, enable the SUSPEND event interrupt on enable_irq as part
of gadget start to be inline with USB specification.

Change-Id: I4c2d6e48a2276b480e112ee203a18a6865f15408
Signed-off-by: default avatarPratham Pratap <prathampratap@codeaurora.org>
parent 73a012df
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -2331,8 +2331,14 @@ static void dwc3_gadget_enable_irq(struct dwc3 *dwc)
			DWC3_DEVTEN_USBRSTEN |
			DWC3_DEVTEN_DISCONNEVTEN);

	/*
	 * Enable SUSPENDEVENT(BIT:6) for version 230A and above
	 * else enable USB Link change event (BIT:3) for older version
	 */
	if (dwc->revision < DWC3_REVISION_230A)
		reg |= DWC3_DEVTEN_ULSTCNGEN;
	else
		reg |= DWC3_DEVTEN_EOPFEN;

	dwc3_writel(dwc->regs, DWC3_DEVTEN, reg);
}
@@ -3399,13 +3405,6 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc)
	speed = reg & DWC3_DSTS_CONNECTSPD;
	dwc->speed = speed;

	/* Enable SUSPENDEVENT(BIT:6) for version 230A and above */
	if (dwc->revision >= DWC3_REVISION_230A) {
		reg = dwc3_readl(dwc->regs, DWC3_DEVTEN);
		reg |= DWC3_DEVTEN_EOPFEN;
		dwc3_writel(dwc->regs, DWC3_DEVTEN, reg);
	}

	/* Reset the retry on erratic error event count */
	dwc->retries_on_error = 0;