Commit da8c3d51 authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar
Browse files

power: pm8921-bms: Fix coulomb counter overflow



The coulomb counter in hardware is 32bits and is signed. The software
also adds a 32bit value (the cc reading when end of charge happened).
This addition might cause the value of the coulomb counter to overflow.

Fix it by switching to 64bit values before adding to it.

CRs-Fixed: 328352
Change-Id: Ic8268014fccca00acd03b0693896ab494fe94d87
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent 986bd8a2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment