From patchwork Fri Oct 18 13:59: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: 21136 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f69.google.com (mail-oa0-f69.google.com [209.85.219.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 428A0202FF for ; Fri, 18 Oct 2013 14:00:48 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id n12sf10423967oag.4 for ; Fri, 18 Oct 2013 07:00:47 -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=3WUbY1wV7eTekzTHR0VTr6ZObDZwN0ONvlF0xA/fWVU=; b=LApNTIhKkUFH5DKRemAR37bqLUDFJryIeZD3h7L+tj3Y6JonDfBPUAQQvqbP/ZANcU T7S1PN6ZfJUEFprrUlpRUUagrqoqu52AFoOUvAOjTdAohl3hBClMAOHKksecUIKhAcnP T1gxvQlh4l1U/uC2fpPlXUKBxmpcIY/IIW5PQNhsoChmr2UvxeIGBhEAOu4tKo9B3GVv nG7tHJ/vnNKZM/vbuiezVxFSbg+GaDGihSKliBzfiFDWGrmldcdVvPsTNef02Lhft9hd RL9Z49clUg14LJmf43wwQHUEm2P9l9i73DB+BKJvDdoAT/qnqPbNTKiAkD3vEzaAKoyI 0iSA== X-Received: by 10.182.108.136 with SMTP id hk8mr1135771obb.11.1382104847809; Fri, 18 Oct 2013 07:00:47 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.35.244 with SMTP id l20ls1395752qej.98.gmail; Fri, 18 Oct 2013 07:00:47 -0700 (PDT) X-Received: by 10.220.58.1 with SMTP id e1mr2226295vch.0.1382104847676; Fri, 18 Oct 2013 07:00:47 -0700 (PDT) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id ef6si338258ved.9.2013.10.18.07.00.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:00:47 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.181 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.181; Received: by mail-ve0-f181.google.com with SMTP id pa12so1978634veb.26 for ; Fri, 18 Oct 2013 07:00:47 -0700 (PDT) X-Gm-Message-State: ALoCoQnicCeM+ZmGRa7vUzOnkFy5ArEz56awt8p/ypUkQSWH2Jbn67UYzDtH7SoSRMvx+Dlm7mqB X-Received: by 10.58.161.231 with SMTP id xv7mr2186885veb.2.1382104847580; Fri, 18 Oct 2013 07:00:47 -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 u4csp37898vcz; Fri, 18 Oct 2013 07:00:47 -0700 (PDT) X-Received: by 10.66.121.68 with SMTP id li4mr3620487pab.33.1382104846696; Fri, 18 Oct 2013 07:00:46 -0700 (PDT) Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) by mx.google.com with ESMTPS id hi3si980953pbb.213.2013.10.18.07.00.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:00:46 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.174 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.174; Received: by mail-pd0-f174.google.com with SMTP id y13so4672326pdi.5 for ; Fri, 18 Oct 2013 07:00:46 -0700 (PDT) X-Received: by 10.68.133.132 with SMTP id pc4mr3328942pbb.10.1382104846310; Fri, 18 Oct 2013 07:00:46 -0700 (PDT) Received: from localhost ([120.56.197.189]) by mx.google.com with ESMTPSA id qf7sm4613779pac.14.2013.10.18.07.00.41 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:00:45 -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 , Steven Miao Subject: [PATCH V2 Resend 05/34] cpufreq: blackfin: Convert to light weight ->target_index() routine Date: Fri, 18 Oct 2013 19:29:28 +0530 Message-Id: <714f21d1e00cc8e54d8ae607ab837ccb1d49f32f.1382104515.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.181 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 0bc9e8c..12528b2 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 @@ -209,7 +200,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,