google_cpm: skip cp_fcc_hold_limit check when charging is stopped
When charging is stopped, it should not check the cp_fcc_hold_limit.
Because device should not charge in that condition.
Bug: 258323657
Change-Id: I186b5411f2a4ecd05822371940ea50b1ddea26a0
Signed-off-by: Wasb Liu <[email protected]>
diff --git a/google_cpm.c b/google_cpm.c
index ec0e68b..f88e0cc 100644
--- a/google_cpm.c
+++ b/google_cpm.c
@@ -811,7 +811,7 @@
* done holding a lock on &gcpm->chg_psy_lock (cc_max will become the
* same as gcpm->cp_fcc_hold_limit on exit).
*/
- if (gcpm->cp_fcc_hold && gcpm->cp_fcc_hold_limit >= 0) {
+ if (gcpm->cp_fcc_hold && gcpm->cp_fcc_hold_limit >= 0 && cc_max != 0) {
/*
* ->cp_fcc_hold is set when a thermal limit caused the switch
* from CP to main-charger. In this case ->cp_fcc_hold_limit