Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Commit

Permalink
Revert "Revert "usb: dwc3: gadget: Enable SUSPEND event after CONNECT…
Browse files Browse the repository at this point in the history
… DONE""

This reverts commit 001dd52.

The change leads to USB-PD negotiation failure.

Signed-off-by: Jesse Chan <[email protected]>
  • Loading branch information
jesec committed Jun 22, 2020
1 parent 5230773 commit d778757
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -2564,14 +2564,8 @@ 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);
}
Expand Down Expand Up @@ -3678,6 +3672,13 @@ 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;

Expand Down

0 comments on commit d778757

Please sign in to comment.