summaryrefslogtreecommitdiff
path: root/drivers/edp
diff options
context:
space:
mode:
authorTimo Alho <talho@nvidia.com>2013-10-29 10:24:05 +0200
committerJuha Tukkinen <jtukkinen@nvidia.com>2013-11-05 00:11:54 -0800
commit766754e648cecac1678ddb0459bf3ec0ec49728e (patch)
tree9615c79271926df1a6d3e2bf0764ac448acd206b /drivers/edp
parent4c4db2dcc7c7857c5dbaf88a11c812dec374aa48 (diff)
EDP: add API to query current power state
Add sysedp_get_state API function call to query current power state of sysedp consumer. Change-Id: I667a848e269836b7dba652a7929a5fbce6ef8d82 Signed-off-by: Timo Alho <talho@nvidia.com> Reviewed-on: http://git-master/r/304819 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
Diffstat (limited to 'drivers/edp')
-rw-r--r--drivers/edp/sysedp.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/edp/sysedp.c b/drivers/edp/sysedp.c
index 55ce8ea97ca2..e09eee30d98e 100644
--- a/drivers/edp/sysedp.c
+++ b/drivers/edp/sysedp.c
@@ -180,6 +180,21 @@ void sysedp_set_state(struct sysedp_consumer *consumer, unsigned int new_state)
}
EXPORT_SYMBOL(sysedp_set_state);
+unsigned int sysedp_get_state(struct sysedp_consumer *consumer)
+{
+ unsigned int state;
+ if (!consumer)
+ return 0;
+
+ mutex_lock(&sysedp_lock);
+ state = consumer->state;
+ mutex_unlock(&sysedp_lock);
+
+ return state;
+}
+EXPORT_SYMBOL(sysedp_get_state);
+
+
static int sysedp_probe(struct platform_device *pdev)
{
pdata = pdev->dev.platform_data;