power: pm8921-bms: report higher soc even when called within a second
The current code puts a restriction in the charger scaling algorithm
that state of charge (soc) should be called after a second. If it is
called earlier, simply report the previous soc.
There are user space applications that call soc every few milliseconds.
The soc appears stuck for such applications.
Remove that restriction.
Change-Id: I22d2dbdae5c9c859d4baca2bdb7bea71da09b85b
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
diff --git a/drivers/power/pm8921-bms.c b/drivers/power/pm8921-bms.c
index 42067b2..5875ec1 100644
--- a/drivers/power/pm8921-bms.c
+++ b/drivers/power/pm8921-bms.c
@@ -1874,10 +1874,6 @@
if (the_chip->start_percent == -EINVAL)
return prev_soc;
- /* if soc is called in quick succession return the last soc */
- if (delta_time_us < USEC_PER_SEC)
- return prev_soc;
-
chg_time_sec = DIV_ROUND_UP(the_chip->charge_time_us, USEC_PER_SEC);
catch_up_sec = DIV_ROUND_UP(the_chip->catch_up_time_us, USEC_PER_SEC);
pr_debug("cts= %d catch_up_sec = %d\n", chg_time_sec, catch_up_sec);