power: qpnp-smbcharger: fix parallel charging enable/disable
Currently the parallel charging algorithm reacts instantly to the AICL
done interrupt. This can cause issues where the current has not settled
yet and the system load has not ramped up to a point where the true AICL
setpoint is reached. Trying to enable parallel charging during this time
can falsely enable parallel charging for cables that does not support
the current threshold necessary for efficient operation.
Fix this by setting a 3.5 second delay between checking that parallel
charging can be enabled and actually enabling it. This way, when the
enable function is called, the usb settings will have settled and the
correct AICL threshold and 5V/9V adapters can be safely distinguished.
Also, add a delay to the AICL rerun function. When the AICL is enabled
and disabled back to back, it sometimes does not have time to react, and
AICL is never reran. This can cause problems where when parallel charging
is being disabled, the primary charger cannot pull the full current
possible because AICL is never reran.
Finally, fix a bug in the taper charge handler for the parallel charging
algorithm. A lock is never released when the charger detects that it
needs to retry lowering the fast charge current, causing a deadlock and
parallel charging to never disable. Add a call to mutex_unlock before
going back to try_again in that function.
CRs-Fixed: 733213
Change-Id: I27e1a6fc21c8a8f4c1de73e222222981285effdf
Signed-off-by:
Xiaozhe Shi <xiaozhes@codeaurora.org>
Loading
Please register or sign in to comment