| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- From patchwork Fri Dec 8 09:42:30 2017
- Content-Type: text/plain; charset="utf-8"
- MIME-Version: 1.0
- Content-Transfer-Encoding: 7bit
- Subject: [v4,12/12] cpufreq: dt: Reintroduce independent_clocks platform data
- From: Sricharan R <[email protected]>
- X-Patchwork-Id: 10102073
- Message-Id: <[email protected]>
- To: [email protected], [email protected],
- [email protected], [email protected],
- [email protected], [email protected],
- [email protected], [email protected]
- Cc: [email protected]
- Date: Fri, 8 Dec 2017 15:12:30 +0530
- 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 <[email protected]>
- ---
- drivers/cpufreq/cpufreq-dt.c | 7 ++++++-
- drivers/cpufreq/cpufreq-dt.h | 6 ++++++
- 2 files changed, 12 insertions(+), 1 deletion(-)
- --- a/drivers/cpufreq/cpufreq-dt.c
- +++ b/drivers/cpufreq/cpufreq-dt.c
- @@ -231,7 +231,10 @@ static int cpufreq_init(struct cpufreq_p
- }
-
- 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
- @@ -376,6 +379,8 @@ static int dt_cpufreq_probe(struct platf
- 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);
- --- 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;
- };
-
|