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

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

Merge "power: qpnp-bms: store an invalid SoC if below 5 degC"

parents 05ea1f9e b2e97d15
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1677,10 +1677,13 @@ static void backup_soc_and_iavg(struct qpnp_bms_chip *chip, int batt_temp,

	rc = qpnp_write_wrapper(chip, &temp, chip->base + IAVG_STORAGE_REG, 1);

	/* don't store soc if temperature is below 5degC */
	/* store an invalid soc if temperature is below 5degC */
	if (batt_temp > IGNORE_SOC_TEMP_DECIDEG)
		qpnp_masked_write_base(chip, chip->soc_storage_addr,
				SOC_STORAGE_MASK, (soc + 1) << 1);
	else
		qpnp_masked_write_base(chip, chip->soc_storage_addr,
				SOC_STORAGE_MASK, SOC_STORAGE_MASK);
}

static int scale_soc_while_chg(struct qpnp_bms_chip *chip, int chg_time_sec,