aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/cpufreq/Kconfig9
-rw-r--r--drivers/cpufreq/cpufreq_powersave.c8
-rw-r--r--include/linux/cpufreq.h3
3 files changed, 18 insertions, 2 deletions
diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
index c159ae64eeb2..5f076aef74fa 100644
--- a/drivers/cpufreq/Kconfig
+++ b/drivers/cpufreq/Kconfig
@@ -69,6 +69,15 @@ config CPU_FREQ_DEFAULT_GOV_PERFORMANCE
69 the frequency statically to the highest frequency supported by 69 the frequency statically to the highest frequency supported by
70 the CPU. 70 the CPU.
71 71
72config 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
72config CPU_FREQ_DEFAULT_GOV_USERSPACE 81config CPU_FREQ_DEFAULT_GOV_USERSPACE
73 bool "userspace" 82 bool "userspace"
74 select CPU_FREQ_GOV_USERSPACE 83 select CPU_FREQ_GOV_USERSPACE
diff --git a/drivers/cpufreq/cpufreq_powersave.c b/drivers/cpufreq/cpufreq_powersave.c
index 13fe06b94b0a..88d2f44fba48 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,
35 return 0; 35 return 0;
36} 36}
37 37
38static struct cpufreq_governor cpufreq_gov_powersave = { 38struct cpufreq_governor cpufreq_gov_powersave = {
39 .name = "powersave", 39 .name = "powersave",
40 .governor = cpufreq_governor_powersave, 40 .governor = cpufreq_governor_powersave,
41 .owner = THIS_MODULE, 41 .owner = THIS_MODULE,
42}; 42};
43 43EXPORT_SYMBOL(cpufreq_gov_powersave);
44 44
45static int __init cpufreq_gov_powersave_init(void) 45static int __init cpufreq_gov_powersave_init(void)
46{ 46{
@@ -58,5 +58,9 @@ MODULE_AUTHOR("Dominik Brodowski <linux@brodo.de>");
58MODULE_DESCRIPTION("CPUfreq policy governor 'powersave'"); 58MODULE_DESCRIPTION("CPUfreq policy governor 'powersave'");
59MODULE_LICENSE("GPL"); 59MODULE_LICENSE("GPL");
60 60
61#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE
62fs_initcall(cpufreq_gov_powersave_init);
63#else
61module_init(cpufreq_gov_powersave_init); 64module_init(cpufreq_gov_powersave_init);
65#endif
62module_exit(cpufreq_gov_powersave_exit); 66module_exit(cpufreq_gov_powersave_exit);
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index a881fd62c447..e7e91dbfde0f 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -308,6 +308,9 @@ extern struct cpufreq_governor cpufreq_gov_performance;
308#endif 308#endif
309#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE 309#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE
310#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_performance) 310#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_performance)
311#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE)
312extern struct cpufreq_governor cpufreq_gov_powersave;
313#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_powersave)
311#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE) 314#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE)
312extern struct cpufreq_governor cpufreq_gov_userspace; 315extern struct cpufreq_governor cpufreq_gov_userspace;
313#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_userspace) 316#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_userspace)