diff options
| author | Mayank Rana <mrana@codeaurora.org> | 2016-07-15 11:45:14 -0700 |
|---|---|---|
| committer | Mayank Rana <mrana@codeaurora.org> | 2016-07-15 11:54:46 -0700 |
| commit | 8f49ae0d808acf97bbf7817889f7bd687d86d7cf (patch) | |
| tree | 72a2e80cfe4fb1325dd404d1a9464754c6a39c1d | |
| parent | 4ba4c5041bd55f8c5d1d0cd1e729501e915a6197 (diff) | |
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>
| -rw-r--r-- | drivers/usb/dwc3/gadget.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 76d39a6fb68c..5a5e582a8d79 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -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); |
