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

Skip to content
Commit 88fe9c74 authored by Xiaozhe Shi's avatar Xiaozhe Shi Committed by Stephen Boyd
Browse files

power: qpnp-bms: Fix overflow issues with battery current



Currently, the battery current is being supplied by the VSENSE_AVG
register of the BMS. This is provided as a 16 bit signed integer.
However, while converting the integer to microvolts, there could be
an overflow, causing the battery current's polarity to be wrong.

Fix this issue by converting the reading into a 64 bit signed integer
before doing the conversion.

CRs-Fixed: 479213
Change-Id: Ibebde59706c201f3c4d947817f2702a1f3c688d6
Signed-off-by: default avatarXiaozhe Shi <xiaozhes@codeaurora.org>
parent 1a144418
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