google_cpm: don't update fcc by DC_FCC when device is not in DC
Don't vote fcc by DC_FCC when dc_index is GCPM_DEFAULT_CHARGER or
GCPM_INDEX_DC_DISABLE.
Bug: 239874154
Signed-off-by: Wasb Liu <[email protected]>
Change-Id: Ie5836da5e2e6060243a4e512ec51b4ff14f0a05a
(cherry picked from commit 8e2ddbd91ba4bbd2b3defc4654fd4511589bbcff)
diff --git a/google_cpm.c b/google_cpm.c
index e89c554..9d10bb2 100644
--- a/google_cpm.c
+++ b/google_cpm.c
@@ -602,7 +602,8 @@
goto error_exit;
/* apply/enable DC_FCC only when a WLC_DC source is selected */
- if (gcpm->pps_index != PPS_INDEX_WLC || limit < 0)
+ if ((gcpm->pps_index != PPS_INDEX_WLC) ||
+ (gcpm->dc_index <= GCPM_DEFAULT_CHARGER) || limit < 0)
limit = -1;
/*