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

Commit d844c092 authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar
Browse files

power: qpnp-fg: configure CC-CV threshold based on battery type



Add support to read CC-CV threshold configuration from battery profile.
If CC-CV threshold is present in FG DT node then it will always takes
precedence over the configuration present in battery profile.

CRs-Fixed: 847161
Change-Id: I40562f50247b4674726a7ac6364b8b91d7440309
Signed-off-by: default avatarAshay Jaiswal <ashayj@codeaurora.org>
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent 0365833b
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -3836,6 +3836,17 @@ wait:
	if (rc)
		pr_warn("couldn't find battery max voltage\n");

	/*
	 * Only configure from profile if fg-cc-cv-threshold-mv is not
	 * defined in the charger device node.
	 */
	if (!of_find_property(chip->spmi->dev.of_node,
				"qcom,fg-cc-cv-threshold-mv", NULL)) {
		of_property_read_u32(profile_node,
				"qcom,fg-cc-cv-threshold-mv",
				&chip->cc_cv_threshold_mv);
	}

	data = of_get_property(profile_node, "qcom,fg-profile-data", &len);
	if (!data) {
		pr_err("no battery profile loaded\n");