From patchwork Tue Aug 13 13:32:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19070 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DF87A246B8 for ; Tue, 13 Aug 2013 13:35:03 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id 15sf9226023vea.9 for ; Tue, 13 Aug 2013 06:35:03 -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=IxdBXIUsGHR2+cKy1C1hpqSmsi1a7J3iwHOcEeOQwmU=; b=kRvGqyLjjgBsqV0n09/r9OJiggAuA62krf9l/nFI1U78DafyGhc/reSdsk/fXsVsNO 8B5TU/TKooSQ88QVVOBDbDeQy3XzbNqyby1B4+84489KeEHhVVvHszcqf0kJJkI71vTZ X2SicS6gTUyrfX1rLZCGQYXDRqASDNMUBBKPOxtSqN5Cf9SiUqwKNawG/Rf039MYPaBo cc/A/UHuUMk/myk3WCjPtYPNFZyfnvOkoQOaXFfnq3i5ZWeFRx7kDvTdDo485i9Z+Y9F r9TDHSlfHRvVKRDapIdWtDcFyJdqdCcpjOAXwb85aFnCtuRh1T2ujmy7wy1DMPyMx5z0 blag== X-Received: by 10.236.147.50 with SMTP id s38mr1627051yhj.44.1376400903552; Tue, 13 Aug 2013 06:35:03 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.105.225 with SMTP id gp1ls2576901qeb.55.gmail; Tue, 13 Aug 2013 06:35:03 -0700 (PDT) X-Received: by 10.58.127.202 with SMTP id ni10mr4399495veb.27.1376400903390; Tue, 13 Aug 2013 06:35:03 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id fa1si9742383ved.127.2013.08.13.06.35.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:35:03 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.171 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.171; Received: by mail-vc0-f171.google.com with SMTP id ij15so3892642vcb.16 for ; Tue, 13 Aug 2013 06:35:03 -0700 (PDT) X-Gm-Message-State: ALoCoQlYPRq9SFNrRKGzk4yfJuQZxsc/YGlbnUJXQCUgMBj0wYe9Qp3VVdNGDhzCw/S0UC70mx64 X-Received: by 10.58.152.3 with SMTP id uu3mr4468708veb.16.1376400903299; Tue, 13 Aug 2013 06:35:03 -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 u4csp154198vcz; Tue, 13 Aug 2013 06:35:02 -0700 (PDT) X-Received: by 10.68.143.199 with SMTP id sg7mr4669663pbb.13.1376400902401; Tue, 13 Aug 2013 06:35:02 -0700 (PDT) Received: from mail-pd0-f179.google.com (mail-pd0-f179.google.com [209.85.192.179]) by mx.google.com with ESMTPS id qf5si26240561pac.211.2013.08.13.06.35.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:35:02 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.179 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.179; Received: by mail-pd0-f179.google.com with SMTP id v10so4906556pde.24 for ; Tue, 13 Aug 2013 06:35:02 -0700 (PDT) X-Received: by 10.67.5.132 with SMTP id cm4mr1825743pad.186.1376400901952; Tue, 13 Aug 2013 06:35:01 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id qh10sm43977843pbb.33.2013.08.13.06.34.58 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:35:01 -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 , Shawn Guo Subject: [PATCH V2 15/35] cpufreq: imx6q: Covert to light weight ->target_index() routine Date: Tue, 13 Aug 2013 19:02:28 +0530 Message-Id: <217701887d98cb7b71b91a095c9ca30cb35d95b4.1376392602.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.171 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: Shawn Guo Signed-off-by: Viresh Kumar --- drivers/cpufreq/imx6q-cpufreq.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index 81d1727..f6f877c 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -39,30 +39,17 @@ static unsigned int imx6q_get_speed(unsigned int cpu) return clk_get_rate(arm_clk) / 1000; } -static int imx6q_set_target(struct cpufreq_policy *policy, - unsigned int target_freq, unsigned int relation) +static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index) { struct cpufreq_freqs freqs; struct opp *opp; unsigned long freq_hz, volt, volt_old; - unsigned int index; int ret; - ret = cpufreq_frequency_table_target(policy, freq_table, target_freq, - relation, &index); - if (ret) { - dev_err(cpu_dev, "failed to match target frequency %d: %d\n", - target_freq, ret); - return ret; - } - freqs.new = freq_table[index].frequency; freq_hz = freqs.new * 1000; freqs.old = clk_get_rate(arm_clk) / 1000; - if (freqs.old == freqs.new) - return 0; - rcu_read_lock(); opp = opp_find_freq_ceil(cpu_dev, &freq_hz); if (IS_ERR(opp)) { @@ -187,7 +174,7 @@ static int imx6q_cpufreq_init(struct cpufreq_policy *policy) static struct cpufreq_driver imx6q_cpufreq_driver = { .verify = cpufreq_generic_frequency_table_verify, - .target = imx6q_set_target, + .target_index = imx6q_set_target, .get = imx6q_get_speed, .init = imx6q_cpufreq_init, .exit = cpufreq_generic_exit,