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

Commit df88d152 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "power: fg-alg: add min_start_soc to begin the capacity learning"

parents cb2a81ba de193409
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -327,13 +327,15 @@ static int cap_learning_process_full_data(struct cap_learning *cl)
 */
static int cap_learning_begin(struct cap_learning *cl, u32 batt_soc)
{
	int rc, cc_soc_sw, batt_soc_msb;
	int rc, cc_soc_sw, batt_soc_msb, batt_soc_pct;

	batt_soc_msb = batt_soc >> 24;
	if (DIV_ROUND_CLOSEST(batt_soc_msb * 100, FULL_SOC_RAW) >
		cl->dt.start_soc) {
		pr_debug("Battery SOC %d is high!, not starting\n",
			batt_soc_msb);
	batt_soc_pct = DIV_ROUND_CLOSEST(batt_soc_msb * 100, FULL_SOC_RAW);

	if (batt_soc_pct > cl->dt.max_start_soc ||
			batt_soc_pct < cl->dt.min_start_soc) {
		pr_debug("Battery SOC %d is high/low, not starting\n",
			batt_soc_pct);
		return -EINVAL;
	}

+2 −1
Original line number Diff line number Diff line
@@ -29,7 +29,8 @@ struct cycle_counter {
};

struct cl_params {
	int	start_soc;
	int	min_start_soc;
	int	max_start_soc;
	int	max_temp;
	int	min_temp;
	int	max_cap_inc;