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

Commit b7bfc92e authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "power: qpnp-fg-gen3: Get the raw MSOC directly from FG register"

parents 99c02045 128392df
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1721,12 +1721,12 @@ static int fg_charge_full_update(struct fg_chip *chip)

	/* We need 2 most significant bytes here */
	bsoc = (u32)bsoc >> 16;
	rc = fg_get_msoc(chip, &msoc);
	rc = fg_get_msoc_raw(chip, &msoc_raw);
	if (rc < 0) {
		pr_err("Error in getting msoc, rc=%d\n", rc);
		pr_err("Error in getting msoc_raw, rc=%d\n", rc);
		goto out;
	}
	msoc_raw = DIV_ROUND_CLOSEST(msoc * FULL_SOC_RAW, FULL_CAPACITY);
	msoc = DIV_ROUND_CLOSEST(msoc_raw * FULL_CAPACITY, FULL_SOC_RAW);

	fg_dbg(chip, FG_STATUS, "msoc: %d bsoc: %x health: %d status: %d full: %d\n",
		msoc, bsoc, chip->health, chip->charge_status,