From patchwork Fri Oct 18 13:59:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 21145 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8069B202FF for ; Fri, 18 Oct 2013 14:02:02 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id wm4sf9589446obc.4 for ; Fri, 18 Oct 2013 07:02:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; 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=Ff5LFp361DnOHM876UIAr7PBVRF413I1LidqtbjqEM4=; b=JGjA8WdxCp8Rqs5O3WPoIM02AwImlM557DTjbqCcpD/Cas1oP8uUJtr0aCJ/CvPlHW QakAdhyuBsvAg60UcW0SZaPEhnk8daSRc/s1LdDvEGgRsrgLh8wM3shLZtepeg0zKfBD awgKCchDcQvJK0WjFNsE9FsipR/bLFDeGzK5NeTu0bhIBTLcYSONmVp2SqKqEQAgRwNb nlS24xLPQg8UpU+PgHnFqsii8aI4SYwa6wHo/3sa55FwzIGS1CybRoa5YU1d4n27px8o siEbh+Ay3ErVARHMHAMwcNL8CtI0QSijaduhNSa7WwumfckAJ1HX0Z63lVDysWFoYf5A Mxmg== X-Received: by 10.43.151.16 with SMTP id kq16mr974813icc.22.1382104921914; Fri, 18 Oct 2013 07:02:01 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.76.100 with SMTP id j4ls1360342qew.29.gmail; Fri, 18 Oct 2013 07:02:01 -0700 (PDT) X-Received: by 10.220.58.1 with SMTP id e1mr2231543vch.0.1382104921739; Fri, 18 Oct 2013 07:02:01 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id st7si335236vdc.42.2013.10.18.07.02.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:02:01 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.172 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.172; Received: by mail-vc0-f172.google.com with SMTP id ks9so375224vcb.31 for ; Fri, 18 Oct 2013 07:02:01 -0700 (PDT) X-Gm-Message-State: ALoCoQmPlObwljNq9hgfAiJo6A4uqtDJEUw0BgX/ahHbKrp+SDMPG/aA8zBszjl/oYeekGwcoCDM X-Received: by 10.52.32.37 with SMTP id f5mr1810859vdi.17.1382104921637; Fri, 18 Oct 2013 07:02:01 -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 u4csp37997vcz; Fri, 18 Oct 2013 07:02:01 -0700 (PDT) X-Received: by 10.68.190.103 with SMTP id gp7mr3298927pbc.74.1382104920682; Fri, 18 Oct 2013 07:02:00 -0700 (PDT) Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by mx.google.com with ESMTPS id w1si1581676pan.112.2013.10.18.07.02.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:02:00 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.43 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.43; Received: by mail-pa0-f43.google.com with SMTP id hz1so3664194pad.30 for ; Fri, 18 Oct 2013 07:02:00 -0700 (PDT) X-Received: by 10.66.4.130 with SMTP id k2mr3578612pak.95.1382104920049; Fri, 18 Oct 2013 07:02:00 -0700 (PDT) Received: from localhost ([120.56.197.189]) by mx.google.com with ESMTPSA id ye1sm4603539pab.19.2013.10.18.07.01.55 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:01:59 -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 , Shawn Guo Subject: [PATCH V2 Resend 14/34] cpufreq: imx6q: Convert to light weight ->target_index() routine Date: Fri, 18 Oct 2013 19:29:37 +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.220.172 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 be23892..07af3b0 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -40,30 +40,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 dev_pm_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 = dev_pm_opp_find_freq_ceil(cpu_dev, &freq_hz); if (IS_ERR(opp)) { @@ -159,7 +146,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,