Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

power: supply: sc27xx: Make sure the alarm capacity is larger than 0

We must make sure the alarm capacity is larger than 0, to help to
calibrate the low battery capacity.

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>

authored by

Yuanjiang Yu and committed by
Sebastian Reichel
ff062d06 7384b0e7

+2
+2
drivers/power/supply/sc27xx_fuel_gauge.c
··· 858 858 data->alarm_cap = power_supply_ocv2cap_simple(data->cap_table, 859 859 data->table_len, 860 860 data->min_volt); 861 + if (!data->alarm_cap) 862 + data->alarm_cap += 1; 861 863 862 864 power_supply_put_battery_info(data->battery, &info); 863 865