From patchwork Fri Sep 13 13:01: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: 20205 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f197.google.com (mail-ve0-f197.google.com [209.85.128.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C735820358 for ; Fri, 13 Sep 2013 13:20:51 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id jy13sf1243983veb.0 for ; Fri, 13 Sep 2013 06:20:51 -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=3WUbY1wV7eTekzTHR0VTr6ZObDZwN0ONvlF0xA/fWVU=; b=DmiKEWEKZEhNAGMgylmbzVrvxMnGtShlTzp8xuneXZoo+JF+92gwVptAAfrZyrudXV EZLotu+LwHOwKJ36S7xvM2l3J82MgcFeIRztg5y3idgTNrwyCrlZ6Y/t/o2ykOv+3HQa NPPFXYUvouQifpKwjHng+7N2USDf5Hb1pBrliTGpsNLh1jHcupNn/f/eaJk5uZUfx4+P 9funMmb8Llo72gTH0P/5cdYcGseJraS3Nv69gs7mr0rkRIuNb/i2ozcX6QhA10AI8pbd wQw+2J4mkHQD4lBsU3nSLqqC/70KYEtTebZTs9o7DsiIdfMuu1mv2IkTGqtegWXUj0Kt bwiw== X-Gm-Message-State: ALoCoQkrb1ZqCs5h+oCtKigWkNdkFm/3x0IItNw+7yzJ/vz+AUJCdtxE83o2JZSnFBM5EmfkCG0x X-Received: by 10.236.2.5 with SMTP id 5mr4959799yhe.23.1379078451551; Fri, 13 Sep 2013 06:20:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.3.169 with SMTP id d9ls1206418qed.61.gmail; Fri, 13 Sep 2013 06:20:51 -0700 (PDT) X-Received: by 10.220.169.203 with SMTP id a11mr1681550vcz.26.1379078451347; Fri, 13 Sep 2013 06:20:51 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id tq4si3108414vdc.77.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:20:51 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.171 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.171; Received: by mail-vc0-f171.google.com with SMTP id ij15so908755vcb.16 for ; Fri, 13 Sep 2013 06:20:51 -0700 (PDT) X-Received: by 10.52.165.131 with SMTP id yy3mr5992155vdb.25.1379078451252; Fri, 13 Sep 2013 06:20:51 -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 u4csp80367vcz; Fri, 13 Sep 2013 06:20:50 -0700 (PDT) X-Received: by 10.66.20.166 with SMTP id o6mr15433816pae.149.1379078450249; Fri, 13 Sep 2013 06:20:50 -0700 (PDT) Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com [209.85.192.178]) by mx.google.com with ESMTPS id 7si7476138pbv.47.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:20:50 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.178 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.178; Received: by mail-pd0-f178.google.com with SMTP id w10so1243564pde.37 for ; Fri, 13 Sep 2013 06:20:49 -0700 (PDT) X-Received: by 10.68.130.34 with SMTP id ob2mr13417824pbb.155.1379078449656; Fri, 13 Sep 2013 06:20:49 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id cx4sm11731892pbc.24.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:20:49 -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 151/228] cpufreq: blackfin: Convert to light weight ->target_index() routine Date: Fri, 13 Sep 2013 18:31: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.171 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,