X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Flinux%2Fcpufreq.h;h=b4204dc7e304f675dde629596516c800ba81cfc7;hb=9213980e6a70d8473e0ffd4b39ab5b6caaba9ff5;hp=f48a064221b4f26840917f46f820ea346cf831b9;hpb=c449269f45c2cdf53af08c8d0af37472f66539d9;p=linux-2.6.git diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index f48a06422..b4204dc7e 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -21,6 +21,7 @@ #include #include #include +#include #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 */