power: pm8921-bms: refactor BMS driver code
- the spin_lock only needs to be held while reading from the BMS hardware,
the current code holds it for reading and calculating values from it. Fix
this by creating a function to read values and hold the spinlock around it.
The values are read in a structure which is passed around for further
calculations
- as a result of above change the read_xxxx functions reduce to
convert_xxxx functions. They now convert the raw values to physical
units and don't read it from hardware directly.
- there was a logical and for checking the oreg_hold bit. It should be a
bitwise and.
- since the driver is reading the soc parameters only at one place
with the OREG_HOLD bit set remove the check for oreg_hold while
reading individual parameters
Change-Id: I206d116b2a68fc31d027607d3542a5ac6b5b4439
Signed-off-by:
Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Loading
Please sign in to comment