summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorDominik Brodowski <linux@brodo.de>2003-01-09 22:01:31 -0800
committerKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>2003-01-09 22:01:31 -0800
commit1013687edc383b0f2912b0b5bc87331dd22a24e5 (patch)
treed2af974a4dda1ffbe0d21862d1d628ba80cf0627 /include/linux
parentc78874ac38946f419af6eee2d72c2c3d0cc00c26 (diff)
[PATCH] cpufreq: frequency table helpers
This patch adds "frequency table helpers" to kernel/cpufreq.c and updates some drivers to use them. Most CPU frequency scaling methods only support a few static frequencies. In these drivers a lot of duplicated code existed in the ->setpolicy and ->verify calls. Please note that this in no way changes the behaviour of cpufreq or of the ->setpolicy or ->verify calls. These "frequency table helpers" aren't for drivers which either only support policies (longrun) or really many frequency states (ARM, gx-suspmod).
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/cpufreq.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index ab2890b619d0..0e008ba3618c 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -241,4 +241,27 @@ enum {
#endif /* CONFIG_CPU_FREQ_24_API */
+/*********************************************************************
+ * FREQUENCY TABLE HELPERS *
+ *********************************************************************/
+
+#define CPUFREQ_ENTRY_INVALID ~0
+#define CPUFREQ_TABLE_END ~1
+
+struct cpufreq_frequency_table {
+ unsigned int index; /* any */
+ unsigned int frequency; /* kHz - doesn't need to be in ascending
+ * order */
+};
+
+int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy,
+ struct cpufreq_frequency_table *table);
+
+int cpufreq_frequency_table_verify(struct cpufreq_policy *policy,
+ struct cpufreq_frequency_table *table);
+
+int cpufreq_frequency_table_setpolicy(struct cpufreq_policy *policy,
+ struct cpufreq_frequency_table *table,
+ unsigned int *index);
+
#endif /* _LINUX_CPUFREQ_H */