From patchwork Tue Aug 13 13:32:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19080 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f69.google.com (mail-qe0-f69.google.com [209.85.128.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1E0F4246B8 for ; Tue, 13 Aug 2013 13:36:17 +0000 (UTC) Received: by mail-qe0-f69.google.com with SMTP id 1sf9802889qec.8 for ; Tue, 13 Aug 2013 06:36:16 -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=nSlp4f84z9VGE4zp4JZKDm9c/4x437VDHgY8bzwHFWs=; b=WbCtGRkPwd2ps6fQZ2vAaO49Tt4V3BtmRTcdGI/u4nApQHP2dmDALm92pxJYMzj9Vb V3WusLirl7au9Eel3UBnn6qVRePUI02s+OMTgqvJhMlq2XjTlDf9DSgmuhcw5NQze7n5 Zd+cScg4WdZv9VL8n0vnHp4VcnrHzdEqBAX5zRGUvoiIdPm64sRihBrv00mCQYkDq9AH MZpPW66Q6QZKNrRAy7UwU7QWFKLdUdFssBYRF/4A+cx8EJeZ4dIV6yLjWz5nalO75BQb 2H7Yv7iBOCRAfuFmnJKhYNJ17PVwwQYWX3MmTT3qggraLqJd1yxKXG54fGr1yoRdXfhK WyNQ== X-Received: by 10.236.148.33 with SMTP id u21mr1552399yhj.37.1376400976821; Tue, 13 Aug 2013 06:36:16 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.101.44 with SMTP id fd12ls2801167qeb.98.gmail; Tue, 13 Aug 2013 06:36:16 -0700 (PDT) X-Received: by 10.220.45.132 with SMTP id e4mr107840vcf.56.1376400976727; Tue, 13 Aug 2013 06:36:16 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id b1si9753803veg.23.2013.08.13.06.36.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:36:16 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.182 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.182; Received: by mail-vc0-f182.google.com with SMTP id hf12so3813607vcb.41 for ; Tue, 13 Aug 2013 06:36:16 -0700 (PDT) X-Gm-Message-State: ALoCoQl+lMljhF8sVxu7gOg2fTLSOglF90I5709kCBeg/XI8+DQkyToOwDiPBAWGPcD+HfafMXNB X-Received: by 10.58.100.234 with SMTP id fb10mr4540921veb.5.1376400976634; Tue, 13 Aug 2013 06:36:16 -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 u4csp154265vcz; Tue, 13 Aug 2013 06:36:16 -0700 (PDT) X-Received: by 10.66.102.101 with SMTP id fn5mr4690158pab.115.1376400975729; Tue, 13 Aug 2013 06:36:15 -0700 (PDT) Received: from mail-pb0-f51.google.com (mail-pb0-f51.google.com [209.85.160.51]) by mx.google.com with ESMTPS id aq4si25067368pbd.356.2013.08.13.06.36.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:36:15 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.51 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.51; Received: by mail-pb0-f51.google.com with SMTP id jt11so7996362pbb.24 for ; Tue, 13 Aug 2013 06:36:15 -0700 (PDT) X-Received: by 10.68.90.99 with SMTP id bv3mr4649759pbb.108.1376400975293; Tue, 13 Aug 2013 06:36:15 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id ef10sm46894669pac.1.2013.08.13.06.36.11 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:36:14 -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 25/35] cpufreq: ppc: Covert to light weight ->target_index() routine Date: Tue, 13 Aug 2013 19:02:38 +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.220.182 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/ppc-corenet-cpufreq.c | 15 ++++----------- drivers/cpufreq/ppc_cbe_cpufreq.c | 12 ++---------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/drivers/cpufreq/ppc-corenet-cpufreq.c b/drivers/cpufreq/ppc-corenet-cpufreq.c index befd489..243a396 100644 --- a/drivers/cpufreq/ppc-corenet-cpufreq.c +++ b/drivers/cpufreq/ppc-corenet-cpufreq.c @@ -253,27 +253,20 @@ static int __exit corenet_cpufreq_cpu_exit(struct cpufreq_policy *policy) } static int corenet_cpufreq_target(struct cpufreq_policy *policy, - unsigned int target_freq, unsigned int relation) + unsigned int index) { struct cpufreq_freqs freqs; - unsigned int new; struct clk *parent; int ret; struct cpu_data *data = per_cpu(cpu_data, policy->cpu); - cpufreq_frequency_table_target(policy, data->table, - target_freq, relation, &new); - - if (policy->cur == data->table[new].frequency) - return 0; - freqs.old = policy->cur; - freqs.new = data->table[new].frequency; + freqs.new = data->table[index].frequency; mutex_lock(&cpufreq_lock); cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); - parent = of_clk_get(data->parent, data->table[new].driver_data); + parent = of_clk_get(data->parent, data->table[index].driver_data); ret = clk_set_parent(data->clk, parent); if (ret) freqs.new = freqs.old; @@ -290,7 +283,7 @@ static struct cpufreq_driver ppc_corenet_cpufreq_driver = { .init = corenet_cpufreq_cpu_init, .exit = __exit_p(corenet_cpufreq_cpu_exit), .verify = cpufreq_generic_frequency_table_verify, - .target = corenet_cpufreq_target, + .target_index = corenet_cpufreq_target, .get = corenet_cpufreq_get_speed, .attr = cpufreq_generic_attr, }; diff --git a/drivers/cpufreq/ppc_cbe_cpufreq.c b/drivers/cpufreq/ppc_cbe_cpufreq.c index 38540d1..52f707d 100644 --- a/drivers/cpufreq/ppc_cbe_cpufreq.c +++ b/drivers/cpufreq/ppc_cbe_cpufreq.c @@ -129,18 +129,10 @@ static int cbe_cpufreq_cpu_init(struct cpufreq_policy *policy) } static int cbe_cpufreq_target(struct cpufreq_policy *policy, - unsigned int target_freq, - unsigned int relation) + unsigned int cbe_pmode_new) { int rc; struct cpufreq_freqs freqs; - unsigned int cbe_pmode_new; - - cpufreq_frequency_table_target(policy, - cbe_freqs, - target_freq, - relation, - &cbe_pmode_new); freqs.old = policy->cur; freqs.new = cbe_freqs[cbe_pmode_new].frequency; @@ -164,7 +156,7 @@ static int cbe_cpufreq_target(struct cpufreq_policy *policy, static struct cpufreq_driver cbe_cpufreq_driver = { .verify = cpufreq_generic_frequency_table_verify, - .target = cbe_cpufreq_target, + .target_index = cbe_cpufreq_target, .init = cbe_cpufreq_cpu_init, .exit = cpufreq_generic_exit, .name = "cbe-cpufreq",