Skip to content

Commit fac6bf8

Browse files
ADESTMgregkh
authored andcommitted
usb: dwc2: fix STM ID/VBUS detection startup delay in dwc2_driver_probe
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: a415083 ("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>
1 parent f08adf5 commit fac6bf8

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/usb/dwc2/platform.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,9 @@ static int dwc2_driver_probe(struct platform_device *dev)
575575
ggpio |= GGPIO_STM32_OTG_GCCFG_IDEN;
576576
ggpio |= GGPIO_STM32_OTG_GCCFG_VBDEN;
577577
dwc2_writel(hsotg, ggpio, GGPIO);
578+
579+
/* ID/VBUS detection startup time */
580+
usleep_range(5000, 7000);
578581
}
579582

580583
retval = dwc2_drd_init(hsotg);

0 commit comments

Comments
 (0)