power: qpnp-fg-gen3: Disable ESR pulldown for debug battery id

Even with proper ESR pulse qualification threshold and ESR pulse
amplitude, ESR pulses are still seen occasionally on devices
that use battery with debug battery id. Disable ESR pulldown when
debug battery id is found. This helps saving power by stopping
ESR pulses.

Change-Id: I2b9588ec39a2268123d94c06517b0dbb43d66fc7
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
This commit is contained in:
Subbaraman Narayanamurthy 2017-05-05 14:07:53 -07:00
parent 8312e8d304
commit d2af865c75

View file

@ -3366,6 +3366,16 @@ static int fg_hw_init(struct fg_chip *chip)
return rc; return rc;
} }
if (is_debug_batt_id(chip)) {
val = ESR_NO_PULL_DOWN;
rc = fg_masked_write(chip, BATT_INFO_ESR_PULL_DN_CFG(chip),
ESR_PULL_DOWN_MODE_MASK, val);
if (rc < 0) {
pr_err("Error in writing esr_pull_down, rc=%d\n", rc);
return rc;
}
}
return 0; return 0;
} }