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

Commit cd0bc064 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "power: battery: fix wakeup source handling for FCC stepping"

parents 6a9a85f4 e91ad7d5
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);