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

Commit e91ad7d5 authored by Ashay Jaiswal's avatar Ashay Jaiswal
Browse files

power: battery: fix wakeup source handling for FCC stepping



Update FCC stepping logic to vote for wakeup source only if
FCC stepping is required.

Change-Id: I9cf6b48b1003314c3efcb74b4031ebf8f63476ad
Signed-off-by: default avatarAshay Jaiswal <ashayj@codeaurora.org>
parent d8f81fe4
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -1003,8 +1003,10 @@ static int pl_disable_vote_callback(struct votable *votable,
	chip->fcc_stepper_enable = pval.intval;
	pr_debug("FCC Stepper %s\n", pval.intval ? "enabled" : "disabled");

	if (chip->fcc_stepper_enable)
	if (chip->fcc_stepper_enable) {
		cancel_delayed_work_sync(&chip->fcc_stepper_work);
		vote(chip->pl_awake_votable, FCC_STEPPER_VOTER, false, 0);
	}

	total_fcc_ua = get_effective_result_locked(chip->fcc_votable);

@@ -1042,13 +1044,14 @@ static int pl_disable_vote_callback(struct votable *votable,
				&slave_fcc_ua);

		if (chip->fcc_stepper_enable) {
			vote(chip->pl_awake_votable, FCC_STEPPER_VOTER,
					true, 0);
			get_fcc_stepper_params(chip, master_fcc_ua,
					slave_fcc_ua);
			if (chip->step_fcc)
			if (chip->step_fcc) {
				vote(chip->pl_awake_votable, FCC_STEPPER_VOTER,
					true, 0);
				schedule_delayed_work(&chip->fcc_stepper_work,
					0);
			}
		} else {
			/*
			 * If there is an increase in slave share
@@ -1174,13 +1177,14 @@ static int pl_disable_vote_callback(struct votable *votable,
			chip->total_settled_ua = 0;
			chip->pl_settled_ua = 0;
		} else {
			get_fcc_stepper_params(chip, total_fcc_ua, 0);
			if (chip->step_fcc) {
				vote(chip->pl_awake_votable, FCC_STEPPER_VOTER,
					true, 0);
			get_fcc_stepper_params(chip, total_fcc_ua, 0);
			if (chip->step_fcc)
				schedule_delayed_work(&chip->fcc_stepper_work,
					0);
			}
		}

		rerun_election(chip->fv_votable);