google_battery: charge speed while in taper
Charging speed while in taper is 100% since the limiting factor
is the battery (assumes that we will NOT enter taper when the
device is input limited)
Bug: 230510913
Signed-off-by: AleX Pelosi <[email protected]>
Change-Id: I370b346791aad77e815be8ec18075d80d854b9ed
diff --git a/google_battery.c b/google_battery.c
index 43d76ca..f957eb5 100644
--- a/google_battery.c
+++ b/google_battery.c
@@ -2447,6 +2447,7 @@
{
const struct gbms_chg_profile *profile = &batt_drv->chg_profile;
const int soc = ssoc_get_capacity(&batt_drv->ssoc_state);
+ const int chg_type = batt_drv->chg_state.f.chg_type;
int cc_max, vbatt_idx, ibatt, nominal_demand;
int chg_speed = -1;
@@ -2456,6 +2457,10 @@
if (batt_drv->fake_charging_speed)
return batt_drv->fake_charging_speed;
+ /* if the battery is the limit, speed is 100% */
+ if (chg_type == POWER_SUPPLY_CHARGE_TYPE_TAPER)
+ return 100;
+
/* Get average current via tiers. */
vbatt_idx = ttf_pwr_vtier_idx(&batt_drv->ttf_stats, soc);