summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajendra Nayak <rnayak@codeaurora.org>2017-06-20 14:15:25 +0530
committerViresh Kumar <viresh.kumar@linaro.org>2017-10-06 14:40:43 +0530
commitd0f083724c0c78afb5f5f8920e76012e86ee5424 (patch)
tree1e3fd4a50b94d0112f198fad417346fcce220992
parent2cd01008e011707b06a8a55bc74f0ed1dfc99b44 (diff)
downloadlinux-d0f083724c0c78afb5f5f8920e76012e86ee5424.tar.gz
soc: qcom: rpmpd: Add support for set performance state
THIS IS TEST CODE, SHOULDN'T BE MERGED. With genpd now expecting powerdomain drivers supporting performance state to support set performance state callbacks, add support for it in the rpmpd driver. NOT-signed-off-by: Rajendra Nayak <rnayak@codeaurora.org> NOT-signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
-rw-r--r--drivers/soc/qcom/rpmpd.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/soc/qcom/rpmpd.c b/drivers/soc/qcom/rpmpd.c
index d34d9c3..88db018 100644
--- a/drivers/soc/qcom/rpmpd.c
+++ b/drivers/soc/qcom/rpmpd.c
@@ -230,6 +230,28 @@ static int rpmpd_power_off(struct generic_pm_domain *domain)
return ret;
}
+static int rpmpd_set_performance(struct generic_pm_domain *domain,
+ unsigned int state)
+{
+ int ret = 0;
+ struct rpmpd *pd = domain_to_rpmpd(domain);
+
+ mutex_lock(&rpmpd_lock);
+
+ pd->corner = state;
+
+ if (!pd->enabled && (pd->key != KEY_FLOOR_CORNER))
+ goto out;
+
+ ret = rpmpd_aggregate_corner(pd);
+
+out:
+ mutex_unlock(&rpmpd_lock);
+
+ return ret;
+}
+
+
static int rpmpd_probe(struct platform_device *pdev)
{
int i;
@@ -267,6 +289,7 @@ static int rpmpd_probe(struct platform_device *pdev)
rpmpds[i]->rpm = rpm;
rpmpds[i]->pd.power_off = rpmpd_power_off;
rpmpds[i]->pd.power_on = rpmpd_power_on;
+ rpmpds[i]->pd.genpd_set_performance_state = rpmpd_set_performance;
pm_genpd_init(&rpmpds[i]->pd, NULL, true);
data->domains[i] = &rpmpds[i]->pd;