From d9619b4709496273d3b1f73ea72ead643c744374 Mon Sep 17 00:00:00 2001 From: Octav Zlatior Date: Wed, 27 May 2015 18:02:27 +0200 Subject: cpufreq: adds custom sampling-rate support in dt This allows the setting of a sampling-rate property for a cpu in the device-tree; if set, this will override the defaut sampling rate calculation Signed-off-by: Octav Zlatior Signed-off-by: Christoph Muellner --- drivers/cpufreq/cpufreq_governor.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'drivers/cpufreq/cpufreq_governor.c') diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c index 1b44496b2d2b..53d06df86310 100644 --- a/drivers/cpufreq/cpufreq_governor.c +++ b/drivers/cpufreq/cpufreq_governor.c @@ -303,11 +303,16 @@ int cpufreq_governor_dbs(struct cpufreq_policy *policy, if (latency == 0) latency = 1; + sampling_rate = policy->cpuinfo.sampling_rate; + + if (sampling_rate == 0) + sampling_rate = latency * LATENCY_MULTIPLIER; + /* Bring kernel and HW constraints together */ dbs_data->min_sampling_rate = max(dbs_data->min_sampling_rate, MIN_LATENCY_MULTIPLIER * latency); set_sampling_rate(dbs_data, max(dbs_data->min_sampling_rate, - latency * LATENCY_MULTIPLIER)); + sampling_rate)); if ((cdata->governor == GOV_CONSERVATIVE) && (!policy->governor->initialized)) { -- cgit v1.2.3