aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/power
diff options
context:
space:
mode:
authorJonghwa Lee <jonghwa3.lee@samsung.com>2014-12-19 03:55:13 -0500
committerSebastian Reichel <sre@kernel.org>2015-01-21 14:52:07 -0500
commitc1155c64e603378dccfc21ee0612cf60dd11725b (patch)
tree7e532baf21fd51eb6a70339786152aceec54a206 /include/linux/power
parenta538cf04ef67861a208075a6d57d0f045822e1d6 (diff)
power: charger-manager: Use alarmtimer for battery monitoring in suspend.
To guerantee proper charing and managing batteries even in suspend, charger-manager has used rtc device with rtc framework interface. However, it is better to use alarmtimer for cleaner and more appropriate operation. This patch makes driver to use alarmtimer for polling work in suspend and removes all deprecated codes related with using rtc interface. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'include/linux/power')
-rw-r--r--include/linux/power/charger-manager.h32
1 files changed, 1 insertions, 31 deletions
diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h
index e97fc656a058..416ebeb6ee1e 100644
--- a/include/linux/power/charger-manager.h
+++ b/include/linux/power/charger-manager.h
@@ -17,6 +17,7 @@
17 17
18#include <linux/power_supply.h> 18#include <linux/power_supply.h>
19#include <linux/extcon.h> 19#include <linux/extcon.h>
20#include <linux/alarmtimer.h>
20 21
21enum data_source { 22enum data_source {
22 CM_BATTERY_PRESENT, 23 CM_BATTERY_PRESENT,
@@ -45,29 +46,6 @@ enum cm_event_types {
45}; 46};
46 47
47/** 48/**
48 * struct charger_global_desc
49 * @rtc_name: the name of RTC used to wake up the system from suspend.
50 * @rtc_only_wakeup:
51 * If the system is woken up by waekup-sources other than the RTC or
52 * callbacks, Charger Manager should recognize with
53 * rtc_only_wakeup() returning false.
54 * If the RTC given to CM is the only wakeup reason,
55 * rtc_only_wakeup should return true.
56 * @assume_timer_stops_in_suspend:
57 * Assume that the jiffy timer stops in suspend-to-RAM.
58 * When enabled, CM does not rely on jiffies value in
59 * suspend_again and assumes that jiffies value does not
60 * change during suspend.
61 */
62struct charger_global_desc {
63 char *rtc_name;
64
65 bool (*rtc_only_wakeup)(void);
66
67 bool assume_timer_stops_in_suspend;
68};
69
70/**
71 * struct charger_cable 49 * struct charger_cable
72 * @extcon_name: the name of extcon device. 50 * @extcon_name: the name of extcon device.
73 * @name: the name of charger cable(external connector). 51 * @name: the name of charger cable(external connector).
@@ -266,22 +244,14 @@ struct charger_manager {
266 char psy_name_buf[PSY_NAME_MAX + 1]; 244 char psy_name_buf[PSY_NAME_MAX + 1];
267 struct power_supply charger_psy; 245 struct power_supply charger_psy;
268 246
269 bool status_save_ext_pwr_inserted;
270 bool status_save_batt;
271
272 u64 charging_start_time; 247 u64 charging_start_time;
273 u64 charging_end_time; 248 u64 charging_end_time;
274}; 249};
275 250
276#ifdef CONFIG_CHARGER_MANAGER 251#ifdef CONFIG_CHARGER_MANAGER
277extern int setup_charger_manager(struct charger_global_desc *gd);
278extern bool cm_suspend_again(void);
279extern void cm_notify_event(struct power_supply *psy, 252extern void cm_notify_event(struct power_supply *psy,
280 enum cm_event_types type, char *msg); 253 enum cm_event_types type, char *msg);
281#else 254#else
282static inline int setup_charger_manager(struct charger_global_desc *gd)
283{ return 0; }
284static inline bool cm_suspend_again(void) { return false; }
285static inline void cm_notify_event(struct power_supply *psy, 255static inline void cm_notify_event(struct power_supply *psy,
286 enum cm_event_types type, char *msg) { } 256 enum cm_event_types type, char *msg) { }
287#endif 257#endif