MLK-22307 usb: chipidea: usbmisc: usb charger detection improvement
Improve the usb charger detection for imx7D/S and imx845s, which use
the same USB PHY, the main improvements:
1. Keep OPMODE override to be non-driving during the whole charger
detection process according the USB PHY data sheet(Table 6-7
Battery Charging Operations)
2. Disable DCDENB after data contact finished.
3. Use the BC 1.2 defined process for primary and secondary detection:
- VDP_SRC is connected to USB_OTG*_DP and IDM_SINK is connected to
USB_OTG*_DN, for primary detection;
- VDM_SRC is connected to USB_OTG*_DN and IDP_SINK is connected to
USB_OTG*_DP, for seconday detection.
Check Battery Charger Detection Output bit(CHRGDET) to determine
SDP/CDP/DCP.
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
(cherry picked from commit
7ca78ff4a324bb495e7d888640a0956c985ed04d)