Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  *  linux/drivers/cpufreq/cpufreq_performance.c
0004  *
0005  *  Copyright (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de>
0006  */
0007 
0008 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
0009 
0010 #include <linux/cpufreq.h>
0011 #include <linux/init.h>
0012 #include <linux/module.h>
0013 
0014 static void cpufreq_gov_performance_limits(struct cpufreq_policy *policy)
0015 {
0016     pr_debug("setting to %u kHz\n", policy->max);
0017     __cpufreq_driver_target(policy, policy->max, CPUFREQ_RELATION_H);
0018 }
0019 
0020 static struct cpufreq_governor cpufreq_gov_performance = {
0021     .name       = "performance",
0022     .owner      = THIS_MODULE,
0023     .flags      = CPUFREQ_GOV_STRICT_TARGET,
0024     .limits     = cpufreq_gov_performance_limits,
0025 };
0026 
0027 #ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE
0028 struct cpufreq_governor *cpufreq_default_governor(void)
0029 {
0030     return &cpufreq_gov_performance;
0031 }
0032 #endif
0033 #ifndef CONFIG_CPU_FREQ_GOV_PERFORMANCE_MODULE
0034 struct cpufreq_governor *cpufreq_fallback_governor(void)
0035 {
0036     return &cpufreq_gov_performance;
0037 }
0038 #endif
0039 
0040 MODULE_AUTHOR("Dominik Brodowski <linux@brodo.de>");
0041 MODULE_DESCRIPTION("CPUfreq policy governor 'performance'");
0042 MODULE_LICENSE("GPL");
0043 
0044 cpufreq_governor_init(cpufreq_gov_performance);
0045 cpufreq_governor_exit(cpufreq_gov_performance);