summaryrefslogtreecommitdiff
path: root/include/linux/edp.h
diff options
context:
space:
mode:
authorSivaram Nair <sivaramn@nvidia.com>2012-07-03 17:20:58 +0300
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 12:14:00 -0700
commit95f6f43a8eece60d02d436befead82ec3ef77cee (patch)
treedfd69872a7b287d9477f23bcb09abd1a207f4325 /include/linux/edp.h
parent288da18e51afc578cff94b2bebb6f6db6a7afa4d (diff)
pm: EDP: adding client registration
This patch adds client registration functionality to the existing EDP framework. Bug ID: 917926 Change-Id: I8c9fbe3e1d934a6d95745f3c3933df4c1cbea4e7 Signed-off-by: Sivaram Nair <sivaramn@nvidia.com> Reviewed-on: http://git-master/r/115706 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Matthew Longnecker <mlongnecker@nvidia.com> Reviewed-by: Aleksandr Frid <afrid@nvidia.com> Reviewed-by: Bo Yan <byan@nvidia.com> Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Rebase-Id: Rd2edd8e79be5515b38ed35a7e9a9c8e135ba002f
Diffstat (limited to 'include/linux/edp.h')
-rw-r--r--include/linux/edp.h30
1 files changed, 29 insertions, 1 deletions
diff --git a/include/linux/edp.h b/include/linux/edp.h
index 1f4c12d3e61d..6d31123f4d6e 100644
--- a/include/linux/edp.h
+++ b/include/linux/edp.h
@@ -26,17 +26,40 @@
struct edp_manager {
const char name[EDP_NAME_LEN];
- const unsigned int max_current;
+ const unsigned int imax;
/* internal */
struct list_head link;
+ struct list_head clients;
bool registered;
};
+/*
+ * @states: EDP state array holding the IMAX for each state.
+ * This must be sorted in descending order.
+ * @num_states: length of the above array
+ * @e0_index: index of the E0 state in the above array
+ * Note that each EDP client is tied to a single EDP manager
+ */
+struct edp_client {
+ const char name[EDP_NAME_LEN];
+ const unsigned int *const states;
+ const unsigned int num_states;
+ const unsigned int e0_index;
+
+ /* internal */
+ struct list_head link;
+ struct edp_manager *manager;
+};
+
#ifdef CONFIG_EDP_FRAMEWORK
extern int edp_register_manager(struct edp_manager *mgr);
extern int edp_unregister_manager(struct edp_manager *mgr);
extern struct edp_manager *edp_get_manager(const char *name);
+
+extern int edp_register_client(struct edp_manager *mgr,
+ struct edp_client *client);
+extern int edp_unregister_client(struct edp_client *client);
#else
static inline int edp_register_manager(struct edp_manager *mgr)
{ return -ENODEV; }
@@ -44,6 +67,11 @@ static inline int edp_unregister_manager(struct edp_manager *mgr)
{ return -ENODEV; }
static inline struct edp_manager *edp_get_manager(const char *name)
{ return NULL; }
+static inline int edp_register_client(struct edp_manager *mgr,
+ struct edp_client *client)
+{ return -ENODEV; }
+static inline int edp_unregister_client(struct edp_client *client)
+{ return -ENODEV; }
#endif
#endif