]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
usb: dwc2: fix STM ID/VBUS detection startup delay in dwc2_driver_probe
authorAmelie Delaunay <amelie.delaunay@foss.st.com>
Tue, 7 Dec 2021 12:45:10 +0000 (13:45 +0100)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 4 Jan 2022 08:49:27 +0000 (09:49 +0100)
commitce8b4d1334a4b596426c5c0749b1840e23423f11
tree4b470335f75c3b061072e73c7e1c895e53fef76c
parentedc09f54321a17479aae01973ff3d4098054f104
usb: dwc2: fix STM ID/VBUS detection startup delay in dwc2_driver_probe

BugLink: https://bugs.launchpad.net/bugs/1956302
commit fac6bf87c55f7f0733efb0375565fb6a50cf2caf upstream.

When activate_stm_id_vb_detection is enabled, ID and Vbus detection relies
on sensing comparators. This detection needs time to stabilize.
A delay was already applied in dwc2_resume() when reactivating the
detection, but it wasn't done in dwc2_probe().
This patch adds delay after enabling STM ID/VBUS detection. Then, ID state
is good when initializing gadget and host, and avoid to get a wrong
Connector ID Status Change interrupt.

Fixes: a415083a11cc ("usb: dwc2: add support for STM32MP15 SoCs USB OTG HS and FS")
Cc: stable <stable@vger.kernel.org>
Acked-by: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20211207124510.268841-1-amelie.delaunay@foss.st.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
drivers/usb/dwc2/platform.c