power: supply: sc27xx: Optimize the battery capacity calibration
authorYuanjiang Yu <yuanjiang.yu@unisoc.com>
Wed, 31 Jul 2019 10:00:26 +0000 (18:00 +0800)
committerSebastian Reichel <sre@kernel.org>
Mon, 2 Sep 2019 20:59:50 +0000 (22:59 +0200)
commit580665279fb6a16eb119ec80a5be1b3ec7a641a0
treebe9a721e6da270f8237e336c612a4998a74b658e
parentff062d06948c012cbfd6f5947b599be5ea1c3799
power: supply: sc27xx: Optimize the battery capacity calibration

This patch factors out the capacity calibration into one single function
to calibrate the battery capacity, and adding more abnormal cases to
calibrate the capacity when the OCV value is not matchable with current
capacity.

Moreover we also allow to calibrate the capacity when charger magager
tries to get current capacity to make sure we give a correct capacity
for userspace.

Signed-off-by: Yuanjiang Yu <yuanjiang.yu@unisoc.com>
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/sc27xx_fuel_gauge.c