aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/gadget.c
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2012-09-18 14:39:24 -0400
committerFelipe Balbi <balbi@ti.com>2013-03-18 05:17:57 -0400
commit0b0cc1cd31bed3e3147398e54530f1f819b27692 (patch)
treefefac187ba34d39b4116c9e71ff5289188c65747 /drivers/usb/dwc3/gadget.c
parent7ac6a593d512de38e710591afea4c839626b3bd0 (diff)
usb: dwc3: workaround: unexpected transtion U3 -> RESUME
In DWC3 versions < 2.50a configured without Hibernation mode enabled, there will be an extra link status change interrupt if device detects host-initiated U3 exit. In that case, core will generate an unnecessary U3 -> RESUME transition which should be ignored by the driver. Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r--drivers/usb/dwc3/gadget.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 4ffec1aa2e25..8e53acc0e43e 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2317,6 +2317,34 @@ static void dwc3_gadget_linksts_change_interrupt(struct dwc3 *dwc,
2317 unsigned int evtinfo) 2317 unsigned int evtinfo)
2318{ 2318{
2319 enum dwc3_link_state next = evtinfo & DWC3_LINK_STATE_MASK; 2319 enum dwc3_link_state next = evtinfo & DWC3_LINK_STATE_MASK;
2320 unsigned int pwropt;
2321
2322 /*
2323 * WORKAROUND: DWC3 < 2.50a have an issue when configured without
2324 * Hibernation mode enabled which would show up when device detects
2325 * host-initiated U3 exit.
2326 *
2327 * In that case, device will generate a Link State Change Interrupt
2328 * from U3 to RESUME which is only necessary if Hibernation is
2329 * configured in.
2330 *
2331 * There are no functional changes due to such spurious event and we
2332 * just need to ignore it.
2333 *
2334 * Refers to:
2335 *
2336 * STAR#9000570034 RTL: SS Resume event generated in non-Hibernation
2337 * operational mode
2338 */
2339 pwropt = DWC3_GHWPARAMS1_EN_PWROPT(dwc->hwparams.hwparams1);
2340 if ((dwc->revision < DWC3_REVISION_250A) &&
2341 (pwropt != DWC3_GHWPARAMS1_EN_PWROPT_HIB)) {
2342 if ((dwc->link_state == DWC3_LINK_STATE_U3) &&
2343 (next == DWC3_LINK_STATE_RESUME)) {
2344 dev_vdbg(dwc->dev, "ignoring transition U3 -> Resume\n");
2345 return;
2346 }
2347 }
2320 2348
2321 /* 2349 /*
2322 * WORKAROUND: DWC3 Revisions <1.83a have an issue which, depending 2350 * WORKAROUND: DWC3 Revisions <1.83a have an issue which, depending