Revert "pm8xxx-adc: add the functions to set tuning parameters"

This reverts commit b19ebbc8e9ae70752e7e03b345d8a480b9ca8afa.

Change-Id: Idf994d04e69387a4e86c28e97e3ee5be80bcbd93
Signed-off-by: Uma Maheshwari Bhiram <ubhira@codeaurora.org>
diff --git a/drivers/hwmon/pm8xxx-adc-scale.c b/drivers/hwmon/pm8xxx-adc-scale.c
index 844a02a..4a1f58c 100644
--- a/drivers/hwmon/pm8xxx-adc-scale.c
+++ b/drivers/hwmon/pm8xxx-adc-scale.c
@@ -25,7 +25,7 @@
    and provided to the battery driver in the units desired for
    their framework which is 0.1DegC. True resolution of 0.1DegC
    will result in the below table size to increase by 10 times */
-static struct pm8xxx_adc_map_pt def_adcmap_btm_threshold[] = {
+static const struct pm8xxx_adc_map_pt adcmap_btm_threshold[] = {
 	{-300,	1642},
 	{-200,	1544},
 	{-100,	1414},
@@ -111,7 +111,7 @@
 	{790,	203}
 };
 
-static struct pm8xxx_adc_map_pt def_adcmap_pa_therm[] = {
+static const struct pm8xxx_adc_map_pt adcmap_pa_therm[] = {
 	{1731,	-30},
 	{1726,	-29},
 	{1721,	-28},
@@ -270,7 +270,7 @@
 	{49,	125}
 };
 
-static struct pm8xxx_adc_map_pt def_adcmap_ntcg_104ef_104fb[] = {
+static const struct pm8xxx_adc_map_pt adcmap_ntcg_104ef_104fb[] = {
 	{696483,	-40960},
 	{649148,	-39936},
 	{605368,	-38912},
@@ -439,40 +439,6 @@
 	{419,		128000}
 };
 
-static struct pm8xxx_adc_map adcmap_btm_threshold = {
-	.pt = def_adcmap_btm_threshold,
-	.size = ARRAY_SIZE(def_adcmap_btm_threshold),
-};
-static struct pm8xxx_adc_map adcmap_pa_therm = {
-	.pt = def_adcmap_pa_therm,
-	.size = ARRAY_SIZE(def_adcmap_pa_therm),
-};
-static struct pm8xxx_adc_map adcmap_ntcg_104ef_104fb = {
-	.pt = def_adcmap_ntcg_104ef_104fb,
-	.size = ARRAY_SIZE(def_adcmap_ntcg_104ef_104fb),
-};
-
-void pm8xxx_set_adcmap_btm_threshold(void *pts, int size)
-{
-	adcmap_btm_threshold.pt = pts;
-	adcmap_btm_threshold.size = size;
-}
-EXPORT_SYMBOL(pm8xxx_set_adcmap_btm_threshold);
-
-void pm8xxx_set_adcmap_pa_therm(void *pts, int size)
-{
-	adcmap_pa_therm.pt = pts;
-	adcmap_pa_therm.size = size;
-}
-EXPORT_SYMBOL(pm8xxx_set_adcmap_pa_therm);
-
-void pm8xxx_set_adcmap_ntcg_104ef_104fb(void *pts, int size)
-{
-	adcmap_ntcg_104ef_104fb.pt = pts;
-	adcmap_ntcg_104ef_104fb.size = size;
-}
-EXPORT_SYMBOL(pm8xxx_set_adcmap_ntcg_104ef_104fb);
-
 static int32_t pm8xxx_adc_map_linear(const struct pm8xxx_adc_map_pt *pts,
 		uint32_t tablesize, int32_t input, int64_t *output)
 {
@@ -656,8 +622,8 @@
 			adc_properties, chan_properties);
 
 	return pm8xxx_adc_map_batt_therm(
-			adcmap_btm_threshold.pt,
-			adcmap_btm_threshold.size,
+			adcmap_btm_threshold,
+			ARRAY_SIZE(adcmap_btm_threshold),
 			bat_voltage,
 			&adc_chan_result->physical);
 }
@@ -674,8 +640,8 @@
 			adc_properties, chan_properties);
 
 	return pm8xxx_adc_map_linear(
-			adcmap_pa_therm.pt,
-			adcmap_pa_therm.size,
+			adcmap_pa_therm,
+			ARRAY_SIZE(adcmap_pa_therm),
 			pa_voltage,
 			&adc_chan_result->physical);
 }
@@ -759,8 +725,8 @@
 	xo_thm = pm8xxx_adc_scale_ratiometric_calib(adc_code,
 			adc_properties, chan_properties);
 	xo_thm <<= 4;
-	pm8xxx_adc_map_linear(adcmap_ntcg_104ef_104fb.pt,
-		adcmap_ntcg_104ef_104fb.size,
+	pm8xxx_adc_map_linear(adcmap_ntcg_104ef_104fb,
+		ARRAY_SIZE(adcmap_ntcg_104ef_104fb),
 		xo_thm, &adc_chan_result->physical);
 
 	return 0;
@@ -774,8 +740,8 @@
 	int rc;
 
 	rc = pm8xxx_adc_map_linear(
-		adcmap_btm_threshold.pt,
-		adcmap_btm_threshold.size,
+		adcmap_btm_threshold,
+		ARRAY_SIZE(adcmap_btm_threshold),
 		(btm_param->low_thr_temp),
 		&btm_param->low_thr_voltage);
 	if (rc)
@@ -788,8 +754,8 @@
 		chan_properties->adc_graph[ADC_CALIB_RATIOMETRIC].adc_gnd;
 
 	rc = pm8xxx_adc_map_linear(
-		adcmap_btm_threshold.pt,
-		adcmap_btm_threshold.size,
+		adcmap_btm_threshold,
+		ARRAY_SIZE(adcmap_btm_threshold),
 		(btm_param->high_thr_temp),
 		&btm_param->high_thr_voltage);
 	if (rc)
diff --git a/include/linux/mfd/pm8xxx/pm8xxx-adc.h b/include/linux/mfd/pm8xxx/pm8xxx-adc.h
index 2727d9c..84f8e03 100644
--- a/include/linux/mfd/pm8xxx/pm8xxx-adc.h
+++ b/include/linux/mfd/pm8xxx/pm8xxx-adc.h
@@ -248,16 +248,6 @@
 };
 
 /**
- * struct pm8xxx_adc_map - container of pm8xxx_adc_map_pt
- * @pt: pointer of pm8xxx_adc_map_pt
- * @size: size of pm8xxx_adc_map_pt
- */
-struct pm8xxx_adc_map {
-	struct pm8xxx_adc_map_pt *pt;
-	int size;
-};
-
-/**
  * struct pm8xxx_adc_scaling_ratio - Represent scaling ratio for adc input
  * @num: Numerator scaling parameter
  * @den: Denominator scaling parameter
@@ -594,21 +584,6 @@
  *			events are triggered.
  */
 uint32_t pm8xxx_adc_btm_configure(struct pm8xxx_adc_arb_btm_param *);
-
-/**
- * pm8xxx_set_adcmap_btm_threshold()
- */
-void pm8xxx_set_adcmap_btm_threshold(void *pts, int size);
-
-/**
- * pm8xxx_set_adcmap_pa_therm()
- */
-void pm8xxx_set_adcmap_pa_therm(void *pts, int size);
-
-/**
- * pm8xxx_st_adcmap_ntcg_104ef_104fb()
- */
-void pm8xxx_set_adcmap_ntcg_104ef_104fb(void *pts, int size);
 #else
 static inline uint32_t pm8xxx_adc_read(uint32_t channel,
 				struct pm8xxx_adc_chan_result *result)
@@ -624,9 +599,6 @@
 static inline uint32_t pm8xxx_adc_btm_configure(
 		struct pm8xxx_adc_arb_btm_param *param)
 { return -ENXIO; }
-static inline void pm8xxx_set_adcmap_btm_threshold(void) { }
-static inline void pm8xxx_set_adcmap_pa_therm(void) { }
-static inline void pm8xxx_set_adcmap_ntcg_104ef_104fb(void) { }
 #endif
 
 #endif /* PM8XXX_ADC_H */