Skip to content

Commit ff062d0

Browse files
Yuanjiang Yusre
authored andcommitted
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 <[email protected]> Signed-off-by: Baolin Wang <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 7384b0e commit ff062d0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/power/supply/sc27xx_fuel_gauge.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,8 @@ static int sc27xx_fgu_hw_init(struct sc27xx_fgu_data *data)
858858
data->alarm_cap = power_supply_ocv2cap_simple(data->cap_table,
859859
data->table_len,
860860
data->min_volt);
861+
if (!data->alarm_cap)
862+
data->alarm_cap += 1;
861863

862864
power_supply_put_battery_info(data->battery, &info);
863865

0 commit comments

Comments
 (0)