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

Commit 888ad48f authored by Sahil Chandna's avatar Sahil Chandna
Browse files

power: qpnp-fg-gen3: Enable voltage-mode correction saturation clear



As per the hardware recommendation enable the voltage-mode correction
saturation-clear config. This resets the voltage mode correction
and allows battery-SOC to be copied from CC-SOC.

Change-Id: Iea2becd7bcca004cc861fa488161a40cab29f114
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
Signed-off-by: default avatarSahil Chandna <chandna@codeaurora.org>
parent 83d88163
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -4325,6 +4325,7 @@ static const struct power_supply_desc fg_psy_desc = {

#define DEFAULT_ESR_CHG_TIMER_RETRY	8
#define DEFAULT_ESR_CHG_TIMER_MAX	16
#define VOLTAGE_MODE_SAT_CLEAR_BIT	BIT(3)
static int fg_hw_init(struct fg_chip *chip)
{
	int rc;
@@ -4548,6 +4549,14 @@ static int fg_hw_init(struct fg_chip *chip)
		return rc;
	}

	rc = fg_sram_masked_write(chip, ESR_EXTRACTION_ENABLE_WORD,
				ESR_EXTRACTION_ENABLE_OFFSET,
				VOLTAGE_MODE_SAT_CLEAR_BIT,
				VOLTAGE_MODE_SAT_CLEAR_BIT,
				FG_IMA_DEFAULT);
	if (rc < 0)
		return rc;

	fg_encode(chip->sp, FG_SRAM_ESR_TIGHT_FILTER,
		chip->dt.esr_tight_flt_upct, buf);
	rc = fg_sram_write(chip, chip->sp[FG_SRAM_ESR_TIGHT_FILTER].addr_word,