diff mbox

[v4,12/12] cpufreq: dt: Reintroduce independent_clocks platform data

Message ID 1512726150-7204-13-git-send-email-sricharan@codeaurora.org (mailing list archive)
State New, archived
Headers show

Commit Message

Sricharan Ramabadhran Dec. 8, 2017, 9:42 a.m. UTC
The Platform data was removed earlier by,
'commit eb96924acddc ("cpufreq: dt: Kill platform-data")'
since there were no users at that time.
Now this is required when the each of the cpu clocks
can be scaled independently, which is the case
for krait cores. So reintroduce it.

Signed-off-by: Sricharan R <sricharan@codeaurora.org>
---
 drivers/cpufreq/cpufreq-dt.c | 7 ++++++-
 drivers/cpufreq/cpufreq-dt.h | 6 ++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

Comments

Viresh Kumar Dec. 11, 2017, 8:33 a.m. UTC | #1
On 08-12-17, 15:12, Sricharan R wrote:
> The Platform data was removed earlier by,
> 'commit eb96924acddc ("cpufreq: dt: Kill platform-data")'
> since there were no users at that time.
> Now this is required when the each of the cpu clocks
> can be scaled independently, which is the case
> for krait cores. So reintroduce it.
> 
> Signed-off-by: Sricharan R <sricharan@codeaurora.org>
> ---
>  drivers/cpufreq/cpufreq-dt.c | 7 ++++++-
>  drivers/cpufreq/cpufreq-dt.h | 6 ++++++
>  2 files changed, 12 insertions(+), 1 deletion(-)

Nack. This information should come from the OPP layer (Hint:
dev_pm_opp_of_get_sharing_cpus()).
Sricharan Ramabadhran Dec. 11, 2017, 1:24 p.m. UTC | #2
Hi Viresh,

On 12/11/2017 2:03 PM, Viresh Kumar wrote:
> On 08-12-17, 15:12, Sricharan R wrote:
>> The Platform data was removed earlier by,
>> 'commit eb96924acddc ("cpufreq: dt: Kill platform-data")'
>> since there were no users at that time.
>> Now this is required when the each of the cpu clocks
>> can be scaled independently, which is the case
>> for krait cores. So reintroduce it.
>>
>> Signed-off-by: Sricharan R <sricharan@codeaurora.org>
>> ---
>>  drivers/cpufreq/cpufreq-dt.c | 7 ++++++-
>>  drivers/cpufreq/cpufreq-dt.h | 6 ++++++
>>  2 files changed, 12 insertions(+), 1 deletion(-)
> 
> Nack. This information should come from the OPP layer (Hint:
> dev_pm_opp_of_get_sharing_cpus()).
> 

Thanks. Understand. As replied on the other patch, after using
dev_pm_opp_set_prop_name and opp-v2 bindings, this patch is no more
required.

Regards,
 Sricharan
diff mbox

Patch

diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
index 545946a..8f0e881 100644
--- a/drivers/cpufreq/cpufreq-dt.c
+++ b/drivers/cpufreq/cpufreq-dt.c
@@ -228,7 +228,10 @@  static int cpufreq_init(struct cpufreq_policy *policy)
 	}
 
 	if (fallback) {
-		cpumask_setall(policy->cpus);
+		struct cpufreq_dt_platform_data *pd = cpufreq_get_driver_data();
+
+		if (!pd || !pd->independent_clocks)
+			cpumask_setall(policy->cpus);
 
 		/*
 		 * OPP tables are initialized only for policy->cpu, do it for
@@ -380,6 +383,8 @@  static int dt_cpufreq_probe(struct platform_device *pdev)
 	if (data && data->have_governor_per_policy)
 		dt_cpufreq_driver.flags |= CPUFREQ_HAVE_GOVERNOR_PER_POLICY;
 
+	dt_cpufreq_driver.driver_data = data;
+
 	ret = cpufreq_register_driver(&dt_cpufreq_driver);
 	if (ret)
 		dev_err(&pdev->dev, "failed register driver: %d\n", ret);
diff --git a/drivers/cpufreq/cpufreq-dt.h b/drivers/cpufreq/cpufreq-dt.h
index 54d774e..dcc03c6 100644
--- a/drivers/cpufreq/cpufreq-dt.h
+++ b/drivers/cpufreq/cpufreq-dt.h
@@ -13,6 +13,12 @@ 
 #include <linux/types.h>
 
 struct cpufreq_dt_platform_data {
+	/*
+	 * True when each CPU has its own clock to control its
+	 * frequency, false when all CPUs are controlled by a single
+	 * clock.
+	 */
+	bool independent_clocks;
 	bool have_governor_per_policy;
 };