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: 19059 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f199.google.com (mail-gh0-f199.google.com [209.85.160.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 991B9246B8 for ; Tue, 13 Aug 2013 13:33:39 +0000 (UTC) Received: by mail-gh0-f199.google.com with SMTP id g14sf4996296ghb.10 for ; Tue, 13 Aug 2013 06:33:39 -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=Uc3+fSPE7afs8C2ltq7V+bIHaAIafXuDhBAtjBn4U14=; b=KeLMTpjFccJkkgSQCbdg21liQCMwONNwgKz32rZqChmbtTL/EQAMFffqf3i3gzN1qB 5fwFf3iU7J4VM4oLUpI0Dz6v4lGoXEfqeDAeepGFNI9niE9k5fTVN8qJhd5HMYeERhzC 7YkmYCD0oUQjF1pyAH2gxwi99CXL9CqYc9B1t1BG34Z/6/k0M3I/EJbw8Y0qMrslaIzt ht8FjQFQB6wxLhUHXS4BlAW86rjDtmB8cZULNMaA9nMUCAKJPSeaoWB6gYUGUgg/goBz fPEllMfyadfDoZmq9y/L8eYgyJJJ4ylSmGSK9qiyXI8EWWAvnfJeCz+WtNB2/cjcZSIu K55g== X-Received: by 10.236.207.169 with SMTP id n29mr533730yho.50.1376400819138; Tue, 13 Aug 2013 06:33:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.11.230 with SMTP id t6ls116133qeb.33.gmail; Tue, 13 Aug 2013 06:33:39 -0700 (PDT) X-Received: by 10.52.116.163 with SMTP id jx3mr3809986vdb.27.1376400819010; Tue, 13 Aug 2013 06:33:39 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id xu8si9751529vcb.5.2013.08.13.06.33.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:33:39 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id m17so3884824vca.17 for ; Tue, 13 Aug 2013 06:33:38 -0700 (PDT) X-Gm-Message-State: ALoCoQkVW+pMLTl1GdFRqwlVEBf7ECZcnaGJJw61jZ+bLEeLS5EOqJHYF3MAVJS+Bffs4sswA2wY X-Received: by 10.52.163.12 with SMTP id ye12mr276883vdb.59.1376400818936; Tue, 13 Aug 2013 06:33:38 -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 u4csp154123vcz; Tue, 13 Aug 2013 06:33:38 -0700 (PDT) X-Received: by 10.66.192.234 with SMTP id hj10mr2049672pac.183.1376400818015; Tue, 13 Aug 2013 06:33:38 -0700 (PDT) Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) by mx.google.com with ESMTPS id ie10si25149813pbc.11.2013.08.13.06.33.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:33:38 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.49 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.49; Received: by mail-pa0-f49.google.com with SMTP id ld10so4303430pab.8 for ; Tue, 13 Aug 2013 06:33:37 -0700 (PDT) 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 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 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-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.220.172 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. 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,