From patchwork Mon Aug 12 17:48:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19014 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 0CFDF246B8 for ; Mon, 12 Aug 2013 17:50:03 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id n1sf8566031qcx.3 for ; Mon, 12 Aug 2013 10:50:02 -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=PFyXqIH6DaxKf1ON0KDf7zG+9ussrFhF4HfBwOw9hDw=; b=TJkyilmojLj4CyZa49JtU/TjQDwjw/aNGhS9E8t9QQu63t+u2mgZhfwRMwU+/Pxzu7 btqZg7dGtIyhCLoUre5nQzHcLgcLy20VkSQtFsp94tc6xYRROdNmmzAWzBSIXzZs892c BJhNp9RVfLKtr4tuQpYGZt7Pqqvwd33cVCc1R5ig8RpePkiW/qSc9Rj0pIvh1O4Bel7x wLbsN7q0nfJgY45feakoWUsTbI7QMMKbIfzOOFyTw9CjSYybtSXMJR3E1CoBFSjySCUT UMMTFKw5IaPf6adEMH9ohvJt1+RvJyzZUfEXQllTpGEDfUkbc7L3APGN9JyGZr9vy5NE VhGg== X-Received: by 10.236.62.132 with SMTP id y4mr71539yhc.13.1376329802868; Mon, 12 Aug 2013 10:50:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.47.82 with SMTP id b18ls2422860qen.53.gmail; Mon, 12 Aug 2013 10:50:02 -0700 (PDT) X-Received: by 10.58.164.101 with SMTP id yp5mr154819veb.0.1376329802711; Mon, 12 Aug 2013 10:50:02 -0700 (PDT) Received: from mail-vb0-f50.google.com (mail-vb0-f50.google.com [209.85.212.50]) by mx.google.com with ESMTPS id cz7si8587115veb.71.2013.08.12.10.50.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:50:02 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.50 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.50; Received: by mail-vb0-f50.google.com with SMTP id x14so5917352vbb.23 for ; Mon, 12 Aug 2013 10:50:02 -0700 (PDT) X-Gm-Message-State: ALoCoQmlam32jstGrw1/IMnzuLi9MME5i+xdgjqvrTQn7/vAukwmOYPnoo37U6f/AVRgfuO/MG0k X-Received: by 10.58.19.162 with SMTP id g2mr152413vee.12.1376329802589; Mon, 12 Aug 2013 10:50:02 -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 u4csp108140vcz; Mon, 12 Aug 2013 10:50:02 -0700 (PDT) X-Received: by 10.66.152.11 with SMTP id uu11mr226469pab.124.1376329801662; Mon, 12 Aug 2013 10:50:01 -0700 (PDT) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by mx.google.com with ESMTPS id c10si23275656pav.316.2013.08.12.10.50.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:50:01 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.46 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.46; Received: by mail-pa0-f46.google.com with SMTP id fa1so5881956pad.5 for ; Mon, 12 Aug 2013 10:50:01 -0700 (PDT) X-Received: by 10.68.27.37 with SMTP id q5mr223837pbg.145.1376329801218; Mon, 12 Aug 2013 10:50:01 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id bb1sm38615973pbc.10.2013.08.12.10.49.57 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:50:00 -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 Subject: [PATCH 04/31] cpufreq: arm_big_little: Covert to light weight ->target() routine Date: Mon, 12 Aug 2013 23:18:40 +0530 Message-Id: <59b8871929a96284d7e74c3a11b4df55740562ef.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.212.50 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. Signed-off-by: Viresh Kumar --- drivers/cpufreq/arm_big_little.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c index 324bdb3..d916730 100644 --- a/drivers/cpufreq/arm_big_little.c +++ b/drivers/cpufreq/arm_big_little.c @@ -49,28 +49,21 @@ static unsigned int bL_cpufreq_get(unsigned int cpu) /* Set clock frequency */ static int bL_cpufreq_set_target(struct cpufreq_policy *policy, - unsigned int target_freq, unsigned int relation) + unsigned int index) { struct cpufreq_freqs freqs; - u32 cpu = policy->cpu, freq_tab_idx, cur_cluster; + u32 cpu = policy->cpu, cur_cluster; int ret = 0; cur_cluster = cpu_to_cluster(policy->cpu); freqs.old = bL_cpufreq_get(policy->cpu); - - /* Determine valid target frequency using freq_table */ - cpufreq_frequency_table_target(policy, freq_table[cur_cluster], - target_freq, relation, &freq_tab_idx); - freqs.new = freq_table[cur_cluster][freq_tab_idx].frequency; + freqs.new = freq_table[cur_cluster][index].frequency; pr_debug("%s: cpu: %d, cluster: %d, oldfreq: %d, target freq: %d, new freq: %d\n", - __func__, cpu, cur_cluster, freqs.old, target_freq, + __func__, cpu, cur_cluster, freqs.old, freqs.new, freqs.new); - if (freqs.old == freqs.new) - return 0; - cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); ret = clk_set_rate(clk[cur_cluster], freqs.new * 1000); @@ -201,7 +194,7 @@ static struct cpufreq_driver bL_cpufreq_driver = { .name = "arm-big-little", .flags = CPUFREQ_STICKY, .verify = cpufreq_generic_frequency_table_verify, - .target_old = bL_cpufreq_set_target, + .target = bL_cpufreq_set_target, .get = bL_cpufreq_get, .init = bL_cpufreq_init, .exit = bL_cpufreq_exit,