diff options
author | Chanwoo Choi <cw00.choi@samsung.com> | 2012-09-20 21:20:05 -0700 |
---|---|---|
committer | Anton Vorontsov <anton.vorontsov@linaro.org> | 2012-09-20 22:08:00 -0700 |
commit | 8fcfe088e21aa0db9d62eaf565757def673efba6 (patch) | |
tree | 5394f0f8ac6ec50f1ab158927c858a621b074127 /include | |
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')
-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 { * @measure_battery_temp: * true: measure battery temperature * false: measure ambient temperature + * @charging_max_duration_ms: Maximum possible duration for charging + * If whole charging duration exceed 'charging_max_duration_ms', + * cm stop charging. + * @discharging_max_duration_ms: + * Maximum possible duration for discharging with charger cable + * after full-batt. If discharging duration exceed 'discharging + * max_duration_ms', cm start charging. */ struct charger_desc { char *psy_name; @@ -186,6 +193,9 @@ struct charger_desc { int (*temperature_out_of_range)(int *mC); bool measure_battery_temp; + + u64 charging_max_duration_ms; + u64 discharging_max_duration_ms; }; #define PSY_NAME_MAX 30 @@ -210,6 +220,8 @@ struct charger_desc { * saved status of external power before entering suspend-to-RAM * @status_save_batt: * saved status of battery before entering suspend-to-RAM + * @charging_start_time: saved start time of enabling charging + * @charging_end_time: saved end time of disabling charging */ struct charger_manager { struct list_head entry; @@ -232,6 +244,9 @@ struct charger_manager { bool status_save_ext_pwr_inserted; bool status_save_batt; + + u64 charging_start_time; + u64 charging_end_time; }; #ifdef CONFIG_CHARGER_MANAGER |