]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - drivers/cpufreq/cpufreq_performance.c
media: dvb_ca_en50221: prevent using slot_info for Spectre attacs
[mirror_ubuntu-bionic-kernel.git] / drivers / cpufreq / cpufreq_performance.c
CommitLineData
1da177e4
LT
1/*
2 * linux/drivers/cpufreq/cpufreq_performance.c
3 *
4 * Copyright (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de>
5 *
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
12
db701151
VK
13#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
14
1da177e4
LT
15#include <linux/cpufreq.h>
16#include <linux/init.h>
5ff0a268 17#include <linux/module.h>
1da177e4 18
e788892b 19static void cpufreq_gov_performance_limits(struct cpufreq_policy *policy)
1da177e4 20{
e788892b
RW
21 pr_debug("setting to %u kHz\n", policy->max);
22 __cpufreq_driver_target(policy, policy->max, CPUFREQ_RELATION_H);
1da177e4 23}
32ee8c3e 24
de1df26b 25static struct cpufreq_governor cpufreq_gov_performance = {
1da177e4 26 .name = "performance",
1da177e4 27 .owner = THIS_MODULE,
e788892b 28 .limits = cpufreq_gov_performance_limits,
1da177e4 29};
1da177e4 30
1da177e4
LT
31static int __init cpufreq_gov_performance_init(void)
32{
33 return cpufreq_register_governor(&cpufreq_gov_performance);
34}
35
1da177e4
LT
36static void __exit cpufreq_gov_performance_exit(void)
37{
38 cpufreq_unregister_governor(&cpufreq_gov_performance);
39}
40
de1df26b
RW
41#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE
42struct cpufreq_governor *cpufreq_default_governor(void)
43{
44 return &cpufreq_gov_performance;
45}
46#endif
47#ifndef CONFIG_CPU_FREQ_GOV_PERFORMANCE_MODULE
48struct cpufreq_governor *cpufreq_fallback_governor(void)
49{
50 return &cpufreq_gov_performance;
51}
52#endif
53
1da177e4
LT
54MODULE_AUTHOR("Dominik Brodowski <linux@brodo.de>");
55MODULE_DESCRIPTION("CPUfreq policy governor 'performance'");
56MODULE_LICENSE("GPL");
57
58fs_initcall(cpufreq_gov_performance_init);
59module_exit(cpufreq_gov_performance_exit);