From patchwork Mon Aug 12 17:48:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19032 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f70.google.com (mail-vb0-f70.google.com [209.85.212.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4DEA1246B8 for ; Mon, 12 Aug 2013 17:52:09 +0000 (UTC) Received: by mail-vb0-f70.google.com with SMTP id h10sf5464863vbh.5 for ; Mon, 12 Aug 2013 10:52:09 -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=K+fQ1SVzAzo2y+qEAdMd9vDkx4n8HFzy/6XifIBuhIs=; b=W/eEPPXGJgxOFg/ZxbiaO1bXXEAi6YUiOwHtvx4Co7SXZhtr30UdXmyC9Tw3WHCNlI rFpbeGlHUk2syKKaQyEKIBVV6XXOAvpZpVy4LK6MjNgmFfD2BWt/eaY9i+smPJbsriqA epHkvvQAwetf5riSQ/qowS25X2qC3QTOmj2NvTSkPZreBaNA0l3y8uTjmgi29R55n62c wh0Qp9K4k0wX6HiQdAre1kt/a6C/9DornQ87GDIdgeRrCx/AbSHZd2gZkXpNr7vBn/HT qwnYrN+LnNw1YHgSDUuSGKe95ttivigUF9M71hUXkuKo56JzXaaVOMjq8DHXI6EtoT7Y zqUg== X-Received: by 10.236.221.198 with SMTP id r66mr77894yhp.5.1376329929071; Mon, 12 Aug 2013 10:52:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.94.131 with SMTP id dc3ls2522392qeb.58.gmail; Mon, 12 Aug 2013 10:52:08 -0700 (PDT) X-Received: by 10.58.201.69 with SMTP id jy5mr154622vec.29.1376329928914; Mon, 12 Aug 2013 10:52:08 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id q4si7252385vce.49.2013.08.12.10.52.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:52:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.170 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.170; Received: by mail-vc0-f170.google.com with SMTP id kw10so3069089vcb.29 for ; Mon, 12 Aug 2013 10:52:08 -0700 (PDT) X-Gm-Message-State: ALoCoQkYx7TUOMN0h/ZueTn5HO3z3Db+gLJkyOjQdZX/2gJJRuNWOVQ/Y9JoxXt8GR7n0owFeazk X-Received: by 10.58.200.73 with SMTP id jq9mr146399vec.53.1376329928837; Mon, 12 Aug 2013 10:52:08 -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 u4csp108281vcz; Mon, 12 Aug 2013 10:52:08 -0700 (PDT) X-Received: by 10.66.246.133 with SMTP id xw5mr234031pac.114.1376329927981; Mon, 12 Aug 2013 10:52:07 -0700 (PDT) Received: from mail-pd0-f175.google.com (mail-pd0-f175.google.com [209.85.192.175]) by mx.google.com with ESMTPS id gx9si23334128pac.11.2013.08.12.10.52.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:52:07 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.175 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.175; Received: by mail-pd0-f175.google.com with SMTP id q10so3696816pdj.20 for ; Mon, 12 Aug 2013 10:52:07 -0700 (PDT) X-Received: by 10.68.181.227 with SMTP id dz3mr226545pbc.167.1376329927545; Mon, 12 Aug 2013 10:52:07 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id yg1sm38637590pbb.1.2013.08.12.10.52.03 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:52:07 -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 22/31] cpufreq: pmac32: Covert to light weight ->target() routine Date: Mon, 12 Aug 2013 23:18:58 +0530 Message-Id: <6747649dc9f672e20a782d15fbf55e2bdaa2ef05.1376329128.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.170 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_old() to newly defined light weight .target() 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/pmac32-cpufreq.c | 12 +++--------- drivers/cpufreq/pmac64-cpufreq.c | 17 ++++------------- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/drivers/cpufreq/pmac32-cpufreq.c b/drivers/cpufreq/pmac32-cpufreq.c index b465c0c..1032d5d 100644 --- a/drivers/cpufreq/pmac32-cpufreq.c +++ b/drivers/cpufreq/pmac32-cpufreq.c @@ -373,17 +373,11 @@ static unsigned int pmac_cpufreq_get_speed(unsigned int cpu) } static int pmac_cpufreq_target( struct cpufreq_policy *policy, - unsigned int target_freq, - unsigned int relation) + unsigned int index) { - unsigned int newstate = 0; int rc; - if (cpufreq_frequency_table_target(policy, pmac_cpu_freqs, - target_freq, relation, &newstate)) - return -EINVAL; - - rc = do_set_cpu_speed(policy, newstate, 1); + rc = do_set_cpu_speed(policy, index, 1); ppc_proc_freq = cur_freq * 1000ul; return rc; @@ -458,7 +452,7 @@ static int pmac_cpufreq_resume(struct cpufreq_policy *policy) static struct cpufreq_driver pmac_cpufreq_driver = { .verify = cpufreq_generic_frequency_table_verify, - .target_old = pmac_cpufreq_target, + .target = pmac_cpufreq_target, .get = pmac_cpufreq_get_speed, .init = pmac_cpufreq_cpu_init, .suspend = pmac_cpufreq_suspend, diff --git a/drivers/cpufreq/pmac64-cpufreq.c b/drivers/cpufreq/pmac64-cpufreq.c index 52d5d13..7d4ddac 100644 --- a/drivers/cpufreq/pmac64-cpufreq.c +++ b/drivers/cpufreq/pmac64-cpufreq.c @@ -311,27 +311,18 @@ static int g5_pfunc_query_freq(void) * Common interface to the cpufreq core */ -static int g5_cpufreq_target(struct cpufreq_policy *policy, - unsigned int target_freq, unsigned int relation) +static int g5_cpufreq_target(struct cpufreq_policy *policy, unsigned int index) { - unsigned int newstate = 0; struct cpufreq_freqs freqs; int rc; - if (cpufreq_frequency_table_target(policy, g5_cpu_freqs, - target_freq, relation, &newstate)) - return -EINVAL; - - if (g5_pmode_cur == newstate) - return 0; - mutex_lock(&g5_switch_mutex); freqs.old = g5_cpu_freqs[g5_pmode_cur].frequency; - freqs.new = g5_cpu_freqs[newstate].frequency; + freqs.new = g5_cpu_freqs[index].frequency; cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); - rc = g5_switch_freq(newstate); + rc = g5_switch_freq(index); cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); mutex_unlock(&g5_switch_mutex); @@ -362,7 +353,7 @@ static struct cpufreq_driver g5_cpufreq_driver = { .flags = CPUFREQ_CONST_LOOPS, .init = g5_cpufreq_cpu_init, .verify = cpufreq_generic_frequency_table_verify, - .target_old = g5_cpufreq_target, + .target = g5_cpufreq_target, .get = g5_cpufreq_get_speed, .attr = cpufreq_generic_attr, };