]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blame - drivers/devfreq/governor_performance.c
Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
[mirror_ubuntu-hirsute-kernel.git] / drivers / devfreq / governor_performance.c
CommitLineData
d2912cb1 1// SPDX-License-Identifier: GPL-2.0-only
ce26c5bb
MH
2/*
3 * linux/drivers/devfreq/governor_performance.c
4 *
5 * Copyright (C) 2011 Samsung Electronics
6 * MyungJoo Ham <myungjoo.ham@samsung.com>
ce26c5bb
MH
7 */
8
9#include <linux/devfreq.h>
eff607fd 10#include <linux/module.h>
0b7c328f 11#include "governor.h"
ce26c5bb
MH
12
13static int devfreq_performance_func(struct devfreq *df,
14 unsigned long *freq)
15{
16 /*
17 * target callback should be able to get floor value as
18 * said in devfreq.h
19 */
6ff66e2a 20 *freq = DEVFREQ_MAX_FREQ;
ce26c5bb
MH
21 return 0;
22}
23
7e6fdd4b
RV
24static int devfreq_performance_handler(struct devfreq *devfreq,
25 unsigned int event, void *data)
0b7c328f 26{
7e6fdd4b
RV
27 int ret = 0;
28
29 if (event == DEVFREQ_GOV_START) {
30 mutex_lock(&devfreq->lock);
31 ret = update_devfreq(devfreq);
32 mutex_unlock(&devfreq->lock);
33 }
34
35 return ret;
0b7c328f
XC
36}
37
1b5c1be2 38static struct devfreq_governor devfreq_performance = {
aa7c352f 39 .name = DEVFREQ_GOV_PERFORMANCE,
ce26c5bb 40 .get_target_freq = devfreq_performance_func,
7e6fdd4b 41 .event_handler = devfreq_performance_handler,
ce26c5bb 42};
83116e66
NM
43
44static int __init devfreq_performance_init(void)
45{
46 return devfreq_add_governor(&devfreq_performance);
47}
48subsys_initcall(devfreq_performance_init);
49
50static void __exit devfreq_performance_exit(void)
51{
52 int ret;
53
54 ret = devfreq_remove_governor(&devfreq_performance);
55 if (ret)
56 pr_err("%s: failed remove governor %d\n", __func__, ret);
57
58 return;
59}
60module_exit(devfreq_performance_exit);
eff607fd 61MODULE_LICENSE("GPL");