diff options
author | Lukasz Majewski <l.majewski@samsung.com> | 2014-02-27 13:35:03 +0100 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-11-18 11:47:09 +0900 |
commit | 9e98f93db938d698248aac7c99cab531fe3e2dad (patch) | |
tree | 07305c781fe2a62232946b984c2b6e6217d18910 /drivers/cpufreq | |
parent | 7d506c40f7568eac82aa7a1662b26b036deed292 (diff) | |
download | linux-3.10-9e98f93db938d698248aac7c99cab531fe3e2dad.tar.gz linux-3.10-9e98f93db938d698248aac7c99cab531fe3e2dad.tar.bz2 linux-3.10-9e98f93db938d698248aac7c99cab531fe3e2dad.zip |
cpufreq:LAB:ondemand: Enable usage of ONDEMAND specific methods at LAB governor
Two methods from ondemand, namely store_sampling_rate() and od_check_cpu()
are now utilized in LAB governor.
Moreover the od_cpu_dbs_info_s structure shall be regarded as a common one.
Therefore in LAB only its declaration is necessary.
Change-Id: I3408b2f8cfdb292cd69568c931da46d8f957099c
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/cpufreq_lab.c | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/drivers/cpufreq/cpufreq_lab.c b/drivers/cpufreq/cpufreq_lab.c index 8939a6ebe99..76f6b204d09 100644 --- a/drivers/cpufreq/cpufreq_lab.c +++ b/drivers/cpufreq/cpufreq_lab.c @@ -51,7 +51,7 @@ static int lb_ctrl_table_size, lb_num_of_states; static bool boost_init_state; static DECLARE_BITMAP(boost_hist, MAX_HIST); -static DEFINE_PER_CPU(struct od_cpu_dbs_info_s, od_cpu_dbs_info); +DECLARE_PER_CPU(struct od_cpu_dbs_info_s, od_cpu_dbs_info); struct cpufreq_governor cpufreq_gov_lab; @@ -178,6 +178,10 @@ static void lb_check_cpu(int cpu, unsigned int load) freq = policy->min; break; + case LB_ONDEMAND: + od_check_cpu(cpu, load); + return; + default: freq = op; } @@ -244,10 +248,44 @@ static ssize_t store_idle_threshold(struct kobject *a, struct attribute *b, } define_one_global_rw(idle_threshold); +ssize_t store_sampling_rate(struct kobject *a, struct attribute *b, + const char *buf, size_t count) +{ + struct dbs_data *dbs_data = lb_dbs_cdata.gdbs_data; + unsigned int input; + int ret; + ret = sscanf(buf, "%u", &input); + if (ret != 1) + return -EINVAL; + + update_sampling_rate(dbs_data, input); + return count; +} + +static ssize_t show_sampling_rate(struct kobject *kobj, struct attribute *attr, + char *buf) +{ + struct od_dbs_tuners *tuners = lb_dbs_cdata.gdbs_data->tuners; + + return sprintf(buf, "%u\n", tuners->sampling_rate); +} +define_one_global_rw(sampling_rate); + +static ssize_t show_sampling_rate_min(struct kobject *kobj, + struct attribute *attr, char *buf) +{ + struct dbs_data *dbs_data = lb_dbs_cdata.gdbs_data; + + return sprintf(buf, "%u\n", dbs_data->min_sampling_rate); +} +define_one_global_ro(sampling_rate_min); + static struct attribute *dbs_attributes_gov_sys[] = { + &sampling_rate_min.attr, &idle_avg_cpus_val.attr, &idle_threshold.attr, &idle_cpus_num.attr, + &sampling_rate.attr, &load.attr, NULL }; |