1 ipq806x: support independent core clocks with kernel 4.9+
3 Add back support for the independent_clocks definition that has been
4 removed between kernel 4.4 and 4.9 by upstream commits
5 eb96924acddc709db58221c210ca05cd9effb1df and
6 e86eee6bc2aaa6b3637f6497b26beee09a91bde9
8 * extend the new cpufreq_dt_platform_data definition in cpufreq-dt.h
9 * use new cpufreq-dt.h in qcom-cpufreq.c
11 Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
13 --- a/drivers/cpufreq/cpufreq-dt.h
14 +++ b/drivers/cpufreq/cpufreq-dt.h
17 struct cpufreq_dt_platform_data {
18 bool have_governor_per_policy;
19 + bool independent_clocks;
22 #endif /* __CPUFREQ_DT_H__ */
23 --- a/drivers/cpufreq/cpufreq-dt.c
24 +++ b/drivers/cpufreq/cpufreq-dt.c
25 @@ -221,7 +221,10 @@ static int cpufreq_init(struct cpufreq_p
29 - cpumask_setall(policy->cpus);
30 + struct cpufreq_dt_platform_data *pd = cpufreq_get_driver_data();
32 + if (!pd || !pd->independent_clocks)
33 + cpumask_setall(policy->cpus);
36 * OPP tables are initialized only for policy->cpu, do it for
37 @@ -376,6 +379,8 @@ static int dt_cpufreq_probe(struct platf
38 if (data && data->have_governor_per_policy)
39 dt_cpufreq_driver.flags |= CPUFREQ_HAVE_GOVERNOR_PER_POLICY;
41 + dt_cpufreq_driver.driver_data = dev_get_platdata(&pdev->dev);
43 ret = cpufreq_register_driver(&dt_cpufreq_driver);
45 dev_err(&pdev->dev, "failed register driver: %d\n", ret);
46 --- a/drivers/cpufreq/qcom-cpufreq.c
47 +++ b/drivers/cpufreq/qcom-cpufreq.c
49 #include <linux/platform_device.h>
50 #include <linux/pm_opp.h>
51 #include <linux/slab.h>
52 -#include <linux/cpufreq-dt.h>
53 +#include "cpufreq-dt.h"
55 static void __init get_krait_bin_format_a(int *speed, int *pvs, int *pvs_ver)