12 #include <linux/errno.h>
17 #define DFSO_UPTHRESHOLD (90)
18 #define DFSO_DOWNDIFFERENCTIAL (5)
19 static int devfreq_simple_ondemand_func(
struct devfreq *
df,
24 unsigned long long a,
b;
27 struct devfreq_simple_ondemand_data *
data = df->
data;
34 if (data->upthreshold)
35 dfso_upthreshold = data->upthreshold;
36 if (data->downdifferential)
37 dfso_downdifferential = data->downdifferential;
39 if (dfso_upthreshold > 100 ||
40 dfso_upthreshold < dfso_downdifferential)
70 stat.
total_time * (dfso_upthreshold - dfso_downdifferential)) {
80 b = div_u64(b, (dfso_upthreshold - dfso_downdifferential / 2));
81 *freq = (
unsigned long) b;
83 if (df->
min_freq && *freq < df->min_freq)
92 .name =
"simple_ondemand",
93 .get_target_freq = devfreq_simple_ondemand_func,