diff options
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 86e69b7f9122..56c433e64d58 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -1274,6 +1274,26 @@ int cpufreq_driver_target(struct cpufreq_policy *policy, | |||
1274 | } | 1274 | } |
1275 | EXPORT_SYMBOL_GPL(cpufreq_driver_target); | 1275 | EXPORT_SYMBOL_GPL(cpufreq_driver_target); |
1276 | 1276 | ||
1277 | int cpufreq_driver_getavg(struct cpufreq_policy *policy) | ||
1278 | { | ||
1279 | int ret = 0; | ||
1280 | |||
1281 | policy = cpufreq_cpu_get(policy->cpu); | ||
1282 | if (!policy) | ||
1283 | return -EINVAL; | ||
1284 | |||
1285 | mutex_lock(&policy->lock); | ||
1286 | |||
1287 | if (cpu_online(policy->cpu) && cpufreq_driver->getavg) | ||
1288 | ret = cpufreq_driver->getavg(policy->cpu); | ||
1289 | |||
1290 | mutex_unlock(&policy->lock); | ||
1291 | |||
1292 | cpufreq_cpu_put(policy); | ||
1293 | return ret; | ||
1294 | } | ||
1295 | EXPORT_SYMBOL_GPL(cpufreq_driver_getavg); | ||
1296 | |||
1277 | /* | 1297 | /* |
1278 | * Locking: Must be called with the lock_cpu_hotplug() lock held | 1298 | * Locking: Must be called with the lock_cpu_hotplug() lock held |
1279 | * when "event" is CPUFREQ_GOV_LIMITS | 1299 | * when "event" is CPUFREQ_GOV_LIMITS |