Merge android13-gs-pixel-5.10-tm-qpr2 into android13-gs-pixel-5.10-tm-qpr3

SBMerger: 478053055
Change-Id: I931784441110af79f88493075abcd227726fc149
Signed-off-by: SecurityBot <[email protected]>
diff --git a/google_battery.c b/google_battery.c
index 4e405a1..6489ce3 100644
--- a/google_battery.c
+++ b/google_battery.c
@@ -8654,9 +8654,6 @@
 		pr_info("google,batt-vs-tz-name is %s\n", batt_vs_tz_name);
 	}
 
-	/* debugfs */
-	(void)batt_init_debugfs(batt_drv);
-
 	/* single battery disconnect */
 	(void)batt_bpst_init_debugfs(batt_drv);
 
@@ -8876,6 +8873,9 @@
 	batt_init_fs(batt_drv);
 	batt_bpst_init_fs(batt_drv);
 
+	/* debugfs */
+	(void)batt_init_debugfs(batt_drv);
+
 	/* give time to fg driver to start */
 	schedule_delayed_work(&batt_drv->init_work,
 					msecs_to_jiffies(BATT_DELAY_INIT_MS));
diff --git a/max1720x_battery.c b/max1720x_battery.c
index 0a5bcfe..5d17030 100644
--- a/max1720x_battery.c
+++ b/max1720x_battery.c
@@ -1457,14 +1457,7 @@
 	if ((filtercfg_val != filtercfg->curr_val) &&
 	    (filtercfg->curr_val == 0 || temp < filtercfg->temp ||
 	     temp >= hysteresis_temp)) {
-		struct max17x0x_regmap *regmap;
-
-		if (chip->gauge_type == MAX_M5_GAUGE_TYPE)
-			regmap = &chip->regmap;
-		else
-			regmap = &chip->regmap_nvram;
-
-		REGMAP_WRITE(regmap, MAX1720X_FILTERCFG, filtercfg_val);
+		REGMAP_WRITE(&chip->regmap, MAX1720X_FILTERCFG, filtercfg_val);
 		dev_info(chip->dev, "updating filtercfg to 0x%04x as temp is %d\n",
 			 filtercfg_val, temp);
 		filtercfg->curr_val = filtercfg_val;
@@ -2545,7 +2538,7 @@
 {
 	u16 data, repsoc, vfsoc, avcap, repcap, fullcap, fullcaprep;
 	u16 fullcapnom, qh0, qh, dqacc, dpacc, qresidual, fstat;
-	u16 learncfg, tempco;
+	u16 learncfg, tempco, filtercfg;
 	int ret = 0, charge_counter = -1;
 
 	ret = REGMAP_READ(&chip->regmap, MAX1720X_REPSOC, &data);
@@ -2612,13 +2605,17 @@
 	if (ret < 0)
 		return ret;
 
+	ret = REGMAP_READ(&chip->regmap, MAX1720X_FILTERCFG, &filtercfg);
+	if (ret < 0)
+		return ret;
+
 	ret = max1720x_update_battery_qh_based_capacity(chip);
 	if (ret == 0)
 		charge_counter = reg_to_capacity_uah(chip->current_capacity, chip);
 
 	gbms_logbuffer_prlog(chip->monitor_log, LOGLEVEL_INFO, 0, LOGLEVEL_INFO,
 			     "%s %02X:%04X %02X:%04X %02X:%04X %02X:%04X %02X:%04X"
-			     " %02X:%04X %02X:%04X %02X:%04X %02X:%04X %02X:%04X"
+			     " %02X:%04X %02X:%04X %02X:%04X %02X:%04X %02X:%04X %02X:%04X"
 			     " %02X:%04X %02X:%04X %02X:%04X %02X:%04X %02X:%04X CC:%d",
 			     chip->max1720x_psy_desc.name, MAX1720X_REPSOC, data, MAX1720X_VFSOC,
 			     vfsoc, MAX1720X_AVCAP, avcap, MAX1720X_REPCAP, repcap,
@@ -2627,7 +2624,7 @@
 			     MAX1720X_QH, qh, MAX1720X_DQACC, dqacc, MAX1720X_DPACC, dpacc,
 			     MAX1720X_QRESIDUAL, qresidual, MAX1720X_FSTAT, fstat,
 			     MAX1720X_LEARNCFG, learncfg, MAX1720X_TEMPCO, tempco,
-			     charge_counter);
+			     MAX1720X_FILTERCFG, filtercfg, charge_counter);
 
 	chip->pre_repsoc = repsoc;