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

Skip to content
Commit 25ca2ccf authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar Committed by Stephen Boyd
Browse files

hwmon: qpnp-current: specify batfet status while calibrating



For internal Rsense or external Rsense, when current is requested by
BMS while battery fet (BATFET) is open, IADC switches to channel 5
even though channel 0 or channel 1 was requested. This is done so that
it returns the same value as offset calibration would have returned
resulting in 0mA of current.

This is okay for external Rsense since offset calibrations are done on
channel 5 which measures across same pins as those used for current
readings.

However this results in incorrect offset values for internal Rsense
because the offset calibrations happens on channel 6 which uses
different pins than channel 5.

Update the code to specify whether a calibration is being requested
while the battery fet is open. If it is open then use channel 5 for offset
calculations even when internal Rsense is used.

Change-Id: I1b36ea1d5dd078b177d6c5a92d7c49e8402c36dc
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent 0ed4075c
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