diff options
author | Vincent Guittot <vincent.guittot@stericsson.com> | 2011-04-11 14:36:31 +0200 |
---|---|---|
committer | Henrik Aberg <henrik.aberg@stericsson.com> | 2011-05-18 09:40:11 +0200 |
commit | c7607aa48335420e3a53178b4ad9152a32af84e0 (patch) | |
tree | c18146b3b7b79f57f6ecfd85e3a85e531f5fe644 /drivers/cpufreq | |
parent | 43e1416bd4df2bb560c3d8c6d3b2f2cd0b264c83 (diff) |
cpufreq: add interface for updating frequency limits
ST-Ericsson ID: 337167
Change-Id: I4f66b7b46f1b20d955ce1b2a18b1ba9ece443a28
Signed-off-by: Vincent Guittot <vincent.guittot@stericsson.com>
Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/21970
Reviewed-by: QATEST
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 0f17ad8585d..c4671b40ae5 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -464,6 +464,27 @@ show_one(scaling_cur_freq, cur); static int __cpufreq_set_policy(struct cpufreq_policy *data, struct cpufreq_policy *policy); +int cpufreq_update_freq(int cpu, unsigned int min, unsigned int max) +{ + int ret; + struct cpufreq_policy new_policy; + struct cpufreq_policy *policy = cpufreq_cpu_get(cpu); + + ret = cpufreq_get_policy(&new_policy, cpu); + if (ret) + return -EINVAL; + + new_policy.min = min; + new_policy.max = max; + + ret = __cpufreq_set_policy(policy, &new_policy); + policy->user_policy.min = policy->min; + policy->user_policy.max = policy->max; + + return 0; +} +EXPORT_SYMBOL(cpufreq_update_freq); + /** * cpufreq_per_cpu_attr_write() / store_##file_name() - sysfs write access */ |