Loading drivers/power/supply/qcom/qpnp-fg-gen3.c +12 −0 Original line number Diff line number Diff line Loading @@ -1686,12 +1686,21 @@ static int fg_set_recharge_soc(struct fg_dev *fg, int recharge_soc) static int fg_adjust_recharge_soc(struct fg_dev *fg) { struct fg_gen3_chip *chip = container_of(fg, struct fg_gen3_chip, fg); union power_supply_propval prop = {0, }; int rc, msoc, recharge_soc, new_recharge_soc = 0; bool recharge_soc_status; if (!chip->dt.auto_recharge_soc) return 0; rc = power_supply_get_property(chip->batt_psy, POWER_SUPPLY_PROP_HEALTH, &prop); if (rc < 0) { pr_err("Error in getting battery health, rc=%d\n", rc); return rc; } chip->health = prop.intval; recharge_soc = chip->dt.recharge_soc_thr; recharge_soc_status = fg->recharge_soc_adjusted; /* Loading Loading @@ -1722,6 +1731,9 @@ static int fg_adjust_recharge_soc(struct fg_dev *fg) if (!fg->recharge_soc_adjusted) return 0; if (chip->health != POWER_SUPPLY_HEALTH_GOOD) return 0; /* Restore the default value */ new_recharge_soc = recharge_soc; fg->recharge_soc_adjusted = false; Loading Loading
drivers/power/supply/qcom/qpnp-fg-gen3.c +12 −0 Original line number Diff line number Diff line Loading @@ -1686,12 +1686,21 @@ static int fg_set_recharge_soc(struct fg_dev *fg, int recharge_soc) static int fg_adjust_recharge_soc(struct fg_dev *fg) { struct fg_gen3_chip *chip = container_of(fg, struct fg_gen3_chip, fg); union power_supply_propval prop = {0, }; int rc, msoc, recharge_soc, new_recharge_soc = 0; bool recharge_soc_status; if (!chip->dt.auto_recharge_soc) return 0; rc = power_supply_get_property(chip->batt_psy, POWER_SUPPLY_PROP_HEALTH, &prop); if (rc < 0) { pr_err("Error in getting battery health, rc=%d\n", rc); return rc; } chip->health = prop.intval; recharge_soc = chip->dt.recharge_soc_thr; recharge_soc_status = fg->recharge_soc_adjusted; /* Loading Loading @@ -1722,6 +1731,9 @@ static int fg_adjust_recharge_soc(struct fg_dev *fg) if (!fg->recharge_soc_adjusted) return 0; if (chip->health != POWER_SUPPLY_HEALTH_GOOD) return 0; /* Restore the default value */ new_recharge_soc = recharge_soc; fg->recharge_soc_adjusted = false; Loading