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

Commit 49907a14 authored by Xiaozhe Shi's avatar Xiaozhe Shi
Browse files

power: qpnp-smbcharger: turn off AICL ADC measurements



The hardware AICL algorithm can use an internal ADC in order to jump to
the optimal AICL setpoint faster by doing a conversion when the collapse
happens and guessing the correct current limit from the data.

However, these ADC measurements can cause glitches in the AICL feature,
sometimes forcing the results to be 1-2 setpoints off from optimal.

Turn this feature off, and allow thet AICL algorithm to scan every
possible setpoint for a more accurate result.

CRs-Fixed: 920791
Change-Id: Ief47e8455bf89e8bd7703ec30e0fe3770b7895d6
Signed-off-by: default avatarXiaozhe Shi <xiaozhes@codeaurora.org>
parent 2972af72
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -6123,7 +6123,7 @@ static inline int get_bpd(const char *name)
#define APSD_RERUN_BIT			BIT(0)
#define OTG_OC_CFG			0xF1
#define HICCUP_ENABLED_BIT		BIT(6)

#define AICL_ADC_BIT			BIT(6)
static void batt_ov_wa_check(struct smbchg_chip *chip)
{
	int rc;
@@ -6523,6 +6523,13 @@ static int smbchg_hw_init(struct smbchg_chip *chip)
	if (chip->wa_flags & SMBCHG_BATT_OV_WA)
		batt_ov_wa_check(chip);

	/* turn off AICL adc for improved accuracy */
	rc = smbchg_sec_masked_write(chip,
		chip->misc_base + MISC_TRIM_OPT_15_8, AICL_ADC_BIT, 0);
	if (rc)
		pr_err("Couldn't write to MISC_TRIM_OPTIONS_15_8 rc=%d\n",
			rc);

	return rc;
}