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

Commit 6489655c authored by Umang Agrawal's avatar Umang Agrawal
Browse files

power: qpnp-qg: Add support for weighted capacity learning



Add support to loosen capacity learning qualifying criterion.
This helps to learn capacity from any starting battery SOC to
any ending battery SOC, provided, battery SOC changes by at least
10 % during charging. Assign weight to this capacity learning
event based on the change in battery SOC.

Change-Id: I110e0f032c1e402a624abe61e1d9ff06e6c73150
Signed-off-by: default avatarUmang Agrawal <uagrawal@codeaurora.org>
parent 216adf27
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -3358,6 +3358,7 @@ static void qg_create_debugfs(struct qpnp_qg *chip)
#define DEFAULT_CL_MAX_DEC_DECIPERC	20
#define DEFAULT_CL_MIN_LIM_DECIPERC	500
#define DEFAULT_CL_MAX_LIM_DECIPERC	100
#define DEFAULT_CL_DELTA_BATT_SOC	10
#define DEFAULT_SHUTDOWN_TEMP_DIFF	60	/* 6 degC */
#define DEFAULT_ESR_QUAL_CURRENT_UA	130000
#define DEFAULT_ESR_QUAL_VBAT_UV	7000
@@ -3656,6 +3657,14 @@ static int qg_parse_dt(struct qpnp_qg *chip)
		else
			chip->cl->dt.max_cap_limit = temp;

		chip->cl->dt.min_delta_batt_soc = DEFAULT_CL_DELTA_BATT_SOC;
		/* read from DT property and update, if value exists */
		of_property_read_u32(node, "qcom,cl-min-delta-batt-soc",
					&chip->cl->dt.min_delta_batt_soc);

		chip->cl->dt.cl_wt_enable = of_property_read_bool(node,
							"qcom,cl-wt-enable");

		qg_dbg(chip, QG_DEBUG_PON, "DT: cl_min_start_soc=%d cl_max_start_soc=%d cl_min_temp=%d cl_max_temp=%d\n",
			chip->cl->dt.min_start_soc, chip->cl->dt.max_start_soc,
			chip->cl->dt.min_temp, chip->cl->dt.max_temp);