mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 00:21:17 +00:00
usb: dwc2: gadget: use reset detect interrupt
ResetDet interrupt is used to detect a reset of the bus while the controller is suspended. This may happens for example when using Command Verifier. Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Gregory Herrero <gregory.herrero@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
parent
ecb176c63a
commit
4876886fb9
1 changed files with 16 additions and 3 deletions
|
@ -2308,8 +2308,9 @@ void s3c_hsotg_core_init_disconnected(struct dwc2_hsotg *hsotg,
|
||||||
writel(GINTSTS_ERLYSUSP | GINTSTS_SESSREQINT |
|
writel(GINTSTS_ERLYSUSP | GINTSTS_SESSREQINT |
|
||||||
GINTSTS_GOUTNAKEFF | GINTSTS_GINNAKEFF |
|
GINTSTS_GOUTNAKEFF | GINTSTS_GINNAKEFF |
|
||||||
GINTSTS_CONIDSTSCHNG | GINTSTS_USBRST |
|
GINTSTS_CONIDSTSCHNG | GINTSTS_USBRST |
|
||||||
GINTSTS_ENUMDONE | GINTSTS_OTGINT |
|
GINTSTS_RESETDET | GINTSTS_ENUMDONE |
|
||||||
GINTSTS_USBSUSP | GINTSTS_WKUPINT,
|
GINTSTS_OTGINT | GINTSTS_USBSUSP |
|
||||||
|
GINTSTS_WKUPINT,
|
||||||
hsotg->regs + GINTMSK);
|
hsotg->regs + GINTMSK);
|
||||||
|
|
||||||
if (using_dma(hsotg))
|
if (using_dma(hsotg))
|
||||||
|
@ -2475,7 +2476,19 @@ irq_retry:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gintsts & GINTSTS_USBRST) {
|
if (gintsts & GINTSTS_RESETDET) {
|
||||||
|
dev_dbg(hsotg->dev, "%s: USBRstDet\n", __func__);
|
||||||
|
|
||||||
|
writel(GINTSTS_RESETDET, hsotg->regs + GINTSTS);
|
||||||
|
|
||||||
|
/* This event must be used only if controller is suspended */
|
||||||
|
if (hsotg->lx_state == DWC2_L2) {
|
||||||
|
dwc2_exit_hibernation(hsotg, true);
|
||||||
|
hsotg->lx_state = DWC2_L0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gintsts & (GINTSTS_USBRST | GINTSTS_RESETDET)) {
|
||||||
|
|
||||||
u32 usb_status = readl(hsotg->regs + GOTGCTL);
|
u32 usb_status = readl(hsotg->regs + GOTGCTL);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue