diff options
| author | Chanwoo Choi <cw00.choi@samsung.com> | 2012-05-05 09:26:47 -0400 |
|---|---|---|
| committer | Anton Vorontsov <anton.vorontsov@linaro.org> | 2012-05-05 22:51:58 -0400 |
| commit | dfeccb12b4614befc49a92eb121c2211294ca669 (patch) | |
| tree | 90098ac099d9915af3e941a4d6012507dc10a8df /include/linux/power | |
| parent | d829dc75bafb10754f35fb8895e5143d20267b04 (diff) | |
charger-manager: Provide cm_notify_event function for in-kernel use
By using cm_notify_event function, charger driver can report several
charger events (e.g. battery full and external power in/out, etc) to
Charger-Manager. Charger-Manager can properly and immediately control
chargers by the reported event.
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Donggeun Kim <dg77.kim@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/power')
| -rw-r--r-- | include/linux/power/charger-manager.h | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h index baa299a95e1..241065c9ce5 100644 --- a/include/linux/power/charger-manager.h +++ b/include/linux/power/charger-manager.h | |||
| @@ -31,6 +31,16 @@ enum polling_modes { | |||
| 31 | CM_POLL_CHARGING_ONLY, | 31 | CM_POLL_CHARGING_ONLY, |
| 32 | }; | 32 | }; |
| 33 | 33 | ||
| 34 | enum cm_event_types { | ||
| 35 | CM_EVENT_UNKNOWN = 0, | ||
| 36 | CM_EVENT_BATT_FULL, | ||
| 37 | CM_EVENT_BATT_IN, | ||
| 38 | CM_EVENT_BATT_OUT, | ||
| 39 | CM_EVENT_EXT_PWR_IN_OUT, | ||
| 40 | CM_EVENT_CHG_START_STOP, | ||
| 41 | CM_EVENT_OTHERS, | ||
| 42 | }; | ||
| 43 | |||
| 34 | /** | 44 | /** |
| 35 | * struct charger_global_desc | 45 | * struct charger_global_desc |
| 36 | * @rtc_name: the name of RTC used to wake up the system from suspend. | 46 | * @rtc_name: the name of RTC used to wake up the system from suspend. |
| @@ -159,14 +169,13 @@ struct charger_manager { | |||
| 159 | #ifdef CONFIG_CHARGER_MANAGER | 169 | #ifdef CONFIG_CHARGER_MANAGER |
| 160 | extern int setup_charger_manager(struct charger_global_desc *gd); | 170 | extern int setup_charger_manager(struct charger_global_desc *gd); |
| 161 | extern bool cm_suspend_again(void); | 171 | extern bool cm_suspend_again(void); |
| 172 | extern void cm_notify_event(struct power_supply *psy, | ||
| 173 | enum cm_event_types type, char *msg); | ||
| 162 | #else | 174 | #else |
| 163 | static void __maybe_unused setup_charger_manager(struct charger_global_desc *gd) | 175 | static inline int setup_charger_manager(struct charger_global_desc *gd) |
| 164 | { } | 176 | { return 0; } |
| 165 | 177 | static inline bool cm_suspend_again(void) { return false; } | |
| 166 | static bool __maybe_unused cm_suspend_again(void) | 178 | static inline void cm_notify_event(struct power_supply *psy, |
| 167 | { | 179 | enum cm_event_types type, char *msg) { } |
| 168 | return false; | ||
| 169 | } | ||
| 170 | #endif | 180 | #endif |
| 171 | |||
| 172 | #endif /* _CHARGER_MANAGER_H */ | 181 | #endif /* _CHARGER_MANAGER_H */ |
