hc
2024-02-19 1c055e55a242a33e574e48be530e06770a210dcd
kernel/drivers/devfreq/governor_simpleondemand.c
....@@ -1,12 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/drivers/devfreq/governor_simpleondemand.c
34 *
45 * Copyright (C) 2011 Samsung Electronics
56 * MyungJoo Ham <myungjoo.ham@samsung.com>
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.
107 */
118
129 #include <linux/errno.h>
....@@ -27,7 +24,6 @@
2724 unsigned int dfso_upthreshold = DFSO_UPTHRESHOLD;
2825 unsigned int dfso_downdifferential = DFSO_DOWNDIFFERENCTIAL;
2926 struct devfreq_simple_ondemand_data *data = df->data;
30
- unsigned long min = (df->min_freq) ? df->min_freq : DEVFREQ_MIN_FREQ;
3127
3228 err = devfreq_update_stats(df);
3329 if (err)
....@@ -45,28 +41,16 @@
4541 dfso_upthreshold < dfso_downdifferential)
4642 return -EINVAL;
4743
48
- /* Prevent overflow */
49
- if (stat->busy_time >= (1 << 24) || stat->total_time >= (1 << 24)) {
50
- stat->busy_time >>= 7;
51
- stat->total_time >>= 7;
52
- }
53
-
54
- if (data && data->simple_scaling) {
55
- if (stat->busy_time * 100 >
56
- stat->total_time * dfso_upthreshold)
57
- *freq = DEVFREQ_MAX_FREQ;
58
- else if (stat->busy_time * 100 <
59
- stat->total_time * dfso_downdifferential)
60
- *freq = min;
61
- else
62
- *freq = df->previous_freq;
63
- return 0;
64
- }
65
-
6644 /* Assume MAX if it is going to be divided by zero */
6745 if (stat->total_time == 0) {
6846 *freq = DEVFREQ_MAX_FREQ;
6947 return 0;
48
+ }
49
+
50
+ /* Prevent overflow */
51
+ if (stat->busy_time >= (1 << 24) || stat->total_time >= (1 << 24)) {
52
+ stat->busy_time >>= 7;
53
+ stat->total_time >>= 7;
7054 }
7155
7256 /* Set MAX if it's busy enough */
....@@ -112,8 +96,8 @@
11296 devfreq_monitor_stop(devfreq);
11397 break;
11498
115
- case DEVFREQ_GOV_INTERVAL:
116
- devfreq_interval_update(devfreq, (unsigned int *)data);
99
+ case DEVFREQ_GOV_UPDATE_INTERVAL:
100
+ devfreq_update_interval(devfreq, (unsigned int *)data);
117101 break;
118102
119103 case DEVFREQ_GOV_SUSPEND: