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

Commit 1444a8ea authored by Xiaozhe Shi's avatar Xiaozhe Shi
Browse files

power: qpnp-bms: fix coulomb counter selection



There is a bug in the BMS code right now where reading the coulomb
counter actually reads the shadow coulomb counter and vice versa. Fix
this by correctly specifying the coulomb counter to be read.

Change-Id: Ica703d1e426e595e9ff6cd9fc45bade743740238
Signed-off-by: default avatarXiaozhe Shi <xiaozhes@codeaurora.org>
parent 2f364fe0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1483,7 +1483,7 @@ static int get_prop_bms_charge_counter(struct qpnp_bms_chip *chip)

	mutex_lock(&chip->bms_output_lock);
	lock_output_data(chip);
	read_cc_raw(chip, &cc_raw, false);
	read_cc_raw(chip, &cc_raw, CC);
	unlock_output_data(chip);
	mutex_unlock(&chip->bms_output_lock);

@@ -1497,7 +1497,7 @@ static int get_prop_bms_charge_counter_shadow(struct qpnp_bms_chip *chip)

	mutex_lock(&chip->bms_output_lock);
	lock_output_data(chip);
	read_cc_raw(chip, &cc_raw, true);
	read_cc_raw(chip, &cc_raw, SHDW_CC);
	unlock_output_data(chip);
	mutex_unlock(&chip->bms_output_lock);