power: pm8921-bms: detect power supply

When the state of charge (SOC) falls below 10% make sure that the
battery voltage too has fallen. If the battery voltage stays high
it means that the device is powered using a fake battery/power
supply.

Report a default soc to the userspace to avoid shutdowns due to a
low SOC.

CRs-Fixed: 309411
Change-Id: Ibd5e76cf7ed926722290840140fde4c592700eba
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
1 file changed