summaryrefslogtreecommitdiff
path: root/drivers/power/qcom-charger/qpnp-smb2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/power/qcom-charger/qpnp-smb2.c')
-rw-r--r--drivers/power/qcom-charger/qpnp-smb2.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/power/qcom-charger/qpnp-smb2.c b/drivers/power/qcom-charger/qpnp-smb2.c
index 57f31d8c58e7..8fa4fe301676 100644
--- a/drivers/power/qcom-charger/qpnp-smb2.c
+++ b/drivers/power/qcom-charger/qpnp-smb2.c
@@ -605,6 +605,7 @@ static enum power_supply_property smb2_batt_props[] = {
POWER_SUPPLY_PROP_TECHNOLOGY,
POWER_SUPPLY_PROP_STEP_CHARGING_ENABLED,
POWER_SUPPLY_PROP_STEP_CHARGING_STEP,
+ POWER_SUPPLY_PROP_CHARGE_DONE,
};
static int smb2_batt_get_prop(struct power_supply *psy,
@@ -662,6 +663,9 @@ static int smb2_batt_get_prop(struct power_supply *psy,
case POWER_SUPPLY_PROP_TECHNOLOGY:
val->intval = POWER_SUPPLY_TECHNOLOGY_LION;
break;
+ case POWER_SUPPLY_PROP_CHARGE_DONE:
+ val->intval = chg->chg_done;
+ break;
default:
pr_err("batt power supply prop %d not supported\n", psp);
return -EINVAL;
@@ -692,6 +696,9 @@ static int smb2_batt_set_prop(struct power_supply *psy,
case POWER_SUPPLY_PROP_CAPACITY:
rc = smblib_set_prop_batt_capacity(chg, val);
break;
+ case POWER_SUPPLY_PROP_CHARGE_DONE:
+ chg->chg_done = val->intval;
+ break;
default:
rc = -EINVAL;
}
@@ -992,14 +999,10 @@ 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, and end
- * the charge cycle while the battery is OV.
- */
+ /* Configure charge enable for software control; active high */
rc = smblib_masked_write(chg, CHGR_CFG2_REG,
CHG_EN_POLARITY_BIT |
- CHG_EN_SRC_BIT |
- BAT_OV_ECC_BIT, BAT_OV_ECC_BIT);
+ CHG_EN_SRC_BIT, 0);
if (rc < 0) {
dev_err(chg->dev, "Couldn't configure charger rc=%d\n", rc);
return rc;