@@ -56,6 +56,7 @@ struct cpufreq_dom {
};
static LIST_HEAD_READ_MOSTLY(cpufreq_dom_list_head);
+bool __initdata cpufreq_governor_internal;
struct cpufreq_governor *__read_mostly cpufreq_opt_governor;
LIST_HEAD_READ_MOSTLY(cpufreq_governor_list);
@@ -120,6 +120,9 @@ static int __init cf_check cpufreq_gov_userspace_init(void)
{
unsigned int cpu;
+ if ( cpufreq_governor_internal )
+ return 0;
+
for_each_online_cpu(cpu)
per_cpu(cpu_set_freq, cpu) = userspace_cmdline_freq;
register_cpu_notifier(&cpufreq_userspace_cpu_nfb);
@@ -162,6 +165,9 @@ struct cpufreq_governor cpufreq_gov_performance = {
static int __init cf_check cpufreq_gov_performance_init(void)
{
+ if ( cpufreq_governor_internal )
+ return 0;
+
return cpufreq_register_governor(&cpufreq_gov_performance);
}
__initcall(cpufreq_gov_performance_init);
@@ -201,6 +207,9 @@ struct cpufreq_governor cpufreq_gov_powersave = {
static int __init cf_check cpufreq_gov_powersave_init(void)
{
+ if ( cpufreq_governor_internal )
+ return 0;
+
return cpufreq_register_governor(&cpufreq_gov_powersave);
}
__initcall(cpufreq_gov_powersave_init);
@@ -360,6 +360,9 @@ struct cpufreq_governor cpufreq_gov_dbs = {
static int __init cf_check cpufreq_gov_dbs_init(void)
{
+ if ( cpufreq_governor_internal )
+ return 0;
+
return cpufreq_register_governor(&cpufreq_gov_dbs);
}
__initcall(cpufreq_gov_dbs_init);
@@ -116,6 +116,8 @@ extern struct cpufreq_governor cpufreq_gov_powersave;
extern struct list_head cpufreq_governor_list;
+extern bool cpufreq_governor_internal;
+
extern int cpufreq_register_governor(struct cpufreq_governor *governor);
extern struct cpufreq_governor *__find_governor(const char *governor);
#define CPUFREQ_DEFAULT_GOVERNOR &cpufreq_gov_dbs