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

Commit 8f49ae0d authored by Mayank Rana's avatar Mayank Rana
Browse files

dwc3: gadget: Add debug event for pull up operation



This change adds debug event to capture pull up operation request.
It also captures if software fails to perfrom pull-up operation
here.

CRs-Fixed: 1036037
Change-Id: I77ecff3a2ac395ff3799c1b0618fbc7f5eeb03da
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 4ba4c504
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -1750,6 +1750,7 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on, int suspend)

	reg = dwc3_readl(dwc->regs, DWC3_DCTL);
	if (is_on) {
		dbg_event(0xFF, "Pullup_enable", is_on);
		if (dwc->revision <= DWC3_REVISION_187A) {
			reg &= ~DWC3_DCTL_TRGTULST_MASK;
			reg |= DWC3_DCTL_TRGTULST_RX_DET;
@@ -1787,6 +1788,7 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on, int suspend)

		dwc->pullups_connected = true;
	} else {
		dbg_event(0xFF, "Pullup_disable", is_on);
		dwc3_gadget_disable_irq(dwc);
		__dwc3_gadget_ep_disable(dwc->eps[0]);
		__dwc3_gadget_ep_disable(dwc->eps[1]);
@@ -1812,8 +1814,15 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on, int suspend)
				break;
		}
		timeout--;
		if (!timeout)
		if (!timeout) {
			dev_err(dwc->dev, "failed to %s controller\n",
					is_on ? "start" : "stop");
			if (is_on)
				dbg_event(0xFF, "STARTTOUT", reg);
			else
				dbg_event(0xFF, "STOPTOUT", reg);
			return -ETIMEDOUT;
		}
		udelay(1);
	} while (1);