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

Commit da0b8635 authored by Subbaraman Narayanamurthy's avatar Subbaraman Narayanamurthy
Browse files

power: qpnp-fg-gen4: Support configure skew in capacity learning algorithm



Capacity learning algorithm takes in a parameter to configure
skew if when specified by the user to offset the errors that
can be accumulated based on the charging nature. Add a device
tree parameter "qcom,cl-skew" to configure it.

CRs-Fixed: 2380759
Change-Id: Ib50b175a6079261627e4038811980329e3c66668
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
parent ed8e2081
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -269,6 +269,12 @@ First Level Node - FG Gen4 device
		    based on change in battery SOC during a charging cycle.
		    If this is specified "qcom,cl-start-capacity" is not used.

- qcom,cl-skew
	Usage:      optional
	Value type: <u32>
	Definition: Skew in decipercentage which when specified will be applied
		    to the final learned capacity.

- qcom,hold-soc-while-full
	Usage:      optional
	Value type: <empty>
+3 −1
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
@@ -4628,6 +4628,8 @@ static int fg_gen4_parse_dt(struct fg_gen4_chip *chip)
	else
		chip->cl->dt.max_cap_limit = temp;

	of_property_read_u32(node, "qcom,cl-skew", &chip->cl->dt.skew_decipct);

	rc = of_property_read_u32(node, "qcom,fg-batt-temp-hot", &temp);
	if (rc < 0)
		chip->dt.batt_temp_hot_thresh = -EINVAL;