summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorPankaj Mistry <pankaj.mistry@intel.com>2012-05-11 20:22:54 +0530
committerbuildbot <buildbot@intel.com>2012-05-16 02:33:08 -0700
commit3a1569350a2bb4e35584854ffa7f098a53d4fdc4 (patch)
tree2d12094db383a7f8bbdb642551cc0b132bf68232 /arch
parentca6f050eff3f12d15d071a4ca385bcaca40cf88c (diff)
downloadkernel-mfld-blackbay-3a1569350a2bb4e35584854ffa7f098a53d4fdc4.tar.gz
kernel-mfld-blackbay-3a1569350a2bb4e35584854ffa7f098a53d4fdc4.tar.bz2
kernel-mfld-blackbay-3a1569350a2bb4e35584854ffa7f098a53d4fdc4.zip
EM/Battery: Enable temperature based charging use case on clovertrail.
BZ: 34235 This patch adds temprature based charging and extreme charging use-cases. As part of the patch following has been added: 1. existing worker thread bq24192_maintenance_worker, tempearture based charging capability 2. SFI table parsing for battery properties 3. Extreme charging capability via sysfs interface 4. Temperature reading capability via ADC Change-Id: I207f71a620065655906e49e3783f5e910a5fa6b8 Signed-off-by: Pankaj Mistry <pankaj.mistry@intel.com> Reviewed-on: http://android.intel.com:8080/46949 Reviewed-by: Tc, Jenny <jenny.tc@intel.com> Reviewed-by: Pandey, Raj <raj.pandey@intel.com> Reviewed-by: Prasad, Lakshmi G <lakshmi.g.prasad@intel.com> Reviewed-by: Koskinen, Ilkka <ilkka.koskinen@intel.com> Tested-by: Kallappa Manjanna, MadhukumarX <madhukumarx.kallappa.manjanna@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/platform/intel-mid/device_libs/platform_bq24192.c43
-rw-r--r--arch/x86/platform/intel-mid/device_libs/platform_max17042.c3
2 files changed, 40 insertions, 6 deletions
diff --git a/arch/x86/platform/intel-mid/device_libs/platform_bq24192.c b/arch/x86/platform/intel-mid/device_libs/platform_bq24192.c
index 00984b5207c..e17123dd387 100644
--- a/arch/x86/platform/intel-mid/device_libs/platform_bq24192.c
+++ b/arch/x86/platform/intel-mid/device_libs/platform_bq24192.c
@@ -35,12 +35,45 @@ void *bq24192_platform_data(void *info)
platform_data.sfi_tabl_present = true;
else
platform_data.sfi_tabl_present = false;
- platform_data.vHigh = 4176;
- platform_data.vLow = 4076;
- platform_data.fc_dcp_curr = 1500;
- platform_data.fc_sdp_curr = 500;
- platform_data.maint_chrg_curr = 500;
+ /* FIXME: Curren IFW has bug where OEM0 block exists but parameters
+ * are all invalid hence overriding the parameter to false and
+ * and will be remove once IFW has hte corretc support */
platform_data.sfi_tabl_present = false;
+
+ /* define the temperature ranges. These values are currently hardcoded
+ * based upon medfield values and will change as per battery prop.
+ * For final solution these must get populated in sfi table.
+ */
+ platform_data.temp_mon_ranges = 4;
+ platform_data.temp_mon_range[0].temp_up_lim = 60;
+ platform_data.temp_mon_range[0].full_chrg_vol = 4100;
+ platform_data.temp_mon_range[0].full_chrg_cur = 1500;
+ platform_data.temp_mon_range[0].maint_chrg_vol_ll = 4000;
+ platform_data.temp_mon_range[0].maint_chrg_vol_ul = 4050;
+ platform_data.temp_mon_range[0].maint_chrg_cur = 950;
+
+ platform_data.temp_mon_range[1].temp_up_lim = 45;
+ platform_data.temp_mon_range[1].full_chrg_vol = 4200;
+ platform_data.temp_mon_range[1].full_chrg_cur = 1500;
+ platform_data.temp_mon_range[1].maint_chrg_vol_ll = 4126;
+ platform_data.temp_mon_range[1].maint_chrg_vol_ul = 4200;
+ platform_data.temp_mon_range[1].maint_chrg_cur = 950;
+
+ platform_data.temp_mon_range[2].temp_up_lim = 10;
+ platform_data.temp_mon_range[2].full_chrg_vol = 4200;
+ platform_data.temp_mon_range[2].full_chrg_cur = 1500;
+ platform_data.temp_mon_range[2].maint_chrg_vol_ll = 4126;
+ platform_data.temp_mon_range[2].maint_chrg_vol_ul = 4200;
+ platform_data.temp_mon_range[2].maint_chrg_cur = 950;
+
+ platform_data.temp_mon_range[3].temp_up_lim = 0;
+ platform_data.temp_mon_range[3].full_chrg_vol = 3950;
+ platform_data.temp_mon_range[3].full_chrg_cur = 950;
+ platform_data.temp_mon_range[3].maint_chrg_vol_ll = 3900;
+ platform_data.temp_mon_range[3].maint_chrg_vol_ul = 3950;
+ platform_data.temp_mon_range[3].maint_chrg_cur = 950;
+
+ platform_data.temp_low_lim = -10;
platform_data.slave_mode = 0;
return &platform_data;
}
diff --git a/arch/x86/platform/intel-mid/device_libs/platform_max17042.c b/arch/x86/platform/intel-mid/device_libs/platform_max17042.c
index 9c451efb16a..b6bbd51e1ed 100644
--- a/arch/x86/platform/intel-mid/device_libs/platform_max17042.c
+++ b/arch/x86/platform/intel-mid/device_libs/platform_max17042.c
@@ -194,7 +194,8 @@ void *max17042_platform_data(void *info)
platform_data.battery_status = smb347_get_charging_status;
#endif
#ifdef CONFIG_CHARGER_BQ24192 /* clovertrail */
- platform_data.battery_status = bq24192_query_battery_status;
+ platform_data.battery_status = ctp_query_battery_status;
+ platform_data.battery_pack_temp = ctp_get_battery_pack_temp;
#endif
return &platform_data;