google_cpm: ensure the CC_MAX is voted in GCPM_FCC

Vote CC_MAX to GCPM_FCC when dc start/stop to ensure
the CC_MAX is voted when dc on.
This can avoid the GCPM_FCC set the current too high.

Bug: 259364732
Change-Id: I199f9f72b9a6d80ff5b170c1a9729b60e4cb46f7
Signed-off-by: Wasb Liu <[email protected]>
diff --git a/google_cpm.c b/google_cpm.c
index 5e61826..f621c0b 100644
--- a/google_cpm.c
+++ b/google_cpm.c
@@ -416,6 +416,11 @@
 	struct power_supply *chg_psy;
 	int ret;
 
+	ret = gcpm_update_gcpm_fcc(gcpm, "CC_MAX", gcpm->cc_max, false);
+	if (ret < 0)
+		pr_debug("PPS_DC: offline cannot update cp_fcc (%d)\n", ret);
+
+
 	chg_psy = gcpm_chg_get_charger(gcpm, index);
 	if (!chg_psy)
 		return 0;
@@ -702,6 +707,10 @@
 	if (ret < 0)
 		pr_debug("PPS_DC: start cannot update votes (%d)\n", ret);
 
+	ret = gcpm_update_gcpm_fcc(gcpm, "CC_MAX", gcpm->cc_max, true);
+	if (ret < 0)
+		pr_debug("PPS_DC: start cannot update cp_fcc (%d)\n", ret);
+
 	/* this is the CP */
 	dc_psy = gcpm_chg_get_active_cp(gcpm);
 	if (!dc_psy) {