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
This commit is contained in:
Shunqing Chen
2020-12-16 06:32:29 +00:00
committed by Tao Huang
parent d610b5b0ce
commit a59c01682e

View File

@@ -2424,7 +2424,7 @@ static void rk817_bat_smooth_algorithm(struct rk817_battery_device *battery)
}
/* discharge: sm_linek < 0, if delate_cap <0, ydsoc > 0 */
ydsoc = battery->sm_linek * abs(delta_cap / DIV(battery->fcc)) / 10;
ydsoc = battery->sm_linek * abs(delta_cap / 10) / DIV(battery->fcc);
DBG("smooth: ydsoc = %d, fcc = %d\n", ydsoc, battery->fcc);
if (ydsoc == 0) {