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

Commit c7ccce47 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "power: qpnp-qg: Do not round-up/down battery SOC in BASS"

parents 32b4e8e7 3e2306a7
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -332,14 +332,13 @@ static int qg_process_tcss_soc(struct qpnp_qg *chip, int sys_soc)
static int qg_process_bass_soc(struct qpnp_qg *chip, int sys_soc)
{
	int bass_soc = sys_soc, msoc = chip->msoc;
	int batt_soc = CAP(0, 100, DIV_ROUND_CLOSEST(chip->batt_soc, 100));

	if (!chip->dt.bass_enable && !(qg_ss_feature & QG_BASS))
		goto exit_soc_scale;

	qg_dbg(chip, QG_DEBUG_SOC, "BASS Entry: fifo_i=%d sys_soc=%d msoc=%d batt_soc=%d fvss_active=%d\n",
			chip->last_fifo_i_ua, sys_soc, msoc,
			batt_soc, chip->fvss_active);
			chip->batt_soc, chip->fvss_active);

	/* Skip BASS if FVSS is active */
	if (chip->fvss_active)
@@ -351,11 +350,11 @@ static int qg_process_bass_soc(struct qpnp_qg *chip, int sys_soc)

	if (!chip->bass_active) {
		chip->bass_active = true;
		chip->bsoc_bass_entry = batt_soc;
		chip->bsoc_bass_entry = chip->batt_soc;
	}

	/* Drop the sys_soc by 1% if batt_soc has dropped */
	if ((chip->bsoc_bass_entry - batt_soc) >= 1) {
	if ((chip->bsoc_bass_entry - chip->batt_soc) >= 100) {
		bass_soc = (msoc > 0) ? msoc - 1 : 0;
		chip->bass_active = false;
	}