diff options
| author | Viresh Kumar <viresh.kumar@linaro.org> | 2014-01-09 10:08:43 -0500 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-01-16 20:00:44 -0500 |
| commit | 652ed95d5fa6074b3c4ea245deb0691f1acb6656 (patch) | |
| tree | 7b01079f3a582b0d6b08f541a8a344440bec8eae /include/linux | |
| parent | 0ad04fb30db0341d0b1134e2f592d9146c9abb64 (diff) | |
cpufreq: introduce cpufreq_generic_get() routine
CPUFreq drivers that use clock frameworks interface,i.e. clk_get_rate(),
to get CPUs clk rate, have similar sort of code used in most of them.
This patch adds a generic ->get() which will do the same thing for them.
All those drivers are required to now is to set .get to cpufreq_generic_get()
and set their clk pointer in policy->clk during ->init().
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/cpufreq.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index bb727eb98ed5..422f10561e0b 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #ifndef _LINUX_CPUFREQ_H | 11 | #ifndef _LINUX_CPUFREQ_H |
| 12 | #define _LINUX_CPUFREQ_H | 12 | #define _LINUX_CPUFREQ_H |
| 13 | 13 | ||
| 14 | #include <linux/clk.h> | ||
| 14 | #include <linux/cpumask.h> | 15 | #include <linux/cpumask.h> |
| 15 | #include <linux/completion.h> | 16 | #include <linux/completion.h> |
| 16 | #include <linux/kobject.h> | 17 | #include <linux/kobject.h> |
| @@ -66,6 +67,7 @@ struct cpufreq_policy { | |||
| 66 | unsigned int cpu; /* cpu nr of CPU managing this policy */ | 67 | unsigned int cpu; /* cpu nr of CPU managing this policy */ |
| 67 | unsigned int last_cpu; /* cpu nr of previous CPU that managed | 68 | unsigned int last_cpu; /* cpu nr of previous CPU that managed |
| 68 | * this policy */ | 69 | * this policy */ |
| 70 | struct clk *clk; | ||
| 69 | struct cpufreq_cpuinfo cpuinfo;/* see above */ | 71 | struct cpufreq_cpuinfo cpuinfo;/* see above */ |
| 70 | 72 | ||
| 71 | unsigned int min; /* in kHz */ | 73 | unsigned int min; /* in kHz */ |
| @@ -470,6 +472,7 @@ void cpufreq_frequency_table_put_attr(unsigned int cpu); | |||
| 470 | int cpufreq_table_validate_and_show(struct cpufreq_policy *policy, | 472 | int cpufreq_table_validate_and_show(struct cpufreq_policy *policy, |
| 471 | struct cpufreq_frequency_table *table); | 473 | struct cpufreq_frequency_table *table); |
| 472 | 474 | ||
| 475 | unsigned int cpufreq_generic_get(unsigned int cpu); | ||
| 473 | int cpufreq_generic_init(struct cpufreq_policy *policy, | 476 | int cpufreq_generic_init(struct cpufreq_policy *policy, |
| 474 | struct cpufreq_frequency_table *table, | 477 | struct cpufreq_frequency_table *table, |
| 475 | unsigned int transition_latency); | 478 | unsigned int transition_latency); |
