Commit 3f95fa83 authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar
Browse files

power: pm8921-bms: lock/unlock BMS output registers



The BMS hardware has two sets of registers, shadow registers
which the hardware automatically updates and the output registers
which the software is supposed to read from.

Unless the bms output is locked, the output registers are updated
whenever the shadow registers are updated. If the software were
reading the output registers at the same time, corrupt values
will be read. Moreover the software expects the values to remain
intact while it is doing soc calculations - It reads multiple
registers like ocv, rbatt and cc for one soc calculations and
expects that these registers don't change.

The BMS hardware provides a bit (HOLD_OREG_DATA) where an update to
shadow register won't change the output registers. Set this bit before
reading from the BMS.

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