aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/power/charger-manager.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/power/charger-manager.h')
-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 0e86840eb603..9aec0293f204 100644
--- a/include/linux/power/charger-manager.h
+++ b/include/linux/power/charger-manager.h
@@ -37,6 +37,8 @@ enum cm_event_types {
37 CM_EVENT_BATT_FULL, 37 CM_EVENT_BATT_FULL,
38 CM_EVENT_BATT_IN, 38 CM_EVENT_BATT_IN,
39 CM_EVENT_BATT_OUT, 39 CM_EVENT_BATT_OUT,
40 CM_EVENT_BATT_OVERHEAT,
41 CM_EVENT_BATT_COLD,
40 CM_EVENT_EXT_PWR_IN_OUT, 42 CM_EVENT_EXT_PWR_IN_OUT,
41 CM_EVENT_CHG_START_STOP, 43 CM_EVENT_CHG_START_STOP,
42 CM_EVENT_OTHERS, 44 CM_EVENT_OTHERS,
@@ -173,11 +175,10 @@ struct charger_regulator {
173 * @num_charger_regulator: the number of entries in charger_regulators 175 * @num_charger_regulator: the number of entries in charger_regulators
174 * @charger_regulators: array of charger regulators 176 * @charger_regulators: array of charger regulators
175 * @psy_fuel_gauge: the name of power-supply for fuel gauge 177 * @psy_fuel_gauge: the name of power-supply for fuel gauge
176 * @temperature_out_of_range: 178 * @thermal_zone : the name of thermal zone for battery
177 * Determine whether the status is overheat or cold or normal. 179 * @temp_min : Minimum battery temperature for charging.
178 * return_value > 0: overheat 180 * @temp_max : Maximum battery temperature for charging.
179 * return_value == 0: normal 181 * @temp_diff : Temperature diffential to restart charging.
180 * return_value < 0: cold
181 * @measure_battery_temp: 182 * @measure_battery_temp:
182 * true: measure battery temperature 183 * true: measure battery temperature
183 * false: measure ambient temperature 184 * false: measure ambient temperature
@@ -210,7 +211,12 @@ struct charger_desc {
210 211
211 char *psy_fuel_gauge; 212 char *psy_fuel_gauge;
212 213
213 int (*temperature_out_of_range)(int *mC); 214 char *thermal_zone;
215
216 int temp_min;
217 int temp_max;
218 int temp_diff;
219
214 bool measure_battery_temp; 220 bool measure_battery_temp;
215 221
216 u64 charging_max_duration_ms; 222 u64 charging_max_duration_ms;
@@ -226,13 +232,13 @@ struct charger_desc {
226 * @desc: instance of charger_desc 232 * @desc: instance of charger_desc
227 * @fuel_gauge: power_supply for fuel gauge 233 * @fuel_gauge: power_supply for fuel gauge
228 * @charger_stat: array of power_supply for chargers 234 * @charger_stat: array of power_supply for chargers
235 * @tzd_batt : thermal zone device for battery
229 * @charger_enabled: the state of charger 236 * @charger_enabled: the state of charger
230 * @fullbatt_vchk_jiffies_at: 237 * @fullbatt_vchk_jiffies_at:
231 * jiffies at the time full battery check will occur. 238 * jiffies at the time full battery check will occur.
232 * @fullbatt_vchk_work: work queue for full battery check 239 * @fullbatt_vchk_work: work queue for full battery check
233 * @emergency_stop: 240 * @emergency_stop:
234 * When setting true, stop charging 241 * When setting true, stop charging
235 * @last_temp_mC: the measured temperature in milli-Celsius
236 * @psy_name_buf: the name of power-supply-class for charger manager 242 * @psy_name_buf: the name of power-supply-class for charger manager
237 * @charger_psy: power_supply for charger manager 243 * @charger_psy: power_supply for charger manager
238 * @status_save_ext_pwr_inserted: 244 * @status_save_ext_pwr_inserted:
@@ -250,13 +256,15 @@ struct charger_manager {
250 struct power_supply *fuel_gauge; 256 struct power_supply *fuel_gauge;
251 struct power_supply **charger_stat; 257 struct power_supply **charger_stat;
252 258
259#ifdef CONFIG_THERMAL
260 struct thermal_zone_device *tzd_batt;
261#endif
253 bool charger_enabled; 262 bool charger_enabled;
254 263
255 unsigned long fullbatt_vchk_jiffies_at; 264 unsigned long fullbatt_vchk_jiffies_at;
256 struct delayed_work fullbatt_vchk_work; 265 struct delayed_work fullbatt_vchk_work;
257 266
258 int emergency_stop; 267 int emergency_stop;
259 int last_temp_mC;
260 268
261 char psy_name_buf[PSY_NAME_MAX + 1]; 269 char psy_name_buf[PSY_NAME_MAX + 1];
262 struct power_supply charger_psy; 270 struct power_supply charger_psy;