power: Add early battery capacity and voltage snapshot recording
If the battery gauge gets incorrect readings for capacity as 0
even for an instant soon after the kernel bootup, the board will
incorrectly shut down reporting low battery though there is
sufficient juice in the battery. Hence, if there is even a slight
delay in correct battery capacity reporting by fuel gauge due to chip
problem or coding error, this can lead to the board incorrectly
shutting down as for an instant, the android framework will read the
capacity as 0. Hence, adding support for recording an early snapshot
value of capacity and voltage values and making these early snapshots
available through sysfs entries, so that appropriate sanity tests
can examine these values and flag an error if early capacity snapshot
value is 0.
Bug
1291416
Change-Id: I1be86b23bdc247d7c1bfd8230e433345e026cba8
Signed-off-by: darbha sriharsha <dsriharsha@nvidia.com>
Reviewed-on: http://git-master/r/349431
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>