From patchwork Tue Aug 13 13:32:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19074 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0BD42246B8 for ; Tue, 13 Aug 2013 13:35:34 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id bq6sf413680qab.6 for ; Tue, 13 Aug 2013 06:35:33 -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=aXbe3lUOcXbPC05eJcwNI46XrbESGaF7vFgAjOPMIck=; b=P0PLFvIY7TgQVH93QHf+pmulxY/P3yG1e6XyeUrKd5QO2H8nTQMkA1JWg/RitkayJt AHAbJWqfWpZ4x5Wa1y36DzuVrMR/lrqvaNUuWt6FawBfD12sR+7UkanGFApVYY3146Xy CGWqws8A/oFrYX6eJs10HfheQpeh7MpTwK2SLgMCEsOFUXrUlFXz/69wxH56FZ1DucCG E113rfo4wG696cwkkxaa7G+eFIvbGagF/m5YztbcMPHaz16kYW1Dq0N2d4HoOgCKigfQ PD3GPrFbMPpNew0P3Y95ZA2XNN+HWEaAF/dA+ZOtlf80z8NnGhNYTUpCP7AlQjc5dM9q iCZw== X-Received: by 10.236.126.244 with SMTP id b80mr1690386yhi.31.1376400933784; Tue, 13 Aug 2013 06:35:33 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.74.102 with SMTP id s6ls2585979qev.17.gmail; Tue, 13 Aug 2013 06:35:33 -0700 (PDT) X-Received: by 10.52.163.129 with SMTP id yi1mr278648vdb.61.1376400933601; Tue, 13 Aug 2013 06:35:33 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id un5si9752306vcb.22.2013.08.13.06.35.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:35:33 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.174 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.174; Received: by mail-ve0-f174.google.com with SMTP id d10so6732352vea.33 for ; Tue, 13 Aug 2013 06:35:33 -0700 (PDT) X-Gm-Message-State: ALoCoQl9FdjIYyVrB8YF9K5yCYoMli359rfcZT5+/Pf5cT/0MivELorGVqoj43nbgpuMccWyulDB X-Received: by 10.58.209.5 with SMTP id mi5mr543538vec.46.1376400933518; Tue, 13 Aug 2013 06:35:33 -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 u4csp154224vcz; Tue, 13 Aug 2013 06:35:33 -0700 (PDT) X-Received: by 10.68.200.34 with SMTP id jp2mr4610165pbc.53.1376400932683; Tue, 13 Aug 2013 06:35:32 -0700 (PDT) Received: from mail-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) by mx.google.com with ESMTPS id vs3si26248244pab.172.2013.08.13.06.35.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:35:32 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.176 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.176; Received: by mail-pd0-f176.google.com with SMTP id q10so4900293pdj.35 for ; Tue, 13 Aug 2013 06:35:32 -0700 (PDT) X-Received: by 10.66.191.226 with SMTP id hb2mr4673133pac.76.1376400932064; Tue, 13 Aug 2013 06:35:32 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id xl3sm44004771pbb.17.2013.08.13.06.35.27 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:35:31 -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 , Dmitry Eremin-Solenikov Subject: [PATCH V2 19/35] cpufreq: maple: Covert to light weight ->target_index() routine Date: Tue, 13 Aug 2013 19:02:32 +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.128.174 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: Dmitry Eremin-Solenikov Signed-off-by: Viresh Kumar --- drivers/cpufreq/maple-cpufreq.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/cpufreq/maple-cpufreq.c b/drivers/cpufreq/maple-cpufreq.c index 7720670..1c24219 100644 --- a/drivers/cpufreq/maple-cpufreq.c +++ b/drivers/cpufreq/maple-cpufreq.c @@ -131,26 +131,18 @@ static int maple_scom_query_freq(void) */ static int maple_cpufreq_target(struct cpufreq_policy *policy, - unsigned int target_freq, unsigned int relation) + unsigned int index) { - unsigned int newstate = 0; struct cpufreq_freqs freqs; int rc; - if (cpufreq_frequency_table_target(policy, maple_cpu_freqs, - target_freq, relation, &newstate)) - return -EINVAL; - - if (maple_pmode_cur == newstate) - return 0; - mutex_lock(&maple_switch_mutex); freqs.old = maple_cpu_freqs[maple_pmode_cur].frequency; - freqs.new = maple_cpu_freqs[newstate].frequency; + freqs.new = maple_cpu_freqs[index].frequency; cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); - rc = maple_scom_switch_freq(newstate); + rc = maple_scom_switch_freq(index); cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); mutex_unlock(&maple_switch_mutex); @@ -181,7 +173,7 @@ static struct cpufreq_driver maple_cpufreq_driver = { .flags = CPUFREQ_CONST_LOOPS, .init = maple_cpufreq_cpu_init, .verify = cpufreq_generic_frequency_table_verify, - .target = maple_cpufreq_target, + .target_index = maple_cpufreq_target, .get = maple_cpufreq_get_speed, .attr = cpufreq_generic_attr, };