diff options
| author | Chanwoo Choi <cw00.choi@samsung.com> | 2012-09-21 00:20:05 -0400 |
|---|---|---|
| committer | Anton Vorontsov <anton.vorontsov@linaro.org> | 2012-09-21 01:08:00 -0400 |
| commit | 8fcfe088e21aa0db9d62eaf565757def673efba6 (patch) | |
| tree | 5394f0f8ac6ec50f1ab158927c858a621b074127 /include/linux | |
| parent | 2ed9e9b6530951b5b96185e6761119361a166d7a (diff) | |
charger-manager: Support limit of maximum possible
This patch check maximum possible duration of charging/discharging.
If whole charging duration exceed 'desc->charging_max_duration_ms', cm
stop charging to prevent overcharge/overheat. And if discharging duration
exceed, charger cable is attached, after full-batt, cm start charging to
maintain fully charged state for battery.
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/power/charger-manager.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h index 76b37ef3c071..a7b388ea1588 100644 --- a/include/linux/power/charger-manager.h +++ b/include/linux/power/charger-manager.h | |||
| @@ -162,6 +162,13 @@ struct charger_regulator { | |||
| 162 | * @measure_battery_temp: | 162 | * @measure_battery_temp: |
| 163 | * true: measure battery temperature | 163 | * true: measure battery temperature |
| 164 | * false: measure ambient temperature | 164 | * false: measure ambient temperature |
| 165 | * @charging_max_duration_ms: Maximum possible duration for charging | ||
| 166 | * If whole charging duration exceed 'charging_max_duration_ms', | ||
| 167 | * cm stop charging. | ||
| 168 | * @discharging_max_duration_ms: | ||
| 169 | * Maximum possible duration for discharging with charger cable | ||
| 170 | * after full-batt. If discharging duration exceed 'discharging | ||
| 171 | * max_duration_ms', cm start charging. | ||
| 165 | */ | 172 | */ |
| 166 | struct charger_desc { | 173 | struct charger_desc { |
| 167 | char *psy_name; | 174 | char *psy_name; |
| @@ -186,6 +193,9 @@ struct charger_desc { | |||
| 186 | 193 | ||
| 187 | int (*temperature_out_of_range)(int *mC); | 194 | int (*temperature_out_of_range)(int *mC); |
| 188 | bool measure_battery_temp; | 195 | bool measure_battery_temp; |
| 196 | |||
| 197 | u64 charging_max_duration_ms; | ||
| 198 | u64 discharging_max_duration_ms; | ||
| 189 | }; | 199 | }; |
| 190 | 200 | ||
| 191 | #define PSY_NAME_MAX 30 | 201 | #define PSY_NAME_MAX 30 |
| @@ -210,6 +220,8 @@ struct charger_desc { | |||
| 210 | * saved status of external power before entering suspend-to-RAM | 220 | * saved status of external power before entering suspend-to-RAM |
| 211 | * @status_save_batt: | 221 | * @status_save_batt: |
| 212 | * saved status of battery before entering suspend-to-RAM | 222 | * saved status of battery before entering suspend-to-RAM |
| 223 | * @charging_start_time: saved start time of enabling charging | ||
| 224 | * @charging_end_time: saved end time of disabling charging | ||
| 213 | */ | 225 | */ |
| 214 | struct charger_manager { | 226 | struct charger_manager { |
| 215 | struct list_head entry; | 227 | struct list_head entry; |
| @@ -232,6 +244,9 @@ struct charger_manager { | |||
| 232 | 244 | ||
| 233 | bool status_save_ext_pwr_inserted; | 245 | bool status_save_ext_pwr_inserted; |
| 234 | bool status_save_batt; | 246 | bool status_save_batt; |
| 247 | |||
| 248 | u64 charging_start_time; | ||
| 249 | u64 charging_end_time; | ||
| 235 | }; | 250 | }; |
| 236 | 251 | ||
| 237 | #ifdef CONFIG_CHARGER_MANAGER | 252 | #ifdef CONFIG_CHARGER_MANAGER |
