From patchwork Fri Oct 18 13:59:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 21134 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DEF13202FF for ; Fri, 18 Oct 2013 14:00:32 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id wm4sf9591616obc.8 for ; Fri, 18 Oct 2013 07:00:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; 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=h8VYNqg11t6ciqCoIroQIl1M8cAQMCfkoiy/Rt/IOmk=; b=JiSUB9HU57Q2zoZ3Mqm9GaQPEir0IOl+vNMzByzRik9lDirBm+wC71Ybzx+suf/3zQ 2lTRzwpCLb3yVucnHIKNoX57spMt9hHW7ObI8T6kNcZALqlhpta62aDncpXDqvLG5YoS JB37A6lM9mqEBl47mesZoggrXbxCS02HIxdp0NIN1gw6M9nlWpeOKwNAYjJUoQEvvU3k UG/i3yleKgqooEWX/WlYpNAeJPDXO4vmK+4djWTX/v2zd5cd17lykeBp3uUg7udf93R8 1Gv5DsB4a3NXzGDKHSfSPUW9SGXAegI8JaYwWdW1MU4HUAQUvjUHHh16gJ6XrAlNFABx rJRw== X-Received: by 10.50.130.9 with SMTP id oa9mr1473978igb.4.1382104832359; Fri, 18 Oct 2013 07:00:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.17.7 with SMTP id k7ls1255854qed.96.gmail; Fri, 18 Oct 2013 07:00:32 -0700 (PDT) X-Received: by 10.58.217.130 with SMTP id oy2mr503352vec.24.1382104832213; Fri, 18 Oct 2013 07:00:32 -0700 (PDT) Received: from mail-vb0-f52.google.com (mail-vb0-f52.google.com [209.85.212.52]) by mx.google.com with ESMTPS id gs7si329127veb.91.2013.10.18.07.00.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:00:32 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.52 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.52; Received: by mail-vb0-f52.google.com with SMTP id f12so1928319vbg.11 for ; Fri, 18 Oct 2013 07:00:32 -0700 (PDT) X-Gm-Message-State: ALoCoQley3Kp9ewEBBOqj/IcqI+s8evTeCLLL7zDfcfciST92qQrPiVgDkwDnNagc/nsJ75KE3r3 X-Received: by 10.220.10.194 with SMTP id q2mr2189978vcq.2.1382104832083; Fri, 18 Oct 2013 07:00:32 -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 u4csp37883vcz; Fri, 18 Oct 2013 07:00:31 -0700 (PDT) X-Received: by 10.68.14.200 with SMTP id r8mr3266504pbc.52.1382104831108; Fri, 18 Oct 2013 07:00:31 -0700 (PDT) Received: from mail-pb0-f53.google.com (mail-pb0-f53.google.com [209.85.160.53]) by mx.google.com with ESMTPS id mi5si1579137pab.106.2013.10.18.07.00.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:00:31 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.53 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.53; Received: by mail-pb0-f53.google.com with SMTP id up15so3881299pbc.12 for ; Fri, 18 Oct 2013 07:00:30 -0700 (PDT) X-Received: by 10.68.234.165 with SMTP id uf5mr3222045pbc.41.1382104830711; Fri, 18 Oct 2013 07:00:30 -0700 (PDT) Received: from localhost ([120.56.197.189]) by mx.google.com with ESMTPSA id ab4sm2577914pbc.43.2013.10.18.07.00.27 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:00:30 -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 V2 Resend 03/34] cpufreq: arm_big_little: Convert to light weight ->target_index() routine Date: Fri, 18 Oct 2013 19:29:26 +0530 Message-Id: <40b6cec568953688518fe53572dbb91c6d125bca.1382104515.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.52 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 086f7c1..163e337 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,