From patchwork Mon Aug 12 17:48:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19029 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f200.google.com (mail-ye0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 063AB246B8 for ; Mon, 12 Aug 2013 17:51:49 +0000 (UTC) Received: by mail-ye0-f200.google.com with SMTP id r13sf7978706yen.7 for ; Mon, 12 Aug 2013 10:51:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state: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=45TIT2qnEwj0+c15abqS8+m1t58fsVDxgsxqLjqqMKE=; b=pQrVGot31KixOAtITowjxJ03iSFn6/wRDOTe4PdjSAh9OzN19E1DFVY8n733/slSqO Jc2bM+V9Gf9ekeDyZpGmKB1owx7EjI2JOh37NbT1rQyPxSzGTjFxLASuLKPbA8koVrDS 7EuqweCZBvMGNpIE1ZCMXfdYvzVvgKkK81RKpvnLfuXmm+0cxLkx3B9x7beFu54n01J6 3fxDmdz6tNwfrnDE245KHRb7bOLAebrh4brEpf67V85m0Wk2dty9dmN+kgLPCzIFl4Bs aTx/HiJK7EP64ugT3ykhM1tkBfs+nbxFSPbBPtyPyDEmY2EuJ9Yeez+BLKTaH7bbSC2H 6iyQ== X-Received: by 10.236.79.67 with SMTP id h43mr60229yhe.46.1376329908737; Mon, 12 Aug 2013 10:51:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.18.199 with SMTP id y7ls2383595qed.78.gmail; Mon, 12 Aug 2013 10:51:48 -0700 (PDT) X-Received: by 10.220.95.201 with SMTP id e9mr142190vcn.71.1376329908592; Mon, 12 Aug 2013 10:51:48 -0700 (PDT) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx.google.com with ESMTPS id ey4si8584292vcb.122.2013.08.12.10.51.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:51:48 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.179; Received: by mail-ve0-f179.google.com with SMTP id c13so5855695vea.24 for ; Mon, 12 Aug 2013 10:51:48 -0700 (PDT) X-Gm-Message-State: ALoCoQnpMNz+xxJIlZoGy5a3QCZu7jRkcRWXJD54UY35OFVbBZHxh7IqRXrQPUQIhY9VfsI2I0BL X-Received: by 10.52.35.98 with SMTP id g2mr135013vdj.0.1376329908509; Mon, 12 Aug 2013 10:51:48 -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 u4csp108266vcz; Mon, 12 Aug 2013 10:51:48 -0700 (PDT) X-Received: by 10.68.160.193 with SMTP id xm1mr247651pbb.88.1376329907704; Mon, 12 Aug 2013 10:51:47 -0700 (PDT) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by mx.google.com with ESMTPS id or6si23299874pac.218.2013.08.12.10.51.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:51:47 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.52 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.52; Received: by mail-pa0-f52.google.com with SMTP id kq13so7781763pab.25 for ; Mon, 12 Aug 2013 10:51:47 -0700 (PDT) X-Received: by 10.66.227.2 with SMTP id rw2mr233840pac.131.1376329907259; Mon, 12 Aug 2013 10:51:47 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id vz4sm4942757pab.11.2013.08.12.10.51.42 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:51:46 -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, Viresh Kumar , Santosh Shilimkar Subject: [PATCH 19/31] cpufreq: omap: Covert to light weight ->target() routine Date: Mon, 12 Aug 2013 23:18:55 +0530 Message-Id: <8e4f5327604cc916e3f6563bb91d389b0f98b863.1376329128.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.128.179 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_old() to newly defined light weight .target() 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 86b2910..99a9d0c 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); @@ -223,7 +198,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_old = omap_target, + .target = omap_target, .get = omap_getspeed, .init = omap_cpu_init, .exit = omap_cpu_exit,