From 896365001ee5725762a70921319b8e3ca27a28e8 Mon Sep 17 00:00:00 2001 From: Nicholas Troast Date: Tue, 19 Jul 2016 15:48:31 -0700 Subject: 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 --- drivers/power/qcom-charger/qpnp-smb2.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'drivers/power') 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; } -- cgit v1.2.3