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

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

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

parents e31b59a1 b12e1610
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -159,6 +159,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;

@@ -175,10 +177,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;
}

+1 −1
Original line number Diff line number Diff line
@@ -361,7 +361,7 @@ int qg_get_battery_temp(struct qpnp_qg *chip, int *temp)
	}
	pr_debug("batt_temp = %d\n", *temp);

	return rc;
	return 0;
}

int qg_get_battery_current(struct qpnp_qg *chip, int *ibat_ua)