From ce53b419e75f6a7d2f0d42f882db76a38d7c8e8f Mon Sep 17 00:00:00 2001 From: Jonghwa Lee Date: Tue, 22 Oct 2013 17:35:58 +0900 Subject: charger-manager : Add default battery temperature checking funtion. During the charger manager driver's probing time, it can't succeed if there's no pre-defined .temperature_out_of_range callback function. But if fuel gauge supports battery temperature measurement, we can use it directly. That's what cm_default_get_temp() function does. With flag measure_batter_temp ON, we normally use cm_default_get_temp() for .temperature_out_of_range callback funtion. The TEMP_AMBIENT property is only used for pre-defined one. Signed-off-by: Jonghwa Lee --- include/linux/power/charger-manager.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h index 0e86840eb60..20886197ab3 100644 --- a/include/linux/power/charger-manager.h +++ b/include/linux/power/charger-manager.h @@ -148,6 +148,8 @@ struct charger_regulator { struct charger_manager *cm; }; +struct charger_manager; + /** * struct charger_desc * @psy_name: the name of power-supply-class for charger manager @@ -173,6 +175,9 @@ struct charger_regulator { * @num_charger_regulator: the number of entries in charger_regulators * @charger_regulators: array of charger regulators * @psy_fuel_gauge: the name of power-supply for fuel gauge + * @temp_alert_min : Minimum battery temperature to be allowed. + * @temp_alert_max : Maximum battery temperature to be allowed. + * @temp_alert_diff : Temperature diffential to restart charging. * @temperature_out_of_range: * Determine whether the status is overheat or cold or normal. * return_value > 0: overheat @@ -210,7 +215,11 @@ struct charger_desc { char *psy_fuel_gauge; - int (*temperature_out_of_range)(int *mC); + int temp_alert_min; + int temp_alert_max; + int temp_alert_diff; + + int (*temperature_out_of_range)(struct charger_manager *); bool measure_battery_temp; u64 charging_max_duration_ms; -- cgit v1.2.3