0046-cpufreq-qcom-independent-core-clocks.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. From patchwork Fri Dec 8 09:42:30 2017
  2. Content-Type: text/plain; charset="utf-8"
  3. MIME-Version: 1.0
  4. Content-Transfer-Encoding: 7bit
  5. Subject: [v4,12/12] cpufreq: dt: Reintroduce independent_clocks platform data
  6. From: Sricharan R <[email protected]>
  7. X-Patchwork-Id: 10102073
  8. Message-Id: <[email protected]>
  9. To: [email protected], [email protected],
  10. [email protected], [email protected],
  11. [email protected], [email protected],
  12. [email protected], [email protected]
  13. Cc: [email protected]
  14. Date: Fri, 8 Dec 2017 15:12:30 +0530
  15. The Platform data was removed earlier by,
  16. 'commit eb96924acddc ("cpufreq: dt: Kill platform-data")'
  17. since there were no users at that time.
  18. Now this is required when the each of the cpu clocks
  19. can be scaled independently, which is the case
  20. for krait cores. So reintroduce it.
  21. Signed-off-by: Sricharan R <[email protected]>
  22. ---
  23. drivers/cpufreq/cpufreq-dt.c | 7 ++++++-
  24. drivers/cpufreq/cpufreq-dt.h | 6 ++++++
  25. 2 files changed, 12 insertions(+), 1 deletion(-)
  26. --- a/drivers/cpufreq/cpufreq-dt.c
  27. +++ b/drivers/cpufreq/cpufreq-dt.c
  28. @@ -231,7 +231,10 @@ static int cpufreq_init(struct cpufreq_p
  29. }
  30. if (fallback) {
  31. - cpumask_setall(policy->cpus);
  32. + struct cpufreq_dt_platform_data *pd = cpufreq_get_driver_data();
  33. +
  34. + if (!pd || !pd->independent_clocks)
  35. + cpumask_setall(policy->cpus);
  36. /*
  37. * OPP tables are initialized only for policy->cpu, do it for
  38. @@ -376,6 +379,8 @@ static int dt_cpufreq_probe(struct platf
  39. if (data && data->have_governor_per_policy)
  40. dt_cpufreq_driver.flags |= CPUFREQ_HAVE_GOVERNOR_PER_POLICY;
  41. + dt_cpufreq_driver.driver_data = data;
  42. +
  43. ret = cpufreq_register_driver(&dt_cpufreq_driver);
  44. if (ret)
  45. dev_err(&pdev->dev, "failed register driver: %d\n", ret);
  46. --- a/drivers/cpufreq/cpufreq-dt.h
  47. +++ b/drivers/cpufreq/cpufreq-dt.h
  48. @@ -13,6 +13,12 @@
  49. #include <linux/types.h>
  50. struct cpufreq_dt_platform_data {
  51. + /*
  52. + * True when each CPU has its own clock to control its
  53. + * frequency, false when all CPUs are controlled by a single
  54. + * clock.
  55. + */
  56. + bool independent_clocks;
  57. bool have_governor_per_policy;
  58. };