linux/drivers/usb
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
..
atm
c67x00
cdns3
chipidea usb: chipidea: ci_hdrc_imx: fix potential error pointer dereference in probe 2021-12-01 09:18:59 +01:00
class usb: usbtmc: Fix bug in pipe direction for control transfers 2022-03-23 09:13:29 +01:00
common FROMGIT: usb: common: usb-conn-gpio: Allow wakeup from system suspend 2022-06-22 15:28:39 +00:00
core Merge tag 'ASB-2022-04-05_12-5.10' of https://android.googlesource.com/kernel/common 2022-07-15 17:40:39 +08:00
dwc2 usb: dwc2: Fix dwc2 OTG-HOST resume fails to recognize peripherals 2022-07-28 11:05:54 +08:00
dwc3 Merge tag 'ASB-2022-06-05_12-5.10' of https://android.googlesource.com/kernel/common 2022-07-15 17:58:38 +08:00
early Revert "usb: early: convert to readl_poll_timeout_atomic()" 2021-12-22 09:30:56 +01:00
gadget usb: gadget: uvc: support zero copy with rockchip encoder 2022-07-28 10:22:54 +08:00
host Merge tag 'ASB-2022-06-05_12-5.10' of https://android.googlesource.com/kernel/common 2022-07-15 17:58:38 +08:00
image
isp1760
misc usb: ftdi-elan: fix memory leak on device disconnect 2022-01-27 10:53:58 +01:00
mon
mtu3 usb: mtu3: fix interval value for intr and isoc 2022-01-11 15:25:02 +01:00
musb
phy
renesas_usbhs
roles
serial USB: serial: simple: add Nokia phone driver 2022-04-08 14:39:46 +02:00
storage Merge tag 'ASB-2022-06-05_12-5.10' of https://android.googlesource.com/kernel/common 2022-07-15 17:58:38 +08:00
typec Merge tag 'ASB-2022-04-05_12-5.10' of https://android.googlesource.com/kernel/common 2022-07-15 17:40:39 +08:00
usbip
Kconfig
Makefile
usb-skeleton.c