summaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorNicholas Troast <ntroast@codeaurora.org>2016-07-19 15:48:31 -0700
committerNicholas Troast <ntroast@codeaurora.org>2016-07-29 17:01:36 -0700
commit896365001ee5725762a70921319b8e3ca27a28e8 (patch)
tree369a1305bf838d7c87aab5e346024f52ca721f67 /drivers/power
parent7ebe256eaa819f5f9e168d922b12452d28a736a3 (diff)
qcom-charger: qpnp-smb2: End charge cycle while battery is OV
Currently the charge cycle continues while the battery is OV. Configure the charger to end the charge cycle while battery is OV. Change-Id: I6fc333e15c5f0410c6b560b2a7005a1752f5f936 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/qcom-charger/qpnp-smb2.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/power/qcom-charger/qpnp-smb2.c b/drivers/power/qcom-charger/qpnp-smb2.c
index 7810ecb9b15b..93f9fbb292bb 100644
--- a/drivers/power/qcom-charger/qpnp-smb2.c
+++ b/drivers/power/qcom-charger/qpnp-smb2.c
@@ -510,12 +510,16 @@ static int smb2_init_hw(struct smb2 *chip)
vote(chg->dc_icl_votable,
DEFAULT_VOTER, true, chip->dt.dc_icl_ua);
- /* configure charge enable for software control; active high */
+ /*
+ * Configure charge enable for software control; active high, and end
+ * the charge cycle while the battery is OV.
+ */
rc = smblib_masked_write(chg, CHGR_CFG2_REG,
- CHG_EN_POLARITY_BIT | CHG_EN_SRC_BIT, 0);
+ CHG_EN_POLARITY_BIT |
+ CHG_EN_SRC_BIT |
+ BAT_OV_ECC_BIT, BAT_OV_ECC_BIT);
if (rc < 0) {
- dev_err(chg->dev,
- "Couldn't configure charge enable source rc=%d\n", rc);
+ dev_err(chg->dev, "Couldn't configure charger rc=%d\n", rc);
return rc;
}