Skip to content

Commit

Permalink
power: supply: sc27xx: Make sure the alarm capacity is larger than 0
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yuanjiang Yu authored and Sebastian Reichel committed Sep 2, 2019
1 parent 7384b0e commit ff062d0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/power/supply/sc27xx_fuel_gauge.c
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,8 @@ static int sc27xx_fgu_hw_init(struct sc27xx_fgu_data *data)
data->alarm_cap = power_supply_ocv2cap_simple(data->cap_table,
data->table_len,
data->min_volt);
if (!data->alarm_cap)
data->alarm_cap += 1;

power_supply_put_battery_info(data->battery, &info);

Expand Down

0 comments on commit ff062d0

Please sign in to comment.