Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Alessandro Guido and committed by
Dave Jones
30d221db 605400a8

+18 -2
+9
drivers/cpufreq/Kconfig
··· 69 69 the frequency statically to the highest frequency supported by 70 70 the CPU. 71 71 72 + config CPU_FREQ_DEFAULT_GOV_POWERSAVE 73 + bool "powersave" 74 + depends on EMBEDDED 75 + select CPU_FREQ_GOV_POWERSAVE 76 + help 77 + Use the CPUFreq governor 'powersave' as default. This sets 78 + the frequency statically to the lowest frequency supported by 79 + the CPU. 80 + 72 81 config CPU_FREQ_DEFAULT_GOV_USERSPACE 73 82 bool "userspace" 74 83 select CPU_FREQ_GOV_USERSPACE
+6 -2
drivers/cpufreq/cpufreq_powersave.c
··· 35 35 return 0; 36 36 } 37 37 38 - static struct cpufreq_governor cpufreq_gov_powersave = { 38 + struct cpufreq_governor cpufreq_gov_powersave = { 39 39 .name = "powersave", 40 40 .governor = cpufreq_governor_powersave, 41 41 .owner = THIS_MODULE, 42 42 }; 43 - 43 + EXPORT_SYMBOL(cpufreq_gov_powersave); 44 44 45 45 static int __init cpufreq_gov_powersave_init(void) 46 46 { ··· 58 58 MODULE_DESCRIPTION("CPUfreq policy governor 'powersave'"); 59 59 MODULE_LICENSE("GPL"); 60 60 61 + #ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE 62 + fs_initcall(cpufreq_gov_powersave_init); 63 + #else 61 64 module_init(cpufreq_gov_powersave_init); 65 + #endif 62 66 module_exit(cpufreq_gov_powersave_exit);
+3
include/linux/cpufreq.h
··· 308 308 #endif 309 309 #ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE 310 310 #define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_performance) 311 + #elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE) 312 + extern struct cpufreq_governor cpufreq_gov_powersave; 313 + #define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_powersave) 311 314 #elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE) 312 315 extern struct cpufreq_governor cpufreq_gov_userspace; 313 316 #define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_userspace)