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

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

Merge "power: qpnp-qg: Update QG parameter reporting for debug_board"

parents e04f4992 90cad484
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -1540,8 +1540,6 @@ static int qg_get_learned_capacity(void *data, int64_t *learned_cap_uah)
	}
	*learned_cap_uah = cc_mah * 1000;

	qg_dbg(chip, QG_DEBUG_ALG_CL, "Retrieved learned capacity %llduah\n",
					*learned_cap_uah);
	return 0;
}

@@ -1577,6 +1575,11 @@ static int qg_get_cc_soc(void *data, int *cc_soc)
	if (!chip)
		return -ENODEV;

	if (is_debug_batt_id(chip) || chip->battery_missing) {
		*cc_soc = -EINVAL;
		return 0;
	}

	if (chip->cc_soc == INT_MIN)
		return -EINVAL;

@@ -1705,6 +1708,11 @@ static int qg_get_charge_counter(struct qpnp_qg *chip, int *charge_counter)
	int rc, cc_soc = 0;
	int64_t temp = 0;

	if (is_debug_batt_id(chip) || chip->battery_missing) {
		*charge_counter = -EINVAL;
		return 0;
	}

	rc = qg_get_learned_capacity(chip, &temp);
	if (rc < 0 || !temp)
		rc = qg_get_nominal_capacity((int *)&temp, 250, true);