From patchwork Tue Aug 13 13:32:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2843641 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4E2159F271 for ; Tue, 13 Aug 2013 13:35:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A6FAA204AC for ; Tue, 13 Aug 2013 13:34:59 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DB6F9204A2 for ; Tue, 13 Aug 2013 13:34:54 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V9Ek7-0006IY-Im; Tue, 13 Aug 2013 13:34:35 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V9Ejz-0007kn-F9; Tue, 13 Aug 2013 13:34:27 +0000 Received: from mail-pa0-f41.google.com ([209.85.220.41]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V9EjX-0007ct-3d for linux-arm-kernel@lists.infradead.org; Tue, 13 Aug 2013 13:34:01 +0000 Received: by mail-pa0-f41.google.com with SMTP id bj1so8929695pad.14 for ; Tue, 13 Aug 2013 06:33:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=Uc3+fSPE7afs8C2ltq7V+bIHaAIafXuDhBAtjBn4U14=; b=i44pLopJYDIQbJZ1/8ZBg4JjNvulz+jRcAi5yMFSw3a2vS9jagqpsa1t4zI7HSrJ0Z FW+Isluf1LieEFzcqEyDoqTzA8f6BfXhM/+bowsnkmqrBlefhJ4Khp3QMAoLhAJy4wAT w7xb20yDmnypNC+i1A9fkERyQRBJRY+DWf/z14kVV3Y6BJfqlghOHvgihWzTrb0Rn1O4 jl2diO5GHAfZ/KetTQGSgswfMCHuZCR/2ADbJTITkRdL2u6i49dB1D3bPGf5Z5/Dr3hS jhwN+BUlK4poG7KR1J9Nq1ElwPJHcrf2VREBPfVyLzgT7BkNFXgNjA3vpa0RCBdoDb+7 0N0Q== X-Gm-Message-State: ALoCoQlLCQsMsWCmF+6GhBSD83g6qJQLFBHBbjlhV3VLu/WUfoQBqzaee52FmYmaqvumLAGtOZTN X-Received: by 10.68.137.170 with SMTP id qj10mr4601144pbb.31.1376400817599; Tue, 13 Aug 2013 06:33:37 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id s6sm46858346pan.12.2013.08.13.06.33.33 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:33:37 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Subject: [PATCH V2 04/35] cpufreq: arm_big_little: Covert to light weight ->target_index() routine Date: Tue, 13 Aug 2013 19:02:17 +0530 Message-Id: <9875f25f50527a9f415851a324dafb260e302928.1376392602.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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130813_093359_314389_F4D3B0EE X-CRM114-Status: GOOD ( 11.28 ) X-Spam-Score: -2.6 (--) Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Viresh Kumar , patches@linaro.org, linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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/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 7e92586..4bba5ad 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 = bL_cpufreq_set_target, + .target_index = bL_cpufreq_set_target, .get = bL_cpufreq_get, .init = bL_cpufreq_init, .exit = bL_cpufreq_exit,