From patchwork Tue Aug 13 13:32:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19061 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f200.google.com (mail-gh0-f200.google.com [209.85.160.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D73F4246B8 for ; Tue, 13 Aug 2013 13:33:53 +0000 (UTC) Received: by mail-gh0-f200.google.com with SMTP id 10sf735442ghy.7 for ; Tue, 13 Aug 2013 06:33:53 -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=OLxpGrEFe4E5gz4q/dA1bxIlKTlj+oNmJOuDEUxoSJM=; b=fEVWtVJpIs62Vpq2ItESEgHWwOSOqWTZxIa29MMTumVcPX9mGOYckHDU9m3waKpM87 b1QC1ccJLrRp+B8NtRz3P4Zl3hRKOW+xHZF9AZAoDbTk57T/GNm9xXMN2AAlDc3WUyLv nRGGLfIl8SwOuLqpMxQ9hDa76/38rpjzNali9NQr6n3mGuCvxoqualPFs7sFo8fJH73d LnfaQIvW0rtcNUukEtvCjySByDGayQXl4ZdBqtHNUQtzovxXo2GgKY0p5one0m5U0zB+ eugE7a+IVlVKxqcNVwAomA1XAIzAF9hx8cWRL0aIh2I0+isvP1xgpUJ2gr3HrklEqspI er/A== X-Received: by 10.236.144.130 with SMTP id n2mr1684565yhj.38.1376400833525; Tue, 13 Aug 2013 06:33:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.121.195 with SMTP id lm3ls2761669qeb.89.gmail; Tue, 13 Aug 2013 06:33:53 -0700 (PDT) X-Received: by 10.221.56.194 with SMTP id wd2mr4536696vcb.7.1376400833402; Tue, 13 Aug 2013 06:33:53 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id ix2si9747427vdb.46.2013.08.13.06.33.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:33:53 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.177 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.177; Received: by mail-vc0-f177.google.com with SMTP id gf12so3817082vcb.22 for ; Tue, 13 Aug 2013 06:33:53 -0700 (PDT) X-Gm-Message-State: ALoCoQmib6da/aVKRwcftcDRvl0YuAKDy2KqmgDcoiTXkeYJoXKA11h+ny4h7JgRV1i0dHLulQ5v X-Received: by 10.52.30.48 with SMTP id p16mr3774853vdh.25.1376400833315; Tue, 13 Aug 2013 06:33:53 -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 u4csp154139vcz; Tue, 13 Aug 2013 06:33:52 -0700 (PDT) X-Received: by 10.68.178.197 with SMTP id da5mr4660592pbc.79.1376400832341; Tue, 13 Aug 2013 06:33:52 -0700 (PDT) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx.google.com with ESMTPS id zu9si25122883pbc.128.2013.08.13.06.33.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:33:52 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.54 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.54; Received: by mail-pb0-f54.google.com with SMTP id ro12so8042958pbb.27 for ; Tue, 13 Aug 2013 06:33:52 -0700 (PDT) X-Received: by 10.66.193.98 with SMTP id hn2mr2069266pac.173.1376400831946; Tue, 13 Aug 2013 06:33:51 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id ot4sm46846975pac.17.2013.08.13.06.33.48 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:33:51 -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 , Steven Miao Subject: [PATCH V2 06/35] cpufreq: blackfin: Covert to light weight ->target_index() routine Date: Tue, 13 Aug 2013 19:02:19 +0530 Message-Id: <57b9c4fa9e22a22debe96f00d868745f8fdaa104.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.177 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: Steven Miao Signed-off-by: Viresh Kumar --- drivers/cpufreq/blackfin-cpufreq.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/cpufreq/blackfin-cpufreq.c b/drivers/cpufreq/blackfin-cpufreq.c index 48888cf..b343c7b 100644 --- a/drivers/cpufreq/blackfin-cpufreq.c +++ b/drivers/cpufreq/blackfin-cpufreq.c @@ -127,14 +127,11 @@ unsigned long cpu_set_cclk(int cpu, unsigned long new) } #endif -static int bfin_target(struct cpufreq_policy *policy, - unsigned int target_freq, unsigned int relation) +static int bfin_target(struct cpufreq_policy *policy, unsigned int index) { #ifndef CONFIG_BF60x unsigned int plldiv; #endif - unsigned int index; - unsigned long cclk_hz; struct cpufreq_freqs freqs; static unsigned long lpj_ref; static unsigned int lpj_ref_freq; @@ -144,17 +141,11 @@ static int bfin_target(struct cpufreq_policy *policy, cycles_t cycles; #endif - if (cpufreq_frequency_table_target(policy, bfin_freq_table, target_freq, - relation, &index)) - return -EINVAL; - - cclk_hz = bfin_freq_table[index].frequency; - freqs.old = bfin_getfreq_khz(0); - freqs.new = cclk_hz; + freqs.new = bfin_freq_table[index].frequency; pr_debug("cpufreq: changing cclk to %lu; target = %u, oldfreq = %u\n", - cclk_hz, target_freq, freqs.old); + freqs.new, freqs.new, freqs.old); cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); #ifndef CONFIG_BF60x @@ -210,7 +201,7 @@ static int __bfin_cpu_init(struct cpufreq_policy *policy) static struct cpufreq_driver bfin_driver = { .verify = cpufreq_generic_frequency_table_verify, - .target = bfin_target, + .target_index = bfin_target, .get = bfin_getfreq_khz, .init = __bfin_cpu_init, .exit = cpufreq_generic_exit,