mirror of
https://github.com/LineageOS/android_kernel_samsung_msm8226.git
synced 2026-09-29 00:00:25 +02:00
If charger detection is performed before data pins are contacted, DCP (Dedicated Charging Port) will be incorrectly detected as SDP (Standard Downstream Port). The current code waits 700 msec for data pins contact to happen. But if USB plug is inserted very slowly, charger detection happen before data pins get contacted. This patch implements a workaround to the above problem. Kick a 2 sec timer after SDP is detected. This timer would not do anything if USB is in low power mode or cable is disconnected or gadget speed is assigned. If above conditions are not not true, read line state. The line state would be "11" in case of DCP as D+ is already pulled to high by gadget driver. If DCP is detected, stop gadget driver and enter B_IDLE state. PMIC is notified about available current and USB is put into low power mode. CRs-fixed: 405253 Change-Id: I9181a4774cd98308752ad6c281107ec11bc4728c Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>