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

Commit 4a9d84bf authored by Shiju Mathew's avatar Shiju Mathew Committed by Jeff Bernard
Browse files

power: bcl_peripheral: Update ibat and vbat formula



Update the formula to calculate ibat and vbat. This
was required since the threshold was trigger by an
offset of 200 mV to 300 mV. Basically improve the
accuracy by 200-300mV. Below is the new calculation.

vbat = (vbat_raw * 39000) * (100 + v_gain * 32 / 128) / 100
vbat_raw = (vbat * 100 / ( 100 + v_gain * 32 / 128 )) / 39000

ibat = (ibat_raw * 39000 + i_offset *  1200) *
	(100 + i_gain * 32 / 128) / 100
ibat_raw = (ibat * 100 / ( 100 + i_gain * 32 / 128 ) -
	 i_offset * 1200) / 39000

Change-Id: I7af772e20de09b9a0767d217c0424be9a75d89c4
Signed-off-by: default avatarShiju Mathew <shijum@codeaurora.org>
parent dd876531
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment