Skip to content

Commit c58e9f6

Browse files
author
Shunqing Chen
committed
power: rk817-battery: fix ydsoc calculate error
ydsoc error can lead to charge or discharge become slow. Signed-off-by: Shunqing Chen <csq@rock-chips.com> Change-Id: Ie17f0064eda3723378f49caef08bca212c322d70
1 parent 8aa3680 commit c58e9f6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/power/rk817_battery.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2375,7 +2375,7 @@ static void rk817_bat_smooth_algorithm(struct rk817_battery_device *battery)
23752375
}
23762376

23772377
/* discharge: sm_linek < 0, if delate_cap <0, ydsoc > 0 */
2378-
ydsoc = battery->sm_linek * abs(delta_cap / DIV(battery->fcc)) / 10;
2378+
ydsoc = battery->sm_linek * abs(delta_cap / 10) / DIV(battery->fcc);
23792379

23802380
DBG("smooth: ydsoc = %d, fcc = %d\n", ydsoc, battery->fcc);
23812381
if (ydsoc == 0) {

0 commit comments

Comments
 (0)