From patchwork Fri Sep 13 13:01:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20203 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1A6EB20358 for ; Fri, 13 Sep 2013 13:20:38 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id db12sf1232701veb.10 for ; Fri, 13 Sep 2013 06:20:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version: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=EbU+X5+fMrbbWoLa/dyM0XzzjB4YTCXdBVnnavp8cuU=; b=GiD1vL3sfEe/xpIyPUTkOwjBsgxyDqV6DwTPYmPCWcxDmd1styTF6OBzUH2A4Rh5DQ 7rYPMGhrxQk3WOre/VvldICxn+AYVMV425jYg9XUWGV9kSc9CVjoY4fXPQCQhu2r546b Y5dfyZOzsfZUbOJpMALqW+GNP0Y8XCU+5LCKvO6AiWA0tO44eBqqARJ3DWwiKwLnsvHe Q4d/kZST4cKB9g4ElonAUhRHgr3u+HsvqFqsb4DWt9a64Jy4fWQ5P5xk/JOuTrGUnIBJ OUkPm/T434Vs1AnUNhsT7NCiBh85FBgpEjIX+cuJzEHB1zrKmHUBd3usZ9CcsHjnt6so d5Kg== X-Gm-Message-State: ALoCoQmCuT44OAo2aZ5JhJ0XF2uqxa330YTqyQ8JmiephpvULNBBpy/3+UFl6oGxgr++S1xF4rVn X-Received: by 10.236.7.130 with SMTP id 2mr5126392yhp.4.1379078437647; Fri, 13 Sep 2013 06:20:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.37.170 with SMTP id z10ls1094466qej.32.gmail; Fri, 13 Sep 2013 06:20:37 -0700 (PDT) X-Received: by 10.58.108.74 with SMTP id hi10mr12151541veb.14.1379078437388; Fri, 13 Sep 2013 06:20:37 -0700 (PDT) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id tj1si3109250vdc.66.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:20:37 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.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.128.172; Received: by mail-ve0-f172.google.com with SMTP id oz11so938853veb.17 for ; Fri, 13 Sep 2013 06:20:37 -0700 (PDT) X-Received: by 10.58.196.132 with SMTP id im4mr1082826vec.28.1379078437311; Fri, 13 Sep 2013 06:20:37 -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 u4csp80348vcz; Fri, 13 Sep 2013 06:20:36 -0700 (PDT) X-Received: by 10.66.162.167 with SMTP id yb7mr15583908pab.16.1379078436370; Fri, 13 Sep 2013 06:20:36 -0700 (PDT) Received: from mail-pd0-f179.google.com (mail-pd0-f179.google.com [209.85.192.179]) by mx.google.com with ESMTPS id se2si7422986pbc.316.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:20:36 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.179 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.179; Received: by mail-pd0-f179.google.com with SMTP id v10so1232914pde.38 for ; Fri, 13 Sep 2013 06:20:36 -0700 (PDT) X-Received: by 10.68.211.233 with SMTP id nf9mr13660587pbc.26.1379078435978; Fri, 13 Sep 2013 06:20:35 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id vz4sm18072628pab.11.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:20:35 -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 149/228] cpufreq: arm_big_little: Convert to light weight ->target_index() routine Date: Fri, 13 Sep 2013 18:31:35 +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.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 f7717ef..c3936ef 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); @@ -200,7 +193,7 @@ static struct cpufreq_driver bL_cpufreq_driver = { .flags = CPUFREQ_STICKY | CPUFREQ_HAVE_GOVERNOR_PER_POLICY, .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,