power: pm8921-bms: remove SoC fluctuation during discharging

Calculated SoC could be fluctuated by system load. This patch
remove these fluctuation by using previous SoC if calculated Soc
is higher than previous value during discharging.

Change-Id: I1d144207125ed3c55030004fee1eb4b2489a298c
diff --git a/drivers/power/pm8921-bms.c b/drivers/power/pm8921-bms.c
index 6f9c460..e5ab5ec 100644
--- a/drivers/power/pm8921-bms.c
+++ b/drivers/power/pm8921-bms.c
@@ -2169,7 +2169,6 @@
 	struct pm8xxx_adc_chan_result result;
 	int batt_temp;
 	int rc;
-	int usb_chg = 0;
 
 	rc = pm8xxx_adc_read(the_chip->batt_temp_channel, &result);
 	if (rc) {
@@ -2223,10 +2222,9 @@
 			the_chip->catch_up_time_us = 0;
 	}
 
-	usb_chg = usb_chg_plugged_in();
-	usb_chg |= wireless_chg_plugged_in();
 	/* last_soc < soc  ... scale and catch up */
-	if (last_soc != -EINVAL && usb_chg != 0 && soc != 100)
+	if (last_soc != -EINVAL && soc != 100
+			&& (last_soc < soc || the_chip->start_percent != -EINVAL))
 		soc = scale_soc_while_chg(chip, delta_time_us, soc, last_soc);
 
 	if (chip->eoc_check_soc && is_eoc_adjust(chip, soc)) {