summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2011-09-23 18:08:54 +0530
committerSimone Willett <swillett@nvidia.com>2011-09-26 10:47:26 -0700
commita4e9243d34f6a1a7acb2d82b725a1d3200365897 (patch)
tree37f746ea3afa34027452462e919e8a1f3cddc555 /include
parentcf5d83a14af135bfe181294433006fd4018dcdd9 (diff)
power: tps80031-charger:Mechanism for getting charging status
Adding api which provides the mechanism to getting charging status. bug 872697 Change-Id: I2d70e33e04d6a663e55752a89e1699afb4d355b4 Reviewed-on: http://git-master/r/53785 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/tps80031-charger.h19
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 */