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

Commit acaf7023 authored by Anirudh Ghayal's avatar Anirudh Ghayal Committed by Gerrit - the friendly Code Review server
Browse files

power: qpnp-qg: Cap the FULL SOC to 99



FULL SOC is expected to be capped @ 99% for
system SOC calculations.

Change-Id: I5f99223ff55b1831793066c432d04ed60823881c
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent ed8e2081
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
/* Copyright (c) 2018 The Linux Foundation. All rights reserved.
/* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -2818,6 +2818,7 @@ static int qg_determine_pon_soc(struct qpnp_qg *chip)
			pr_err("Failed to lookup FULL_SOC@PON rc=%d\n", rc);
			goto done;
		}
		full_soc = CAP(0, 99, full_soc);

		rc = lookup_soc_ocv(&cutoff_soc,
				chip->dt.vbatt_cutoff_mv * 1000,
@@ -2835,7 +2836,7 @@ static int qg_determine_pon_soc(struct qpnp_qg *chip)

		qg_dbg(chip, QG_DEBUG_PON, "v_float=%d v_cutoff=%d FULL_SOC=%d CUTOFF_SOC=%d PON_SYS_SOC=%d pon_soc=%d\n",
			chip->bp.float_volt_uv, chip->dt.vbatt_cutoff_mv * 1000,
			full_soc, cutoff_soc, pon_soc, soc);
			full_soc, cutoff_soc, soc, pon_soc);
	}
done:
	if (rc < 0) {