power: qpnp-linear-charger: Cancel vdd_trim alarm on USB removal

There is a possibility that a scheduled vdd_trim alarm work
may fire after USB removal. Fix this by cancelling the alarm
when USB is removed.

CRs-Fixed: 847664
Change-Id: Ia9dd27c6b0715ce78d6467c6ffe877f2ef0e9355
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>dd
This commit is contained in:
Anirudh Ghayal 2015-06-10 21:00:04 +05:30
parent 515b0c69b7
commit f1649ad234
1 changed files with 3 additions and 0 deletions

View File

@ -2476,6 +2476,9 @@ static irqreturn_t qpnp_lbc_usbin_valid_irq_handler(int irq, void *_chip)
flags);
if (chip->cfg_collapsible_chgr_support)
chip->non_collapsible_chgr_detected = false;
if (chip->supported_feature_flag & VDD_TRIM_SUPPORTED)
alarm_try_to_cancel(&chip->vddtrim_alarm);
} else {
/*
* Override VBAT_DET comparator to start charging