diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2011-09-23 18:08:54 +0530 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-10-13 18:39:34 -0700 |
commit | 2564b8d75a4c4e6e3d3a4ddcf809ced48245d30e (patch) | |
tree | cd4602529f0779c222b2c20ff85f2ec521b22bab /include | |
parent | 220ef83b1144caf5232b253dc2c538ad2c07a9bd (diff) |
power: tps80031-charger:Mechanism for getting charging status
Adding api which provides the mechanism to getting charging status.
bug 872697
Reviewed-on: http://git-master/r/56625
(cherry picked from commit 4c271cf84923cd5ae9225f41a1a665b116cb974a)
Change-Id: Ibd88cbb568ac65f992a8142934017ed468268d72
Reviewed-on: http://git-master/r/57808
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/tps80031-charger.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/tps80031-charger.h b/include/linux/tps80031-charger.h index 6d2348d2788f..26c228edc306 100644 --- a/include/linux/tps80031-charger.h +++ b/include/linux/tps80031-charger.h @@ -26,6 +26,19 @@ #include <linux/regulator/machine.h> +enum charging_states { + charging_state_idle, + charging_state_charging_in_progress, + charging_state_charging_completed, + charging_state_charging_stopped, +}; + +/** + * Callback type definition which is called when any state changed in the + * charging. + */ +typedef void (*charging_callback_t)(enum charging_states state, void *args); + struct tps80031_charger_platform_data { int regulator_id; int max_charge_volt_mV; @@ -40,4 +53,10 @@ struct tps80031_charger_platform_data { void *board_data; }; +/** + * Register the callback function for the client. This callback gets called + * when there is any change in the chanrging states. + */ +extern int register_charging_state_callback(charging_callback_t cb, void *args); + #endif /*__LINUX_TPS80031_CHARGER_H */ |