From patchwork Fri Sep 13 13:01:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20214 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f71.google.com (mail-vb0-f71.google.com [209.85.212.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C135220358 for ; Fri, 13 Sep 2013 13:21:54 +0000 (UTC) Received: by mail-vb0-f71.google.com with SMTP id g17sf1198286vbg.6 for ; Fri, 13 Sep 2013 06:21:54 -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=Ux6fKQejg6zbPdCi3AZhk08/GywQdwErUY68sJCVI2U=; b=TdpNB43PhWKZ8a9o9NcZ6ld/3Ms9lLUHadbiJP3nsMx6L/qww1dp4/DW2pSeewIIBb rSAUqBupl7NYnSs1q3injNme61ClMQturpEpyCwjXYOHnCv5uDQTc+mGW3jWkW7GCwCR xUjaZBmeJhhzxy5CPgpZFiPVPO+OgpwwRJsK24dH+A86yNJYIuHRSuoXfjktrcuSM0cP bI6TPrRPFKqUB8CKunQGuDs7lzUS829cPRYVzURWpftYXDWd2elRXiHJpvYZcJvKlO2B gxA3zoln5FJvxcGZPRcM6QlnYQ8kMec/Wc+2rdC9WASmJn/ipI2HCZ//sUVZ8NqCe2gL q0UA== X-Gm-Message-State: ALoCoQl5v7zDZBFhIvm2wvtlPfaxGzWL9w5I22iqRz86EJtMuJgcypeQRJnhZs119hQQCWzid3b2 X-Received: by 10.236.75.201 with SMTP id z49mr5149318yhd.0.1379078514511; Fri, 13 Sep 2013 06:21:54 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.25.66 with SMTP id a2ls1117481qeg.95.gmail; Fri, 13 Sep 2013 06:21:54 -0700 (PDT) X-Received: by 10.220.145.75 with SMTP id c11mr306579vcv.30.1379078514308; Fri, 13 Sep 2013 06:21:54 -0700 (PDT) Received: from mail-vb0-f47.google.com (mail-vb0-f47.google.com [209.85.212.47]) by mx.google.com with ESMTPS id ry8si3106548vcb.121.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:21:54 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.47 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.47; Received: by mail-vb0-f47.google.com with SMTP id h10so879721vbh.20 for ; Fri, 13 Sep 2013 06:21:54 -0700 (PDT) X-Received: by 10.220.74.69 with SMTP id t5mr12060415vcj.18.1379078514212; Fri, 13 Sep 2013 06:21:54 -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 u4csp80418vcz; Fri, 13 Sep 2013 06:21:53 -0700 (PDT) X-Received: by 10.66.144.102 with SMTP id sl6mr15173950pab.96.1379078513288; Fri, 13 Sep 2013 06:21:53 -0700 (PDT) Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com [209.85.220.42]) by mx.google.com with ESMTPS id uh5si11159295pab.325.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:21:53 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.42 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.42; Received: by mail-pa0-f42.google.com with SMTP id lj1so2544410pab.1 for ; Fri, 13 Sep 2013 06:21:52 -0700 (PDT) X-Received: by 10.66.139.38 with SMTP id qv6mr15476820pab.59.1379078512779; Fri, 13 Sep 2013 06:21:52 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id pu5sm18051503pac.21.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:21:52 -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 160/228] cpufreq: imx6q: Convert to light weight ->target_index() routine Date: Fri, 13 Sep 2013 18:31:46 +0530 Message-Id: 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.212.47 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 3fb3f59..e8846d7 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)) { @@ -158,7 +145,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,