MLK-25653 phy: freescale: imx8mq-usb: fix BC 1.2 detection timing
Following CDP timing requirements defined by USB BC 1.2 specification and section 3.2.4 Detection Timing CDP.
During Primary Detection iMX device should turn on VDP_SRC and IDM_SINK for a minimum of 40ms (TVDPSRC_ON). After a time of TVDPSRC_ON, iMX device is allowed to check the status of the D- line. Current implementation is waiting between 1ms and 2ms, and certain BC 1.2 complaint USB HUBs cannot be detected. Increase delay to 40ms allowing enough time for primary detection.
During secondary detection the i.MX is required to disable VDP_SRC and IDM_SNK, and enable VDM_SRC and IDP_SINK for at least 40ms (TVDMSRC_ON).
This an equivalent patch of BC1.2 fix on USB2 PHY: commit c6d580d9 ("usb: chipidea: imx: Fix Battery Charger 1.2 CDP detection")
Reviewed-by: Xu Yang xu.yang_2@nxp.com Signed-off-by: Li Jun jun.li@nxp.com