summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2013-10-03 18:57:55 +0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-16 02:50:23 +0400
commit184345129c53e76069c209f9912ed7c457eceb31 (patch)
treeaac6a1142dce29a1c622c69fcca0b4da05e31b2d /include/linux
parentbe49e3465f222b4b796be8a21d14afbfd8f5d20f (diff)
downloadlinux-184345129c53e76069c209f9912ed7c457eceb31.tar.xz
cpufreq: define generic .attr, .exit() and .verify() routines
Most of the CPUFreq drivers do similar things in .exit() and .verify() routines and .attr. So its better if we have generic routines for them which can be used by cpufreq drivers then. This patch introduces generic .attr, .exit() and .verify() cpufreq drivers. 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.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index c7495915932d..36ccd0bf1304 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -401,6 +401,7 @@ int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy,
int cpufreq_frequency_table_verify(struct cpufreq_policy *policy,
struct cpufreq_frequency_table *table);
+int cpufreq_generic_frequency_table_verify(struct cpufreq_policy *policy);
int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
struct cpufreq_frequency_table *table,
@@ -416,10 +417,17 @@ struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu);
/* the following are really really optional */
extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs;
+extern struct freq_attr *cpufreq_generic_attr[];
void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table,
unsigned int cpu);
void cpufreq_frequency_table_put_attr(unsigned int cpu);
int cpufreq_table_validate_and_show(struct cpufreq_policy *policy,
struct cpufreq_frequency_table *table);
+static inline int cpufreq_generic_exit(struct cpufreq_policy *policy)
+{
+ cpufreq_frequency_table_put_attr(policy->cpu);
+ return 0;
+}
+
#endif /* _LINUX_CPUFREQ_H */