summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-05-18 17:54:10 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-05-18 17:54:10 -0700
commite79b352d9d0a4fb2ae755150b8ab98b12340c907 (patch)
treef470be452fd500a44dae51bb6f5201bc0aa11e95 /include/linux
parent10cba765d2c2e4dcbab3e8fe7a859435d9098b81 (diff)
parent6deb6e5b874ba6750acd4427448b1d5cc313a664 (diff)
Merge
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/cpufreq.h30
1 files changed, 25 insertions, 5 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index f48a064221b4..b4204dc7e304 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -21,6 +21,7 @@
#include <linux/kobject.h>
#include <linux/sysfs.h>
#include <linux/completion.h>
+#include <linux/workqueue.h>
#define CPUFREQ_NAME_LEN 16
@@ -81,6 +82,9 @@ struct cpufreq_policy {
struct semaphore lock; /* CPU ->setpolicy or ->target may
only be called once a time */
+ struct work_struct update; /* if update_policy() needs to be
+ * called, but you're in IRQ context */
+
struct cpufreq_real_policy user_policy;
struct kobject kobj;
@@ -96,11 +100,13 @@ struct cpufreq_policy {
#define CPUFREQ_PRECHANGE (0)
#define CPUFREQ_POSTCHANGE (1)
+#define CPUFREQ_RESUMECHANGE (8)
struct cpufreq_freqs {
unsigned int cpu; /* cpu nr */
unsigned int old;
unsigned int new;
+ u8 flags; /* flags of cpufreq_driver, see below. */
};
@@ -187,6 +193,9 @@ struct cpufreq_driver {
unsigned int target_freq,
unsigned int relation);
+ /* should be defined, if possible */
+ unsigned int (*get) (unsigned int cpu);
+
/* optional */
int (*exit) (struct cpufreq_policy *policy);
int (*resume) (struct cpufreq_policy *policy);
@@ -195,8 +204,19 @@ struct cpufreq_driver {
/* flags */
-#define CPUFREQ_STICKY 0x01 /* the driver isn't removed even if
- all ->init() calls failed */
+#define CPUFREQ_STICKY 0x01 /* the driver isn't removed even if
+ * all ->init() calls failed */
+#define CPUFREQ_CONST_LOOPS 0x02 /* loops_per_jiffy or other kernel
+ * "constants" aren't affected by
+ * frequency transitions */
+#define CPUFREQ_PANIC_OUTOFSYNC 0x04 /* panic if cpufreq's opinion of
+ * current frequency differs from
+ * actual frequency */
+#define CPUFREQ_PANIC_RESUME_OUTOFSYNC 0x08 /* panic if cpufreq's opinion of
+ * current frequency differs from
+ * actual frequency on resume
+ * from sleep. */
+
int cpufreq_register_driver(struct cpufreq_driver *driver_data);
int cpufreq_unregister_driver(struct cpufreq_driver *driver_data);
@@ -234,6 +254,9 @@ int cpufreq_set_policy(struct cpufreq_policy *policy);
int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu);
int cpufreq_update_policy(unsigned int cpu);
+/* query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it */
+unsigned int cpufreq_get(unsigned int cpu);
+
/* the proc_intf.c needs this */
int cpufreq_parse_governor (char *str_governor, unsigned int *policy, struct cpufreq_governor **governor);
@@ -241,13 +264,10 @@ int cpufreq_parse_governor (char *str_governor, unsigned int *policy, struct cpu
/*********************************************************************
* CPUFREQ USERSPACE GOVERNOR *
*********************************************************************/
-int cpufreq_gov_userspace_init(void);
-
#ifdef CONFIG_CPU_FREQ_24_API
int cpufreq_setmax(unsigned int cpu);
int cpufreq_set(unsigned int kHz, unsigned int cpu);
-unsigned int cpufreq_get(unsigned int cpu);
/* /proc/sys/cpu */