From patchwork Mon Aug 12 17:48:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19028 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 595B5246B8 for ; Mon, 12 Aug 2013 17:51:41 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id gf11sf4888926vcb.6 for ; Mon, 12 Aug 2013 10:51:41 -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=00/x2j/boKfy8JzjnK00ppgA9cDZ/+r7+m7moKQxjiw=; b=Fq3ybzFdN69zikEKOA8h0XelixUJ495eggbuXVMnZttUmjyXNb7uBa34dFuAt7WPnZ CJB1jTGbKqxDHFJrGeqEcpKAo7BcVw+ctunYjcl09SXZDzCtX2mcecq9GcCWoqO8YJaT sUOnc1oTzV6G+r/OQlmQTCvbHiYgP6ECOpfnuitvmUC4qAf+vR4DD9HdQIF1TXd0Ii7Z Lab/uBSCriVWyZlOM0ZS23ZH0+DWM7E8Jhw70gXwSzuDEZZX5iHpwCwIZVpXk8htCNU3 F4JbQEpNzX9NW0qV0RiYilTtQRwY082hyJl5st2/pnoWhHy/hIedE/danoP7e6IaaMlv PB+Q== X-Received: by 10.236.109.199 with SMTP id s47mr81082yhg.2.1376329901131; Mon, 12 Aug 2013 10:51:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.119.9 with SMTP id kq9ls2486855qeb.48.gmail; Mon, 12 Aug 2013 10:51:40 -0700 (PDT) X-Received: by 10.52.30.48 with SMTP id p16mr130115vdh.25.1376329900940; Mon, 12 Aug 2013 10:51:40 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id ch11si1945865ved.63.2013.08.12.10.51.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:51:40 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.176 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.176; Received: by mail-ve0-f176.google.com with SMTP id b10so3521268vea.7 for ; Mon, 12 Aug 2013 10:51:40 -0700 (PDT) X-Gm-Message-State: ALoCoQnXbWvinXMCh7gLDxh3dhsapo763Hv3BvVgBd1n/DJbtBwNvueV5EoPKbFZgJmWO8yd6Bfi X-Received: by 10.58.233.173 with SMTP id tx13mr152987vec.31.1376329900860; Mon, 12 Aug 2013 10:51:40 -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 u4csp108253vcz; Mon, 12 Aug 2013 10:51:40 -0700 (PDT) X-Received: by 10.68.130.38 with SMTP id ob6mr237172pbb.137.1376329899993; Mon, 12 Aug 2013 10:51:39 -0700 (PDT) Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) by mx.google.com with ESMTPS id qf5si23306037pac.182.2013.08.12.10.51.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:51:39 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.174 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.174; Received: by mail-pd0-f174.google.com with SMTP id y13so3764450pdi.33 for ; Mon, 12 Aug 2013 10:51:39 -0700 (PDT) X-Received: by 10.68.239.168 with SMTP id vt8mr235658pbc.125.1376329899621; Mon, 12 Aug 2013 10:51:39 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id pq1sm38597106pbb.26.2013.08.12.10.51.35 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:51:38 -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 18/31] cpufreq: maple: Covert to light weight ->target() routine Date: Mon, 12 Aug 2013 23:18:54 +0530 Message-Id: <2a0c90a15113539d3a9f3077e5ddd196e5d17301.1376329128.git.viresh.kumar@linaro.org> 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.176 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: 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 7f84a66..10ec535 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_old = maple_cpufreq_target, + .target = maple_cpufreq_target, .get = maple_cpufreq_get_speed, .attr = cpufreq_generic_attr, };