power: rk81x-battery: count all avaraible rsoc into calc
authorJianhong Chen <chenjh@rock-chips.com>
Tue, 16 Jun 2015 13:26:39 +0000 (21:26 +0800)
committer许盛飞 <xsf@rock-chips.com>
Wed, 17 Jun 2015 06:57:49 +0000 (14:57 +0800)
Signed-off-by: Jianhong Chen <chenjh@rock-chips.com>
drivers/power/rk818_battery.c

index 704a91f55822132b7c63fa25db7743cc48efa8ba..256eb44a7b392dc8ec77a6079f326a15653f5919 100755 (executable)
@@ -2452,7 +2452,7 @@ static void rk81x_bat_zero_calc_linek(struct rk81x_battery *di)
        rsoc = ocv_soc - dead_soc;
        if ((di->dsoc == 1) && (rsoc > 0)) {/*discharge*/
                di->line_k = 1000;
-       } else if (rsoc > 1) {
+       } else if (rsoc > 0) {
                di->line_k = (di->display_soc + rsoc / 2) / div(rsoc);
        } else {
                di->dsoc--;