pca9468_charger: add debugfs node to adjust ta_max_vol

Add debugfs node to adjust ta_max_vol for test purpose

Bug: 224705785
Change-Id: If68d38a102794b1b4144b4a463aa09181522ac24
Signed-off-by: Wasb Liu <[email protected]>
diff --git a/pca9468_charger.c b/pca9468_charger.c
index faec7ad..668d4bc 100644
--- a/pca9468_charger.c
+++ b/pca9468_charger.c
@@ -4837,6 +4837,28 @@
 DEFINE_SIMPLE_ATTRIBUTE(debug_pps_index_ops, debug_pps_index_get,
 			debug_pps_index_set, "%llu\n");
 
+static int debug_ta_max_vol_set(void *data, u64 val)
+{
+	struct pca9468_charger *pca9468 = data;
+
+	pca9468->pdata->ta_max_vol = val;
+	pca9468->pdata->ta_max_vol_cp = val;
+
+	pca9468->ta_max_vol = val * pca9468->chg_mode;
+
+	return 0;
+}
+
+static int debug_ta_max_vol_get(void *data, u64 *val)
+{
+	struct pca9468_charger *pca9468 = data;
+
+	*val = pca9468->pdata->ta_max_vol;
+	return 0;
+}
+DEFINE_SIMPLE_ATTRIBUTE(debug_ta_max_vol_ops, debug_ta_max_vol_get,
+			debug_ta_max_vol_set, "%llu\n");
+
 static ssize_t show_sts_ab(struct device *dev, struct device_attribute *attr, char *buf)
 {
 	struct pca9468_charger *pca9468 = dev_get_drvdata(dev);
@@ -4967,6 +4989,9 @@
 	debugfs_create_file("apply_offsets", 0644, chip->debug_root, chip,
 			    &apply_offsets_debug_ops);
 
+	debugfs_create_file("ta_vol_max", 0644, chip->debug_root, chip,
+			   &debug_ta_max_vol_ops);
+
 	chip->debug_adc_channel = ADCCH_VOUT;
 	debugfs_create_file("adc_chan", 0644, chip->debug_root, chip,
 			    &debug_adc_chan_ops);