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: Mayank Rana <mrana@codeaurora.org>
This commit is contained in:
Mayank Rana 2016-07-15 11:45:14 -07:00
parent 4ba4c5041b
commit 8f49ae0d80

View file

@ -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);