1 // SPDX-License-Identifier: GPL-2.0-only
3 * linux/drivers/devfreq/governor_performance.c
5 * Copyright (C) 2011 Samsung Electronics
6 * MyungJoo Ham <myungjoo.ham@samsung.com>
9 #include <linux/devfreq.h>
10 #include <linux/module.h>
13 static int devfreq_performance_func(struct devfreq
*df
,
17 * target callback should be able to get floor value as
20 *freq
= DEVFREQ_MAX_FREQ
;
24 static int devfreq_performance_handler(struct devfreq
*devfreq
,
25 unsigned int event
, void *data
)
29 if (event
== DEVFREQ_GOV_START
) {
30 mutex_lock(&devfreq
->lock
);
31 ret
= update_devfreq(devfreq
);
32 mutex_unlock(&devfreq
->lock
);
38 static struct devfreq_governor devfreq_performance
= {
39 .name
= DEVFREQ_GOV_PERFORMANCE
,
40 .get_target_freq
= devfreq_performance_func
,
41 .event_handler
= devfreq_performance_handler
,
44 static int __init
devfreq_performance_init(void)
46 return devfreq_add_governor(&devfreq_performance
);
48 subsys_initcall(devfreq_performance_init
);
50 static void __exit
devfreq_performance_exit(void)
54 ret
= devfreq_remove_governor(&devfreq_performance
);
56 pr_err("%s: failed remove governor %d\n", __func__
, ret
);
60 module_exit(devfreq_performance_exit
);
61 MODULE_LICENSE("GPL");