From patchwork Tue Aug 13 13:32:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19088 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f199.google.com (mail-ye0-f199.google.com [209.85.213.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 116BE246B8 for ; Tue, 13 Aug 2013 13:37:18 +0000 (UTC) Received: by mail-ye0-f199.google.com with SMTP id l12sf5240584yen.10 for ; Tue, 13 Aug 2013 06:37:18 -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=wkAXeio9C6GhwjX7WmXIfVsCWObufMisibRk8epzsrM=; b=bW0LVvx9MgxGTTz7Jgot4Z1IKvm+3qbm6/PgerJxuRJCcWpMtlaUUpTmJ0mnHUGUgl bW2Ukufna5AMVeuRH6VUp6tLjS+k5t58tricNsoaQACx56ozY3qejbGwaFetZA+RLCZR n2JBKEvOAk0m95ZoYuawYBK5nna4RlRnxLnkCmpdumitj2VeTrVClBGCjwYXVytni7nk +NZnfFavBke3TYTxdiWf6kTdexa3FtIC++9XtOGD6B7QoqaS/gMWHBGR+FrAjVYULNq3 atMd6d0X8Div2CHaVPL6jnIzvyDUJQIBZBVjnnSOLR0u3c2ejmMdSsSxZz6y7xMA/IKx ty0Q== X-Received: by 10.236.198.240 with SMTP id v76mr1594690yhn.10.1376401038605; Tue, 13 Aug 2013 06:37:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.105.69 with SMTP id gk5ls1640384qeb.57.gmail; Tue, 13 Aug 2013 06:37:18 -0700 (PDT) X-Received: by 10.52.30.97 with SMTP id r1mr1219497vdh.36.1376401038497; Tue, 13 Aug 2013 06:37:18 -0700 (PDT) Received: from mail-vb0-f45.google.com (mail-vb0-f45.google.com [209.85.212.45]) by mx.google.com with ESMTPS id vv9si350169vec.5.2013.08.13.06.37.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:37:18 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.45 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.45; Received: by mail-vb0-f45.google.com with SMTP id e15so6599035vbg.18 for ; Tue, 13 Aug 2013 06:37:18 -0700 (PDT) X-Gm-Message-State: ALoCoQkiDsGHS34+494xUkTDXfOF4euj1jqCgwHaOP4LsuGMYEZr/HcAFYVBIJZvUfgcvH1yEw7R X-Received: by 10.52.187.162 with SMTP id ft2mr3666291vdc.10.1376401038409; Tue, 13 Aug 2013 06:37:18 -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 u4csp154320vcz; Tue, 13 Aug 2013 06:37:17 -0700 (PDT) X-Received: by 10.67.23.71 with SMTP id hy7mr1994186pad.99.1376401037497; Tue, 13 Aug 2013 06:37:17 -0700 (PDT) Received: from mail-pb0-f44.google.com (mail-pb0-f44.google.com [209.85.160.44]) by mx.google.com with ESMTPS id ph3si25143738pbc.74.2013.08.13.06.37.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:37:17 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.44 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.44; Received: by mail-pb0-f44.google.com with SMTP id xa7so7987700pbc.3 for ; Tue, 13 Aug 2013 06:37:17 -0700 (PDT) X-Received: by 10.68.226.234 with SMTP id rv10mr4685162pbc.1.1376401037088; Tue, 13 Aug 2013 06:37:17 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id qh10sm43988927pbb.33.2013.08.13.06.37.13 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:37:16 -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 Subject: [PATCH V2 33/35] cpufreq: SPEAr: Covert to light weight ->target_index() routine Date: Tue, 13 Aug 2013 19:02:46 +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.45 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. Signed-off-by: Viresh Kumar --- drivers/cpufreq/spear-cpufreq.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/cpufreq/spear-cpufreq.c b/drivers/cpufreq/spear-cpufreq.c index d31accc..88aa5cf 100644 --- a/drivers/cpufreq/spear-cpufreq.c +++ b/drivers/cpufreq/spear-cpufreq.c @@ -105,20 +105,16 @@ static int spear1340_set_cpu_rate(struct clk *sys_pclk, unsigned long newfreq) } static int spear_cpufreq_target(struct cpufreq_policy *policy, - unsigned int target_freq, unsigned int relation) + unsigned int index) { struct cpufreq_freqs freqs; unsigned long newfreq; struct clk *srcclk; - int index, ret, mult = 1; - - if (cpufreq_frequency_table_target(policy, spear_cpufreq.freq_tbl, - target_freq, relation, &index)) - return -EINVAL; + int ret, mult = 1; freqs.old = spear_cpufreq_get(0); - newfreq = spear_cpufreq.freq_tbl[index].frequency * 1000; + if (of_machine_is_compatible("st,spear1340")) { /* * SPEAr1340 is special in the sense that due to the possibility @@ -191,7 +187,7 @@ static struct cpufreq_driver spear_cpufreq_driver = { .name = "cpufreq-spear", .flags = CPUFREQ_STICKY, .verify = cpufreq_generic_frequency_table_verify, - .target = spear_cpufreq_target, + .target_index = spear_cpufreq_target, .get = spear_cpufreq_get, .init = spear_cpufreq_init, .exit = cpufreq_generic_exit,