Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 784bad87 authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar
Browse files

battery: fix sw jeita's Float Voltage control



Currently FV is a max voter where it may not end up reducing
it if jeita wants to lower it.

Moreover Qnovo shouldn't be allowed to vote higher than the
FV voted by battery profile.

Change it to a min voter. While at it remove the mutual exclusion
between profile voter and qnovo voter.

Change-Id: Ic3a597a5d3931932950123370a04a45e07d16b68
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent 8670f618
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1012,7 +1012,7 @@ int qcom_batt_init(void)
		goto release_wakeup_source;
	}

	chip->fv_votable = create_votable("FV", VOTE_MAX,
	chip->fv_votable = create_votable("FV", VOTE_MIN,
					pl_fv_vote_callback,
					chip);
	if (IS_ERR(chip->fv_votable)) {
+2 −8
Original line number Diff line number Diff line
@@ -1092,14 +1092,8 @@ static int smb2_batt_set_prop(struct power_supply *psy,
		rc = smblib_set_prop_charge_qnovo_enable(chg, val);
		break;
	case POWER_SUPPLY_PROP_VOLTAGE_QNOVO:
		if (val->intval == -EINVAL) {
			vote(chg->fv_votable, BATT_PROFILE_VOTER,
					true, chg->batt_profile_fv_uv);
			vote(chg->fv_votable, QNOVO_VOTER, false, 0);
		} else {
			vote(chg->fv_votable, QNOVO_VOTER, true, val->intval);
			vote(chg->fv_votable, BATT_PROFILE_VOTER, false, 0);
		}
		vote(chg->fv_votable, QNOVO_VOTER,
			(val->intval >= 0), val->intval);
		break;
	case POWER_SUPPLY_PROP_CURRENT_QNOVO:
		vote(chg->pl_disable_votable, PL_QNOVO_VOTER,