mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
cpu_input_boost: Expose input freqs and duration to userspace
Users like to change stuff and it's useful to tie it in with my Performance Profiles and it's faster to test new configurations than recompiling the whole thing and flash every time. Change-Id: Iccebb05ea79d5a09b544d16084051cca7d606987 Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com> Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This commit is contained in:
parent
0fef46c3e1
commit
1e00290bcd
@ -10,8 +10,17 @@
|
||||
#include <linux/msm_drm_notify.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/kthread.h>
|
||||
#include <linux/version.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/version.h>
|
||||
|
||||
static unsigned int input_boost_freq_lp = CONFIG_INPUT_BOOST_FREQ_LP;
|
||||
static unsigned int input_boost_freq_hp = CONFIG_INPUT_BOOST_FREQ_PERF;
|
||||
static unsigned short input_boost_duration = CONFIG_INPUT_BOOST_DURATION_MS;
|
||||
|
||||
module_param(input_boost_freq_lp, uint, 0644);
|
||||
module_param(input_boost_freq_hp, uint, 0644);
|
||||
module_param(input_boost_duration, short, 0644);
|
||||
|
||||
/* The sched_param struct is located elsewhere in newer kernels */
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
|
||||
@ -51,9 +60,9 @@ static unsigned int get_input_boost_freq(struct cpufreq_policy *policy)
|
||||
unsigned int freq;
|
||||
|
||||
if (cpumask_test_cpu(policy->cpu, cpu_lp_mask))
|
||||
freq = max(CONFIG_INPUT_BOOST_FREQ_LP, CONFIG_MIN_FREQ_LP);
|
||||
freq = max(input_boost_freq_lp, (unsigned int)CONFIG_MIN_FREQ_LP);
|
||||
else
|
||||
freq = max(CONFIG_INPUT_BOOST_FREQ_PERF, CONFIG_MIN_FREQ_PERF);
|
||||
freq = max(input_boost_freq_hp, (unsigned int)CONFIG_MIN_FREQ_PERF);
|
||||
|
||||
return min(freq, policy->max);
|
||||
}
|
||||
@ -101,7 +110,7 @@ static void __cpu_input_boost_kick(struct boost_drv *b)
|
||||
|
||||
set_bit(INPUT_BOOST, &b->state);
|
||||
if (!mod_delayed_work(system_unbound_wq, &b->input_unboost,
|
||||
msecs_to_jiffies(CONFIG_INPUT_BOOST_DURATION_MS)))
|
||||
msecs_to_jiffies(input_boost_duration)))
|
||||
wake_up(&b->boost_waitq);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user