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

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

power: qpnp-fg-gen3: Add a DT property to disable ESR PULL_DN



For power / debug measurements add a DT property to disable
ESR PULL_DN.

Change-Id: Ib3992cdf74fd4ddc09ab6809a3fb9713daa8c84a
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent f67e399a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -464,6 +464,12 @@ First Level Node - FG Gen3 device
	Definition: A boolean property when defined uses software based
		    ESR during charging.

- qcom,fg-disable-esr-pull-dn
	Usage:      optional
	Value type: <empty>
	Definition: A boolean property which disables ESR pull-down.
		    This is to be used for debug purposes only.

==========================================================
Second Level Nodes - Peripherals managed by FG Gen3 driver
==========================================================
+1 −0
Original line number Diff line number Diff line
@@ -282,6 +282,7 @@ struct fg_dt_props {
	bool	linearize_soc;
	bool	auto_recharge_soc;
	bool	use_esr_sw;
	bool	disable_esr_pull_dn;
	int	cutoff_volt_mv;
	int	empty_volt_mv;
	int	vbatt_low_thr_mv;
+4 −1
Original line number Diff line number Diff line
@@ -4539,7 +4539,7 @@ static int fg_hw_init(struct fg_chip *chip)
		return rc;
	}

	if (is_debug_batt_id(chip)) {
	if (is_debug_batt_id(chip) || chip->dt.disable_esr_pull_dn) {
		val = ESR_NO_PULL_DOWN;
		rc = fg_masked_write(chip, BATT_INFO_ESR_PULL_DN_CFG(chip),
			ESR_PULL_DOWN_MODE_MASK, val);
@@ -5514,6 +5514,9 @@ static int fg_parse_dt(struct fg_chip *chip)

	chip->dt.use_esr_sw = of_property_read_bool(node, "qcom,fg-use-sw-esr");

	chip->dt.disable_esr_pull_dn = of_property_read_bool(node,
					"qcom,fg-disable-esr-pull-dn");

	return 0;
}