Path: blob/master/drivers/cpufreq/cpufreq_performance.c
15109 views
/*1* linux/drivers/cpufreq/cpufreq_performance.c2*3* Copyright (C) 2002 - 2003 Dominik Brodowski <[email protected]>4*5*6* This program is free software; you can redistribute it and/or modify7* it under the terms of the GNU General Public License version 2 as8* published by the Free Software Foundation.9*10*/1112#include <linux/kernel.h>13#include <linux/module.h>14#include <linux/cpufreq.h>15#include <linux/init.h>161718static int cpufreq_governor_performance(struct cpufreq_policy *policy,19unsigned int event)20{21switch (event) {22case CPUFREQ_GOV_START:23case CPUFREQ_GOV_LIMITS:24pr_debug("setting to %u kHz because of event %u\n",25policy->max, event);26__cpufreq_driver_target(policy, policy->max,27CPUFREQ_RELATION_H);28break;29default:30break;31}32return 0;33}3435#ifdef CONFIG_CPU_FREQ_GOV_PERFORMANCE_MODULE36static37#endif38struct cpufreq_governor cpufreq_gov_performance = {39.name = "performance",40.governor = cpufreq_governor_performance,41.owner = THIS_MODULE,42};434445static int __init cpufreq_gov_performance_init(void)46{47return cpufreq_register_governor(&cpufreq_gov_performance);48}495051static void __exit cpufreq_gov_performance_exit(void)52{53cpufreq_unregister_governor(&cpufreq_gov_performance);54}555657MODULE_AUTHOR("Dominik Brodowski <[email protected]>");58MODULE_DESCRIPTION("CPUfreq policy governor 'performance'");59MODULE_LICENSE("GPL");6061fs_initcall(cpufreq_gov_performance_init);62module_exit(cpufreq_gov_performance_exit);636465