diff options
author | Chanwoo Choi <cw00.choi@samsung.com> | 2012-05-05 06:26:47 -0700 |
---|---|---|
committer | Anton Vorontsov <anton.vorontsov@linaro.org> | 2012-05-05 19:51:58 -0700 |
commit | dfeccb12b4614befc49a92eb121c2211294ca669 (patch) | |
tree | 90098ac099d9915af3e941a4d6012507dc10a8df /include/linux/power/charger-manager.h | |
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/charger-manager.h')
-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 { CM_POLL_CHARGING_ONLY, }; +enum cm_event_types { + CM_EVENT_UNKNOWN = 0, + CM_EVENT_BATT_FULL, + CM_EVENT_BATT_IN, + CM_EVENT_BATT_OUT, + CM_EVENT_EXT_PWR_IN_OUT, + CM_EVENT_CHG_START_STOP, + CM_EVENT_OTHERS, +}; + /** * struct charger_global_desc * @rtc_name: the name of RTC used to wake up the system from suspend. @@ -159,14 +169,13 @@ struct charger_manager { #ifdef CONFIG_CHARGER_MANAGER extern int setup_charger_manager(struct charger_global_desc *gd); extern bool cm_suspend_again(void); +extern void cm_notify_event(struct power_supply *psy, + enum cm_event_types type, char *msg); #else -static void __maybe_unused setup_charger_manager(struct charger_global_desc *gd) -{ } - -static bool __maybe_unused cm_suspend_again(void) -{ - return false; -} +static inline int setup_charger_manager(struct charger_global_desc *gd) +{ return 0; } +static inline bool cm_suspend_again(void) { return false; } +static inline void cm_notify_event(struct power_supply *psy, + enum cm_event_types type, char *msg) { } #endif - #endif /* _CHARGER_MANAGER_H */ |