aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/battery/battery-factory.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/battery/battery-factory.c')
-rw-r--r--drivers/battery/battery-factory.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/battery/battery-factory.c b/drivers/battery/battery-factory.c
index c1cd9b1..0f20fed 100644
--- a/drivers/battery/battery-factory.c
+++ b/drivers/battery/battery-factory.c
@@ -121,6 +121,9 @@ static ssize_t factory_show_property(struct device *dev,
int i;
int cnt, dat, d_max, d_min, d_total;
int val;
+#if defined(CONFIG_MACH_KONA)
+ int comp1, comp3;
+#endif
const ptrdiff_t off = attr - factory_attrs;
pr_debug("%s: %s\n", __func__, factory_attrs[off].attr.name);
@@ -149,10 +152,16 @@ static ssize_t factory_show_property(struct device *dev,
val = 0;
for (cnt = 0; cnt < CNT_TEMPER_AVG; cnt++) {
msleep(100);
+#if defined(CONFIG_MACH_KONA)
+ info->battery_temper_adc = battery_get_info(info,
+ POWER_SUPPLY_PROP_TEMP);
+#else
battery_get_info(info, POWER_SUPPLY_PROP_TEMP);
+#endif
val += info->battery_temper_adc;
info->battery_temper_adc_avg = val / (cnt + 1);
}
+#if !defined(CONFIG_MACH_KONA)
#ifdef CONFIG_S3C_ADC
info->battery_temper_avg = info->pdata->covert_adc(
info->battery_temper_adc_avg,
@@ -160,6 +169,10 @@ static ssize_t factory_show_property(struct device *dev,
#else
info->battery_temper_avg = info->battery_temper;
#endif
+#else
+ info->battery_temper_avg = info->battery_temper_adc_avg;
+#endif
+
val = info->battery_temper_avg;
pr_info("%s: temper avg(%d)\n", __func__, val);
i += scnprintf(buf + i, PAGE_SIZE - i, "%d\n", val);
@@ -185,6 +198,9 @@ static ssize_t factory_show_property(struct device *dev,
d_total += dat;
}
val = (d_total - d_max - d_min) / (CNT_VOLTAGE_AVG - 2);
+#if defined(CONFIG_MACH_KONA)
+ val /= 1000;
+#endif
pr_info("%s: voltage avg(%d)\n", __func__, val);
i += scnprintf(buf + i, PAGE_SIZE - i, "%d\n", val);
break;
@@ -242,8 +258,28 @@ static ssize_t factory_show_property(struct device *dev,
i += scnprintf(buf + i, PAGE_SIZE - i, "%d\n", val);
break;
case BATT_VOL_ADC:
+ i += scnprintf(buf + i, PAGE_SIZE - i, "N/A\n");
+ break;
case BATT_VOL_ADC_CAL:
+#if defined(CONFIG_MACH_KONA)
+ /* For using compensation 1% value */
+ comp1 = info->is_comp_1;
+ i += scnprintf(buf + i, PAGE_SIZE - i, "%d\n", comp1);
+ break;
+#else
+ i += scnprintf(buf + i, PAGE_SIZE - i, "N/A\n");
+ break;
+#endif
case BATT_VOL_ADC_AVER:
+#if defined(CONFIG_MACH_KONA)
+ /* For using compensation 3% value */
+ comp3 = info->is_comp_3;
+ i += scnprintf(buf + i, PAGE_SIZE - i, "%d\n", comp3);
+ break;
+#else
+ i += scnprintf(buf + i, PAGE_SIZE - i, "N/A\n");
+ break;
+#endif
case BATT_TEMP_ADC_CAL:
case AUTH_BATTERY:
i += scnprintf(buf + i, PAGE_SIZE - i, "N/A\n");