From patchwork Mon Aug 12 17:48:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19015 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f200.google.com (mail-ye0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 36B39246B8 for ; Mon, 12 Aug 2013 17:50:10 +0000 (UTC) Received: by mail-ye0-f200.google.com with SMTP id r13sf7977844yen.3 for ; Mon, 12 Aug 2013 10:50:10 -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=YNMY7XOH3CfNlKf3hMhOq6D8ZiyTx/OElxWDADgCIsI=; b=NEwGsupf0D7nbNO03ZBOziLk8xid+VCLSYHLWrpzYnjXH8kj18v8mFTUKdjA6yPf9k oUshDZCm5X1MWB08oOD6vghbI1chQvR/H6P7XeYNTAa09hq87t6DwgOJC/suEql9KXVH QLbwTkpAUy1fd1uXPSPmX+vSgQttgfA0a1Dl1R35Q5Q16fPlqHx+2UMVM9Bab8NE2eHy SUmgu2OE5ebK5stqMMUm9pa5ljczpSYjugKXlSye7kYMAkYG+5SUMM/JUBR4cBRdz/R3 wOmTIzXmlLUAV3PxsC4RulVTnHRlD9ovL9hm6/dw5Wm2Cpi3jf2tKrQgeDp5xm3Vo0bE L9TA== X-Received: by 10.236.203.5 with SMTP id e5mr74688yho.3.1376329810019; Mon, 12 Aug 2013 10:50:10 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.47.11 with SMTP id z11ls2521685qem.68.gmail; Mon, 12 Aug 2013 10:50:09 -0700 (PDT) X-Received: by 10.221.40.10 with SMTP id to10mr150069vcb.22.1376329809877; Mon, 12 Aug 2013 10:50:09 -0700 (PDT) Received: from mail-vb0-f50.google.com (mail-vb0-f50.google.com [209.85.212.50]) by mx.google.com with ESMTPS id sy7si8591024vdc.14.2013.08.12.10.50.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:50:09 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.50 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.50; Received: by mail-vb0-f50.google.com with SMTP id x14so5917454vbb.23 for ; Mon, 12 Aug 2013 10:50:09 -0700 (PDT) X-Gm-Message-State: ALoCoQmuC6r+ruy+XGxDU5UtKvlGQR+sDqInWLgR1ZSnDhX4SW3hKQEvrPOzP/P5MpzpeY97fWNA X-Received: by 10.58.217.167 with SMTP id oz7mr151184vec.15.1376329809797; Mon, 12 Aug 2013 10:50:09 -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 u4csp108148vcz; Mon, 12 Aug 2013 10:50:09 -0700 (PDT) X-Received: by 10.66.176.143 with SMTP id ci15mr218328pac.146.1376329808886; Mon, 12 Aug 2013 10:50:08 -0700 (PDT) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by mx.google.com with ESMTPS id tg10si22139148pbc.297.2013.08.12.10.50.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:50:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.46 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.46; Received: by mail-pa0-f46.google.com with SMTP id fa1so5882107pad.5 for ; Mon, 12 Aug 2013 10:50:08 -0700 (PDT) X-Received: by 10.66.227.39 with SMTP id rx7mr249435pac.44.1376329808457; Mon, 12 Aug 2013 10:50:08 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id pu5sm41351119pac.21.2013.08.12.10.50.04 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:50:07 -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 05/31] cpufreq: blackfin: Covert to light weight ->target() routine Date: Mon, 12 Aug 2013 23:18:41 +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.50 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_old() to newly defined light weight .target() 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 e6ac8c9..ac9819d 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_old = bfin_target, + .target = bfin_target, .get = bfin_getfreq_khz, .init = __bfin_cpu_init, .exit = cpufreq_generic_exit,