linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
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 <viresh.kumar@linaro.org>,
	Sekhar Nori <nsekhar@ti.com>
Subject: [PATCH V2 Resend 08/34] cpufreq: davinci: Convert to light weight ->target_index() routine
Date: Fri, 18 Oct 2013 19:29:31 +0530	[thread overview]
Message-ID: <ac3be705734fae59b6090949361e779abc9a2ec6.1382104515.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <cover.1382104514.git.viresh.kumar@linaro.org>
In-Reply-To: <cover.1382104514.git.viresh.kumar@linaro.org>

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.

Cc: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/davinci-cpufreq.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/drivers/cpufreq/davinci-cpufreq.c b/drivers/cpufreq/davinci-cpufreq.c
index 972583b..1f5d8a5 100644
--- a/drivers/cpufreq/davinci-cpufreq.c
+++ b/drivers/cpufreq/davinci-cpufreq.c
@@ -66,28 +66,18 @@ static unsigned int davinci_getspeed(unsigned int cpu)
 	return clk_get_rate(cpufreq.armclk) / 1000;
 }
 
-static int davinci_target(struct cpufreq_policy *policy,
-				unsigned int target_freq, unsigned int relation)
+static int davinci_target(struct cpufreq_policy *policy, unsigned int idx)
 {
 	int ret = 0;
-	unsigned int idx;
 	struct cpufreq_freqs freqs;
 	struct davinci_cpufreq_config *pdata = cpufreq.dev->platform_data;
 	struct clk *armclk = cpufreq.armclk;
 
 	freqs.old = davinci_getspeed(0);
-	freqs.new = clk_round_rate(armclk, target_freq * 1000) / 1000;
-
-	if (freqs.old == freqs.new)
-		return ret;
+	freqs.new = pdata->freq_table[idx].frequency;
 
 	dev_dbg(cpufreq.dev, "transition: %u --> %u\n", freqs.old, freqs.new);
 
-	ret = cpufreq_frequency_table_target(policy, pdata->freq_table,
-						freqs.new, relation, &idx);
-	if (ret)
-		return -EINVAL;
-
 	cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
 
 	/* if moving to higher frequency, up the voltage beforehand */
@@ -148,7 +138,7 @@ static int davinci_cpu_init(struct cpufreq_policy *policy)
 static struct cpufreq_driver davinci_driver = {
 	.flags		= CPUFREQ_STICKY,
 	.verify		= davinci_verify_speed,
-	.target		= davinci_target,
+	.target_index	= davinci_target,
 	.get		= davinci_getspeed,
 	.init		= davinci_cpu_init,
 	.exit		= cpufreq_generic_exit,
-- 
1.7.12.rc2.18.g61b472e

  parent reply	other threads:[~2013-10-18 13:59 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-18 13:59 [PATCH V2 Resend 00/34] CPUFreq Cleanup Part III Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 01/34] cpufreq: Implement light weight ->target_index() routine Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 02/34] cpufreq: acpi: Convert to " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 03/34] cpufreq: arm_big_little: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 04/34] cpufreq: at32ap: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 05/34] cpufreq: blackfin: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 06/34] cpufreq: cpu0: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 07/34] cpufreq: cris: " Viresh Kumar
2013-10-18 13:59 ` Viresh Kumar [this message]
2013-10-18 13:59 ` [PATCH V2 Resend 09/34] cpufreq: dbx500: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 10/34] cpufreq: e_powersaver: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 11/34] cpufreq: elanfreq: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 12/34] cpufreq: exynos: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 13/34] cpufreq: ia64: " Viresh Kumar
2013-10-22 16:32   ` Luck, Tony
2013-10-18 13:59 ` [PATCH V2 Resend 14/34] cpufreq: imx6q: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 15/34] cpufreq: kirkwood: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 16/34] cpufreq: longhaul: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 17/34] cpufreq: loongson2: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 18/34] cpufreq: maple: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 19/34] cpufreq: omap: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 20/34] cpufreq: p4: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 21/34] cpufreq: pasemi: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 22/34] cpufreq: pmac32: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 23/34] cpufreq: powernow: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 24/34] cpufreq: ppc: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 25/34] cpufreq: pxa: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 26/34] cpufreq: s3c2416: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 27/34] cpufreq: s3c64xx: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 28/34] cpufreq: s5pv210: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 29/34] cpufreq: sa11x0: " Viresh Kumar
2013-10-18 15:46   ` Russell King - ARM Linux
2013-10-21  9:23     ` Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 30/34] cpufreq: sc520: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 31/34] cpufreq: sparc: " Viresh Kumar
2013-10-18 17:30   ` David Miller
2013-10-18 13:59 ` [PATCH V2 Resend 32/34] cpufreq: SPEAr: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 33/34] cpufreq: speedstep: " Viresh Kumar
2013-10-18 13:59 ` [PATCH V2 Resend 34/34] cpufreq: tegra: " Viresh Kumar
2013-10-25 12:56 ` [PATCH V2 Resend 00/34] CPUFreq Cleanup Part III Rafael J. Wysocki
2013-10-25 13:55   ` Viresh Kumar
2013-10-25 14:12     ` Rafael J. Wysocki
2013-10-25 14:16       ` Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ac3be705734fae59b6090949361e779abc9a2ec6.1382104515.git.viresh.kumar@linaro.org \
    --to=viresh.kumar@linaro.org \
    --cc=cpufreq@vger.kernel.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nsekhar@ti.com \
    --cc=patches@linaro.org \
    --cc=rjw@sisk.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).