summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/power/charger-manager.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h
index 0e86840eb60..9aec0293f20 100644
--- a/include/linux/power/charger-manager.h
+++ b/include/linux/power/charger-manager.h
@@ -37,6 +37,8 @@ enum cm_event_types {
CM_EVENT_BATT_FULL,
CM_EVENT_BATT_IN,
CM_EVENT_BATT_OUT,
+ CM_EVENT_BATT_OVERHEAT,
+ CM_EVENT_BATT_COLD,
CM_EVENT_EXT_PWR_IN_OUT,
CM_EVENT_CHG_START_STOP,
CM_EVENT_OTHERS,
@@ -173,11 +175,10 @@ 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
- * @temperature_out_of_range:
- * Determine whether the status is overheat or cold or normal.
- * return_value > 0: overheat
- * return_value == 0: normal
- * return_value < 0: cold
+ * @thermal_zone : the name of thermal zone for battery
+ * @temp_min : Minimum battery temperature for charging.
+ * @temp_max : Maximum battery temperature for charging.
+ * @temp_diff : Temperature diffential to restart charging.
* @measure_battery_temp:
* true: measure battery temperature
* false: measure ambient temperature
@@ -210,7 +211,12 @@ struct charger_desc {
char *psy_fuel_gauge;
- int (*temperature_out_of_range)(int *mC);
+ char *thermal_zone;
+
+ int temp_min;
+ int temp_max;
+ int temp_diff;
+
bool measure_battery_temp;
u64 charging_max_duration_ms;
@@ -226,13 +232,13 @@ struct charger_desc {
* @desc: instance of charger_desc
* @fuel_gauge: power_supply for fuel gauge
* @charger_stat: array of power_supply for chargers
+ * @tzd_batt : thermal zone device for battery
* @charger_enabled: the state of charger
* @fullbatt_vchk_jiffies_at:
* jiffies at the time full battery check will occur.
* @fullbatt_vchk_work: work queue for full battery check
* @emergency_stop:
* When setting true, stop charging
- * @last_temp_mC: the measured temperature in milli-Celsius
* @psy_name_buf: the name of power-supply-class for charger manager
* @charger_psy: power_supply for charger manager
* @status_save_ext_pwr_inserted:
@@ -250,13 +256,15 @@ struct charger_manager {
struct power_supply *fuel_gauge;
struct power_supply **charger_stat;
+#ifdef CONFIG_THERMAL
+ struct thermal_zone_device *tzd_batt;
+#endif
bool charger_enabled;
unsigned long fullbatt_vchk_jiffies_at;
struct delayed_work fullbatt_vchk_work;
int emergency_stop;
- int last_temp_mC;
char psy_name_buf[PSY_NAME_MAX + 1];
struct power_supply charger_psy;