power: pm8921-charger: implement thermal mitigation
Implement thermal mitigation in the charger driver. The userspace
daemon can get the battery temperature from
/sys/class/power_supply/battery/temp
and set the mitigation levels on
/sys/module/pm8921_charger/parameters/thermal_mitigation
The battery driver supports 4 levels [0 through 3]. O being normal
and 3 being extreme thermal mitigation.
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-msm8960.c b/arch/arm/mach-msm/board-msm8960.c
index acd7974..98eb5b5 100644
--- a/arch/arm/mach-msm/board-msm8960.c
+++ b/arch/arm/mach-msm/board-msm8960.c
@@ -3339,6 +3339,13 @@
.keymap_data = &keymap_data_sim,
};
+static int pm8921_therm_mitigation[] = {
+ 1100,
+ 700,
+ 600,
+ 325,
+};
+
static struct pm8921_charger_platform_data pm8921_chg_pdata __devinitdata = {
.safety_time = 180,
.update_time = 1,
@@ -3349,11 +3356,13 @@
.cool_temp = 10,
.warm_temp = 40,
.temp_check_period = 1,
- .max_bat_chg_current = 400,
+ .max_bat_chg_current = 1100,
.cool_bat_chg_current = 350,
.warm_bat_chg_current = 350,
.cool_bat_voltage = 4100,
.warm_bat_voltage = 4100,
+ .thermal_mitigation = pm8921_therm_mitigation,
+ .thermal_levels = ARRAY_SIZE(pm8921_therm_mitigation),
};
static struct pm8xxx_misc_platform_data pm8xxx_misc_pdata = {