linux/drivers/usb/dwc2
Jianwei Zheng 25da86fe62 usb: dwc2: Fix dwc2 OTG-HOST resume fails to recognize peripherals
This patch fix following two cases dwc2 resume does not recognize
peripherals.

1. plug in device after system suspend, then press the power-on
button to wake up,at this time the dr_mode is OTG, op_state is
still Peripheral, the Bit[0] of GINTSTS is 1 and the port power
is off, dwc2 will not resume at this time.

2. plug in device then press the power-on button to put the system
to sleep, then we press the power-on button to wake up the system,
At this time, the dr_mode is OTG, op_state is still Host, the Bit[0]
of GINTSTS is 1, dwc2 will not resume and working abnormally.

To resolve the first exception, we should call the dwc2_hsotg_resume()
directly to resume dwc2. To resolve the second exception, if the dwc2
is lost power during suspend like RK3326S platform, wo should reinit
the core to device mode, and after do dwc2_hsotg_resume, it can trigger
the ID status change interrupt if the OTG cable is still connect. Then
we can init it for host mode in the ID status change interrupt handler.
We can use the power on bit of Hprt register to distinguish whether
it is lost power during suspend.

Signed-off-by: Jianwei Zheng <jianwei.zheng@rock-chips.com>
Change-Id: I7cd09bce993dcee8e5bfcaddd5fe884cdfab6b52
2022-07-28 11:05:54 +08:00
..
core_intr.c usb: dwc2: Fix build in periphal-only mode 2021-06-10 13:39:26 +02:00
core.c usb: dwc2: Don't reset the core after setting turnaround time 2021-07-14 16:56:43 +02:00
core.h Merge tag 'ASB-2022-06-05_12-5.10' of https://android.googlesource.com/kernel/common 2022-07-15 17:58:38 +08:00
debug.h
debugfs.c
drd.c Merge tag 'ASB-2022-06-05_12-5.10' of https://android.googlesource.com/kernel/common 2022-07-15 17:58:38 +08:00
gadget.c Merge tag 'ASB-2022-04-05_12-5.10' of https://android.googlesource.com/kernel/common 2022-07-15 17:40:39 +08:00
hcd_ddma.c
hcd_intr.c usb: dwc2: host: fix channel halt with unknown reason 2021-06-03 16:27:27 +08:00
hcd_queue.c Merge tag 'ASB-2022-04-05_12-5.10' of https://android.googlesource.com/kernel/common 2022-07-15 17:40:39 +08:00
hcd.c Merge tag 'ASB-2022-04-05_12-5.10' of https://android.googlesource.com/kernel/common 2022-07-15 17:40:39 +08:00
hcd.h
hw.h
Kconfig usb: dwc2: override PHY input signals with usb role switch support 2020-10-02 13:29:13 +03:00
Makefile usb: dwc2: override PHY input signals with usb role switch support 2020-10-02 13:29:13 +03:00
params.c usb: dwc2: use buffer dma for device mode on Rockchip SoCs 2021-06-03 09:47:33 +08:00
pci.c
platform.c usb: dwc2: Fix dwc2 OTG-HOST resume fails to recognize peripherals 2022-07-28 11:05:54 +08:00