cpufreq_performance.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * linux/drivers/cpufreq/cpufreq_performance.c
  4. *
  5. * Copyright (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de>
  6. */
  7. #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  8. #include <linux/cpufreq.h>
  9. #include <linux/init.h>
  10. #include <linux/module.h>
  11. static void cpufreq_gov_performance_limits(struct cpufreq_policy *policy)
  12. {
  13. pr_debug("setting to %u kHz\n", policy->max);
  14. __cpufreq_driver_target(policy, policy->max, CPUFREQ_RELATION_H);
  15. }
  16. static struct cpufreq_governor cpufreq_gov_performance = {
  17. .name = "performance",
  18. .owner = THIS_MODULE,
  19. .flags = CPUFREQ_GOV_STRICT_TARGET,
  20. .limits = cpufreq_gov_performance_limits,
  21. };
  22. #ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE
  23. struct cpufreq_governor *cpufreq_default_governor(void)
  24. {
  25. return &cpufreq_gov_performance;
  26. }
  27. #endif
  28. #ifndef CONFIG_CPU_FREQ_GOV_PERFORMANCE_MODULE
  29. struct cpufreq_governor *cpufreq_fallback_governor(void)
  30. {
  31. return &cpufreq_gov_performance;
  32. }
  33. #endif
  34. MODULE_AUTHOR("Dominik Brodowski <linux@brodo.de>");
  35. MODULE_DESCRIPTION("CPUfreq policy governor 'performance'");
  36. MODULE_LICENSE("GPL");
  37. cpufreq_governor_init(cpufreq_gov_performance);
  38. cpufreq_governor_exit(cpufreq_gov_performance);