diff options
author | Alessandro Guido <alessandro.guido@gmail.com> | 2008-04-18 13:31:13 -0700 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2008-04-28 16:27:08 -0400 |
commit | 30d221db4439973076953e2ed44344fa92d1d09f (patch) | |
tree | 15e97af8ffa193aede37f7bcb50fe9e905a41dcb | |
parent | 605400a8ab44131698b206cbe253e48380daaa69 (diff) | |
download | op-kernel-dev-30d221db4439973076953e2ed44344fa92d1d09f.zip op-kernel-dev-30d221db4439973076953e2ed44344fa92d1d09f.tar.gz |
[CPUFREQ] allow use of the powersave governor as the default one
Allow use of the powersave cpufreq governor as the default one for EMBEDDED
configs.
Signed-off-by: Alessandro Guido <alessandro.guido@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Jones <davej@redhat.com>
-rw-r--r-- | drivers/cpufreq/Kconfig | 9 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq_powersave.c | 8 | ||||
-rw-r--r-- | include/linux/cpufreq.h | 3 |
3 files changed, 18 insertions, 2 deletions
diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig index c159ae6..5f076ae 100644 --- a/drivers/cpufreq/Kconfig +++ b/drivers/cpufreq/Kconfig @@ -69,6 +69,15 @@ config CPU_FREQ_DEFAULT_GOV_PERFORMANCE the frequency statically to the highest frequency supported by the CPU. +config CPU_FREQ_DEFAULT_GOV_POWERSAVE + bool "powersave" + depends on EMBEDDED + select CPU_FREQ_GOV_POWERSAVE + help + Use the CPUFreq governor 'powersave' as default. This sets + the frequency statically to the lowest frequency supported by + the CPU. + config CPU_FREQ_DEFAULT_GOV_USERSPACE bool "userspace" select CPU_FREQ_GOV_USERSPACE diff --git a/drivers/cpufreq/cpufreq_powersave.c b/drivers/cpufreq/cpufreq_powersave.c index 13fe06b..88d2f44 100644 --- a/drivers/cpufreq/cpufreq_powersave.c +++ b/drivers/cpufreq/cpufreq_powersave.c @@ -35,12 +35,12 @@ static int cpufreq_governor_powersave(struct cpufreq_policy *policy, return 0; } -static struct cpufreq_governor cpufreq_gov_powersave = { +struct cpufreq_governor cpufreq_gov_powersave = { .name = "powersave", .governor = cpufreq_governor_powersave, .owner = THIS_MODULE, }; - +EXPORT_SYMBOL(cpufreq_gov_powersave); static int __init cpufreq_gov_powersave_init(void) { @@ -58,5 +58,9 @@ MODULE_AUTHOR("Dominik Brodowski <linux@brodo.de>"); MODULE_DESCRIPTION("CPUfreq policy governor 'powersave'"); MODULE_LICENSE("GPL"); +#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE +fs_initcall(cpufreq_gov_powersave_init); +#else module_init(cpufreq_gov_powersave_init); +#endif module_exit(cpufreq_gov_powersave_exit); diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index a881fd6..e7e91db 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -308,6 +308,9 @@ extern struct cpufreq_governor cpufreq_gov_performance; #endif #ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE #define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_performance) +#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE) +extern struct cpufreq_governor cpufreq_gov_powersave; +#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_powersave) #elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE) extern struct cpufreq_governor cpufreq_gov_userspace; #define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_userspace) |