Skip to content

Commit

Permalink
[CPUFREQ] allow use of the powersave governor as the default one
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alessandro Guido authored and Dave Jones committed Apr 28, 2008
1 parent 605400a commit 30d221d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
9 changes: 9 additions & 0 deletions drivers/cpufreq/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions drivers/cpufreq/cpufreq_powersave.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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);
3 changes: 3 additions & 0 deletions include/linux/cpufreq.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 30d221d

Please sign in to comment.