power: qpnp-smbcharger: add workaround for UVLO resets
When using the PMI8994 smbcharger, usb removal or suspend can cause
an under voltage lock out (UVLO) due to a hardware bug.
The condition for the UVLO to happen is when the whole system is running
off the charger buck when the USB is either removed or suspended. This
case can easily happen when the system is running at medium loads
(300-400 mA) and the battery is considered missing, overtemp, or
overvoltage by the charger hardware.
When this happens, the charger stops trying to pump current into the
battery, and instead just draws power from the active charge path
(USB in ths case). However, when the input charge path is removed, either
by suspending it through software or by physically removing the USB
cable, the battery FET does not turn on fast enough in hardware to
supplement the system load. This causes a droop on VPH power, manifesting
itself as an UVLO reset.
The work around for this issue is to ensure the battery is supplementing
the current before a charge path removal event happens. Implement this by
forcing USB input current limit to be 100mA whenever the device is not
charging. More specifically, whenever a charger p2f-thresh interrupt
(pre-to-fastcharge event, charging starts) or a battery interface
chg-error interrupt (battery missing/overtemp/overvolt) happens, check
the charging status and if the device is not charging, force the charger
to only draw 100mA.
If the input current limit is at 100mA, the system will be drawing
current from the battery as long as the system load is higher than
100mA. Thus, when the USB is removed, the battery will already be
supplementing the system load, and there will not be an UVLO reset.
There are a few limitations to this work around.
1. If the system load is less than 100mA when the input charge
path is removed, there may still be a droop on VPH power due
to the battery FET still being open. However, this should not
cause an UVLO reset because the system load will not cause a
large enough droop to cause a UVLO reset.
2. If the input is removed at the exact instant a charger error
occurs (battery goes missing, battery becomes overtemp,
battery becomes overvoltage), and the interrupt does not get
serviced before the input is removed, an UVLO reset can still
happen. However, this is a hardware limitation and there is
no solution for this at this time.
3. Currently, the workaround for the DC input charge path is not
supported. Until this is implemented, DC charging and wipower
will be impacted.
CRs-Fixed: 667489
Change-Id: I1a185d126e1e6bb851e5981f8b49072e8f8c6f68
Signed-off-by:
Xiaozhe Shi <xiaozhes@codeaurora.org>
Loading
Please register or sign in to comment