Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8464c490 authored by Xiaozhe Shi's avatar Xiaozhe Shi
Browse files

power: qpnp-smbcharger: handle very weak chargers



The PMi charger peripheral can detect weak chargers through the automatic
input current limit (AICL) feature by observing how much current it
takes to collapse an external charger. Additionally, under very bad
conditions, such as having a very weak charger with a high impedance
cable, the AICL algorithm will actually stop altogether when the USB
voltage drops below the autoshutdown threshold.

Normally, this will trigger AICL suspend and shut off the charger buck.
However, if hardware AICL reruns are enabled, AICL cannot be suspended
in hardware. This can cause a problem where the USBIN_UV interrupt is
continuously received when the USBIN voltage hovers around the lower
limit of the valid range.

Fix this by detecting very weak chargers if the USBIN_UV is high at the
same time USBIN_SRC_DET is high. If both interrupts lines are high,
it means that the USB voltage is below the low threshold for UV but
higher than the coarse detect threshold (1V).

If a weak charger is detected, disable AICL rerun to allow the charger
to enter into AICL suspend, and set the USB health to UNSPEC_FAILURE,
and do not report USB online.

Also, do not allow USBIN_UV to reset the aicl_irq_count in order to
allow the battery OV interrupt to run correctly.

CRs-Fixed: 823770
Change-Id: If853659fa7aaf899f500d8933a773ab80d0464a1
Signed-off-by: default avatarXiaozhe Shi <xiaozhes@codeaurora.org>
parent 2c94b2a3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment