From patchwork Fri Sep 13 13:01:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20219 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AE97020358 for ; Fri, 13 Sep 2013 13:22:40 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id z20sf1248572yhz.7 for ; Fri, 13 Sep 2013 06:22:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=ne0KySgEieFbij+zKqP6Bx1FvOIFOaf9SvUN/wCT0Dw=; b=EXzaxEGMs99Xb+2tvSNSl26VgL3LG0AohVN7udLeSaIZI/adGAZoufpQrgapfqzvey 8Y/O5ThyAMbztJGNoHECBzhMg53oQJE68fLlO/Yb0uGQO/lWzweN9qGW5Nl3+H48/Kub L+yTIQB56O6dxrFTo+60Km1vS1pXsUppymJN1xbgVmEGxjUl7brdspsEcXgzKumEudfE lLmz1/pubjr7g89UmhpcUYecNIdzTi5lz4wrtCfzruWkfSV7cqivUFmgCD2Ly1JsXrK5 +uEJ55JoK0LNxDdQgc4u5a9XF7P+/bHa+qd84/1L0ynT+qDA6ZvK0O6nP2lMe0OoBO33 6htQ== X-Gm-Message-State: ALoCoQkN5hh59Z7HqmSloixDcEaswXF7oh+zSRhZzfg9PbhTGksjI/9BuYFisHBOfEz2Tb3J8X1Z X-Received: by 10.236.54.68 with SMTP id h44mr4974741yhc.21.1379078560461; Fri, 13 Sep 2013 06:22:40 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.29.229 with SMTP id n5ls1103916qeh.73.gmail; Fri, 13 Sep 2013 06:22:40 -0700 (PDT) X-Received: by 10.58.161.116 with SMTP id xr20mr11985331veb.2.1379078560208; Fri, 13 Sep 2013 06:22:40 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id sn2si3102808vec.140.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:22:40 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id lf11so902776vcb.21 for ; Fri, 13 Sep 2013 06:22:40 -0700 (PDT) X-Received: by 10.52.119.228 with SMTP id kx4mr10062227vdb.12.1379078560100; Fri, 13 Sep 2013 06:22:40 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp80465vcz; Fri, 13 Sep 2013 06:22:39 -0700 (PDT) X-Received: by 10.66.142.230 with SMTP id rz6mr15452390pab.117.1379078559248; Fri, 13 Sep 2013 06:22:39 -0700 (PDT) Received: from mail-pb0-f48.google.com (mail-pb0-f48.google.com [209.85.160.48]) by mx.google.com with ESMTPS id xx2si11260076pac.53.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:22:39 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.48 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.48; Received: by mail-pb0-f48.google.com with SMTP id ma3so1225111pbc.35 for ; Fri, 13 Sep 2013 06:22:38 -0700 (PDT) X-Received: by 10.66.25.133 with SMTP id c5mr15247703pag.4.1379078558857; Fri, 13 Sep 2013 06:22:38 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id oh2sm11767552pbb.3.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:22:38 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Viresh Kumar , Santosh Shilimkar Subject: [PATCH 165/228] cpufreq: omap: Convert to light weight ->target_index() routine Date: Fri, 13 Sep 2013 18:31:51 +0530 Message-Id: <802719c38c9051e0ade847081f29b01d47c546aa.1379063063.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch converts existing .target() to newly defined light weight .target_index() routine for this driver. CPUFreq core will call cpufreq_frequency_table_target() before calling this routine and will pass index to it. Cc: Santosh Shilimkar Signed-off-by: Viresh Kumar --- drivers/cpufreq/omap-cpufreq.c | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c index 58b2200..0653887 100644 --- a/drivers/cpufreq/omap-cpufreq.c +++ b/drivers/cpufreq/omap-cpufreq.c @@ -51,40 +51,15 @@ static unsigned int omap_getspeed(unsigned int cpu) return rate; } -static int omap_target(struct cpufreq_policy *policy, - unsigned int target_freq, - unsigned int relation) +static int omap_target(struct cpufreq_policy *policy, unsigned int index) { - unsigned int i; int r, ret = 0; struct cpufreq_freqs freqs; struct opp *opp; unsigned long freq, volt = 0, volt_old = 0, tol = 0; - if (!freq_table) { - dev_err(mpu_dev, "%s: cpu%d: no freq table!\n", __func__, - policy->cpu); - return -EINVAL; - } - - ret = cpufreq_frequency_table_target(policy, freq_table, target_freq, - relation, &i); - if (ret) { - dev_dbg(mpu_dev, "%s: cpu%d: no freq match for %d(ret=%d)\n", - __func__, policy->cpu, target_freq, ret); - return ret; - } - freqs.new = freq_table[i].frequency; - if (!freqs.new) { - dev_err(mpu_dev, "%s: cpu%d: no match for freq %d\n", __func__, - policy->cpu, target_freq); - return -EINVAL; - } - freqs.old = omap_getspeed(policy->cpu); - - if (freqs.old == freqs.new && policy->cur == freqs.new) - return ret; + freqs.new = freq_table[index].frequency; freq = freqs.new * 1000; ret = clk_round_rate(mpu_clk, freq); @@ -200,7 +175,7 @@ static int omap_cpu_exit(struct cpufreq_policy *policy) static struct cpufreq_driver omap_driver = { .flags = CPUFREQ_STICKY, .verify = cpufreq_generic_frequency_table_verify, - .target = omap_target, + .target_index = omap_target, .get = omap_getspeed, .init = omap_cpu_init, .exit = omap_cpu_exit,