summaryrefslogtreecommitdiff
path: root/drivers/cpufreq/cpufreq-dt.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2016-09-09 14:18:08 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-09-13 03:39:12 +0300
commit297a66221d2bed61e7d74d11bf071c7b489fc33d (patch)
treee5547e9a3c08c930f1919f33e1ca32e03373db0e /drivers/cpufreq/cpufreq-dt.c
parent33cc4fc1b2147ee3cf36d02c1106456cb276c043 (diff)
downloadlinux-297a66221d2bed61e7d74d11bf071c7b489fc33d.tar.xz
cpufreq: dt: Support governor tunables per policy
The cpufreq-dt driver is also used for systems with multiple clock/voltage domains for CPUs, i.e. multiple cpufreq policies in a system. And in such cases the platform users may want to enable "governor tunables per policy". Support that via platform data, as not all users of the driver would want that behavior. Reported-by: Juri Lelli <Juri.Lelli@arm.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq-dt.c')
-rw-r--r--drivers/cpufreq/cpufreq-dt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
index 2bd20534155d..5c07ae05d69a 100644
--- a/drivers/cpufreq/cpufreq-dt.c
+++ b/drivers/cpufreq/cpufreq-dt.c
@@ -25,6 +25,8 @@
#include <linux/slab.h>
#include <linux/thermal.h>
+#include "cpufreq-dt.h"
+
struct private_data {
struct device *cpu_dev;
struct thermal_cooling_device *cdev;
@@ -353,6 +355,7 @@ static struct cpufreq_driver dt_cpufreq_driver = {
static int dt_cpufreq_probe(struct platform_device *pdev)
{
+ struct cpufreq_dt_platform_data *data = dev_get_platdata(&pdev->dev);
int ret;
/*
@@ -366,6 +369,9 @@ static int dt_cpufreq_probe(struct platform_device *pdev)
if (ret)
return ret;
+ if (data && data->have_governor_per_policy)
+ dt_cpufreq_driver.flags |= CPUFREQ_HAVE_GOVERNOR_PER_POLICY;
+
ret = cpufreq_register_driver(&dt_cpufreq_driver);
if (ret)
dev_err(&pdev->dev, "failed register driver: %d\n", ret);