From patchwork Fri Oct 18 13:59: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: 21149 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CFB94202FF for ; Fri, 18 Oct 2013 14:02:30 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id x20sf7639862qcv.11 for ; Fri, 18 Oct 2013 07:02:30 -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=jyh5ton767fi0nM8K6ACPgez3/KxG3vfvtyrr9zLlrY=; b=Y+C/bc6gt3cGnIesvbKZRhFicOm9/++53gcSU2MflMluPg43Eqz5GZsl+rwIKIkzT9 wRypZ0HiVxMXehmtLYiQMxsnsWeR62QONb1/Y8jPYOIEFvQtSrUo29EFLmfyKfrknDTZ oUMwzOmz4V9s/WpWcn1LdsE00gfVATx8nDbCxt1Rd/qCGC4l3C6IqHNMXKWZxtZ8wfEz 5l+taRKaEG9v1gLVbPeciWMyErtGPc9lbJLfg/+1A57y6farP4Fb2ehn+aO4Swwg3K6X hFG+GPqjW5jgt1GkT6qE7k8cD1x7TCFHU1HiuyDdkoXkNN/0wsfOYfLQvE0WGMTRXRoh l6ig== X-Received: by 10.236.24.195 with SMTP id x43mr2667444yhx.3.1382104950665; Fri, 18 Oct 2013 07:02:30 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.94.68 with SMTP id da4ls1260646qeb.24.gmail; Fri, 18 Oct 2013 07:02:30 -0700 (PDT) X-Received: by 10.58.210.66 with SMTP id ms2mr2255970vec.10.1382104950488; Fri, 18 Oct 2013 07:02:30 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id sw5si334242veb.61.2013.10.18.07.02.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:02:30 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.177 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.177; Received: by mail-ve0-f177.google.com with SMTP id oz11so1672336veb.36 for ; Fri, 18 Oct 2013 07:02:30 -0700 (PDT) X-Gm-Message-State: ALoCoQkousQfko4Gg0k/PU68OTHx6j6RAT1ffbdjG3d8m2Z6I/csiwCn+/g4p0wFZ0/orzMvLFG5 X-Received: by 10.52.243.138 with SMTP id wy10mr1883502vdc.2.1382104950391; Fri, 18 Oct 2013 07:02:30 -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 u4csp38042vcz; Fri, 18 Oct 2013 07:02:29 -0700 (PDT) X-Received: by 10.68.232.39 with SMTP id tl7mr744754pbc.204.1382104949500; Fri, 18 Oct 2013 07:02:29 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id iu9si1547551pac.321.2013.10.18.07.02.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:02:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.50; Received: by mail-pb0-f50.google.com with SMTP id uo15so2477840pbc.9 for ; Fri, 18 Oct 2013 07:02:29 -0700 (PDT) X-Received: by 10.68.111.33 with SMTP id if1mr3177725pbb.31.1382104949085; Fri, 18 Oct 2013 07:02:29 -0700 (PDT) Received: from localhost ([120.56.197.189]) by mx.google.com with ESMTPSA id xv2sm2591588pbb.39.2013.10.18.07.02.25 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:02:28 -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 , Dmitry Eremin-Solenikov Subject: [PATCH V2 Resend 18/34] cpufreq: maple: Convert to light weight ->target_index() routine Date: Fri, 18 Oct 2013 19:29: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.128.177 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 eb1e176..4e2da08 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); @@ -173,7 +165,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, };