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

Commit 18839e57 authored by Umang Agrawal's avatar Umang Agrawal
Browse files

power: qpnp-qg: Add a DT property to use S7 PON OCV



PMI632 PON OCV is dependent on the primary PMIC it is
paired with. Add a DT property to force using S7 based
OCV instead of the multi-level PON OCV logic.

Change-Id: I3846276646e933c4c893b7325bf70ea2455dc891
Signed-off-by: default avatarUmang Agrawal <uagrawal@codeaurora.org>
parent 0b54c38b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ struct qg_dt {
	bool			esr_disable;
	bool			esr_discharge_enable;
	bool			qg_ext_sense;
	bool			use_s7_ocv;
};

struct qg_esr_data {
+5 −1
Original line number Diff line number Diff line
@@ -2919,7 +2919,9 @@ static int qg_set_wa_flags(struct qpnp_qg *chip)
{
	switch (chip->pmic_rev_id->pmic_subtype) {
	case PMI632_SUBTYPE:
		chip->wa_flags |= QG_RECHARGE_SOC_WA | QG_PON_OCV_WA;
		chip->wa_flags |= QG_RECHARGE_SOC_WA;
		if (!chip->dt.use_s7_ocv)
			chip->wa_flags |= QG_PON_OCV_WA;
		if (chip->pmic_rev_id->rev4 == PMI632_V1P0_REV4)
			chip->wa_flags |= QG_VBAT_LOW_WA;
		break;
@@ -3615,6 +3617,8 @@ static int qg_parse_dt(struct qpnp_qg *chip)

	chip->dt.qg_ext_sense = of_property_read_bool(node, "qcom,qg-ext-sns");

	chip->dt.use_s7_ocv = of_property_read_bool(node, "qcom,qg-use-s7-ocv");

	/* Capacity learning params*/
	if (!chip->dt.cl_disable) {
		chip->dt.cl_feedback_on = of_property_read_bool(node,