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

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

Merge "power: qg-soc: Allow SOC to increase only if we are charging"

parents 87b811fc de9251d1
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -118,6 +118,8 @@ static void get_next_update_time(struct qpnp_qg *chip)

static bool is_scaling_required(struct qpnp_qg *chip)
{
	bool input_present = is_input_present(chip);

	if (!chip->profile_loaded)
		return false;

@@ -134,10 +136,16 @@ static bool is_scaling_required(struct qpnp_qg *chip)
		return false;


	if (chip->catch_up_soc > chip->msoc && !is_input_present(chip))
	if (chip->catch_up_soc > chip->msoc && !input_present)
		/* input is not present and SOC has increased */
		return false;

	if (chip->catch_up_soc > chip->msoc && input_present &&
			(chip->charge_status != POWER_SUPPLY_STATUS_CHARGING &&
			chip->charge_status != POWER_SUPPLY_STATUS_FULL))
		/* USB is present, but not charging */
		return false;

	return true;
}