linux-kernel.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,
	linux-arm-kernel@lists.infradead.org,
	Viresh Kumar <viresh.kumar@linaro.org>,
	"David S. Miller" <davem@davemloft.net>,
	sparclinux@vger.kernel.org
Subject: [PATCH V2 32/35] cpufreq: sparc: Covert to light weight ->target_index() routine
Date: Tue, 13 Aug 2013 19:02:45 +0530	[thread overview]
Message-ID: <52d940a4df28344f273481e209dd60a71fd51ed7.1376392602.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <cover.1376392602.git.viresh.kumar@linaro.org>
In-Reply-To: <cover.1376392602.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: David S. Miller <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/sparc-us2e-cpufreq.c | 21 +++------------------
 drivers/cpufreq/sparc-us3-cpufreq.c  | 23 +++--------------------
 2 files changed, 6 insertions(+), 38 deletions(-)

diff --git a/drivers/cpufreq/sparc-us2e-cpufreq.c b/drivers/cpufreq/sparc-us2e-cpufreq.c
index 291688c..3bf5b8f 100644
--- a/drivers/cpufreq/sparc-us2e-cpufreq.c
+++ b/drivers/cpufreq/sparc-us2e-cpufreq.c
@@ -245,8 +245,7 @@ static unsigned int us2e_freq_get(unsigned int cpu)
 	return clock_tick / estar_to_divisor(estar);
 }
 
-static void us2e_set_cpu_divider_index(struct cpufreq_policy *policy,
-		unsigned int index)
+static int us2e_freq_target(struct cpufreq_policy *policy, unsigned int index)
 {
 	unsigned int cpu = policy->cpu;
 	unsigned long new_bits, new_freq;
@@ -277,20 +276,6 @@ static void us2e_set_cpu_divider_index(struct cpufreq_policy *policy,
 	cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
 
 	set_cpus_allowed_ptr(current, &cpus_allowed);
-}
-
-static int us2e_freq_target(struct cpufreq_policy *policy,
-			  unsigned int target_freq,
-			  unsigned int relation)
-{
-	unsigned int new_index = 0;
-
-	if (cpufreq_frequency_table_target(policy,
-					   &us2e_freq_table[policy->cpu].table[0],
-					   target_freq, relation, &new_index))
-		return -EINVAL;
-
-	us2e_set_cpu_divider_index(policy, new_index);
 
 	return 0;
 }
@@ -325,7 +310,7 @@ static int us2e_freq_cpu_exit(struct cpufreq_policy *policy)
 {
 	if (cpufreq_us2e_driver) {
 		cpufreq_frequency_table_put_attr(policy->cpu);
-		us2e_set_cpu_divider_index(policy, 0);
+		us2e_freq_target(policy, 0);
 	}
 
 	return 0;
@@ -358,7 +343,7 @@ static int __init us2e_freq_init(void)
 
 		driver->init = us2e_freq_cpu_init;
 		driver->verify = cpufreq_generic_frequency_table_verify;
-		driver->target = us2e_freq_target;
+		driver->target_index = us2e_freq_target;
 		driver->get = us2e_freq_get;
 		driver->exit = us2e_freq_cpu_exit;
 		strcpy(driver->name, "UltraSPARC-IIe");
diff --git a/drivers/cpufreq/sparc-us3-cpufreq.c b/drivers/cpufreq/sparc-us3-cpufreq.c
index 9b3dbd3..2e54d55 100644
--- a/drivers/cpufreq/sparc-us3-cpufreq.c
+++ b/drivers/cpufreq/sparc-us3-cpufreq.c
@@ -93,8 +93,7 @@ static unsigned int us3_freq_get(unsigned int cpu)
 	return ret;
 }
 
-static void us3_set_cpu_divider_index(struct cpufreq_policy *policy,
-		unsigned int index)
+static int us3_freq_target(struct cpufreq_policy *policy, unsigned int index)
 {
 	unsigned int cpu = policy->cpu;
 	unsigned long new_bits, new_freq, reg;
@@ -136,22 +135,6 @@ static void us3_set_cpu_divider_index(struct cpufreq_policy *policy,
 	cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
 
 	set_cpus_allowed_ptr(current, &cpus_allowed);
-}
-
-static int us3_freq_target(struct cpufreq_policy *policy,
-			  unsigned int target_freq,
-			  unsigned int relation)
-{
-	unsigned int new_index = 0;
-
-	if (cpufreq_frequency_table_target(policy,
-					   &us3_freq_table[policy->cpu].table[0],
-					   target_freq,
-					   relation,
-					   &new_index))
-		return -EINVAL;
-
-	us3_set_cpu_divider_index(policy, new_index);
 
 	return 0;
 }
@@ -182,7 +165,7 @@ static int us3_freq_cpu_exit(struct cpufreq_policy *policy)
 {
 	if (cpufreq_us3_driver) {
 		cpufreq_frequency_table_put_attr(policy->cpu);
-		us3_set_cpu_divider_index(policy, 0);
+		us3_freq_target(policy, 0);
 	}
 
 	return 0;
@@ -219,7 +202,7 @@ static int __init us3_freq_init(void)
 
 		driver->init = us3_freq_cpu_init;
 		driver->verify = cpufreq_generic_frequency_table_verify;
-		driver->target = us3_freq_target;
+		driver->target_index = us3_freq_target;
 		driver->get = us3_freq_get;
 		driver->exit = us3_freq_cpu_exit;
 		strcpy(driver->name, "UltraSPARC-III");
-- 
1.7.12.rc2.18.g61b472e


  parent reply	other threads:[~2013-08-13 13:37 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <a>
2011-04-19 11:43 ` [PATCH 0/3 V3] Introduce strtobool (previously usr_strtobool) Jonathan Cameron
2011-04-19 11:43 ` [PATCH 1/3] Add a strtobool function matching semantics of existing in kernel equivalents Jonathan Cameron
2011-04-19 20:28   ` Ryan Mallon
2011-04-19 11:43 ` [PATCH 2/3] debugfs: move to new strtobool Jonathan Cameron
2011-04-19 20:30   ` Ryan Mallon
2011-04-20  9:33     ` Jonathan Cameron
2011-04-25 22:54       ` Greg KH
2011-04-25 23:11         ` Ryan Mallon
2011-04-19 11:43 ` [PATCH 3/3] params.c: Use new strtobool function to process boolean inputs Jonathan Cameron
2012-07-05  6:28 ` [PATCH] mm/memcg: replace inexistence move_lock_page_cgroup() by move_lock_mem_cgroup() in comment Wanpeng Li
2012-07-09  4:37   ` Kamezawa Hiroyuki
2012-07-11 13:24 ` [PATCH RFC] mm/memcg: calculate max hierarchy limit number instead of min Wanpeng Li
2012-07-11 13:47   ` Michal Hocko
2012-07-12  9:32     ` Wanpeng Li
2012-07-12 10:18       ` Michal Hocko
2012-07-19  6:07   ` Kamezawa Hiroyuki
2012-07-19  6:30     ` Wanpeng Li
2012-07-18  3:05 ` [PATCH] mm/memcg: wrap mem_cgroup_from_css function Wanpeng Li
2012-07-18 21:36   ` Andrew Morton
2012-07-19  1:31     ` Wanpeng Li
2012-07-19  9:14   ` Kirill A. Shutemov
2012-07-19  9:23     ` Wanpeng Li
2012-07-19  9:29       ` Kirill A. Shutemov
     [not found]       ` <20120719093835.GA3776@shangw.(null)>
2012-07-19  9:45         ` Kirill A. Shutemov
2012-07-19 10:19         ` Wanpeng Li
2013-08-13 13:31 ` [PATCH V2 00/35] CPUFreq: Implement light weight ->target(): for 3.13 Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 01/35] cpufreq: Implement light weight ->target_index() routine Viresh Kumar
2013-08-18 10:41     ` amit daniel kachhap
2013-08-13 13:32   ` [PATCH V2 02/35] cpufreq: remove CONFIG_CPU_FREQ_TABLE Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 03/35] cpufreq: acpi: Covert to light weight ->target_index() routine Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 04/35] cpufreq: arm_big_little: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 05/35] cpufreq: at32ap: " Viresh Kumar
2013-08-14  8:00     ` Hans-Christian Egtvedt
2013-08-13 13:32   ` [PATCH V2 06/35] cpufreq: blackfin: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 07/35] cpufreq: cpu0: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 08/35] cpufreq: cris: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 09/35] cpufreq: davinci: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 10/35] cpufreq: dbx500: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 11/35] cpufreq: e_powersaver: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 12/35] cpufreq: elanfreq: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 13/35] cpufreq: exynos: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 14/35] cpufreq: ia64: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 15/35] cpufreq: imx6q: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 16/35] cpufreq: kirkwood: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 17/35] cpufreq: longhaul: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 18/35] cpufreq: loongson2: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 19/35] cpufreq: maple: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 20/35] cpufreq: omap: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 21/35] cpufreq: p4: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 22/35] cpufreq: pasemi: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 23/35] cpufreq: pmac32: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 24/35] cpufreq: powernow: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 25/35] cpufreq: ppc: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 26/35] cpufreq: pxa: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 27/35] cpufreq: s3c2416: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 28/35] cpufreq: s3c64xx: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 29/35] cpufreq: s5pv210: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 30/35] cpufreq: sa11x0: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 31/35] cpufreq: sc520: " Viresh Kumar
2013-08-13 13:32   ` Viresh Kumar [this message]
2013-08-13 13:32   ` [PATCH V2 33/35] cpufreq: SPEAr: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 34/35] cpufreq: speedstep: " Viresh Kumar
2013-08-13 13:32   ` [PATCH V2 35/35] cpufreq: tegra: " Viresh Kumar
2013-08-13 13:46   ` [PATCH V2 00/35] CPUFreq: Implement light weight ->target(): for 3.13 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=52d940a4df28344f273481e209dd60a71fd51ed7.1376392602.git.viresh.kumar@linaro.org \
    --to=viresh.kumar@linaro.org \
    --cc=cpufreq@vger.kernel.org \
    --cc=davem@davemloft.net \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=rjw@sisk.pl \
    --cc=sparclinux@vger.kernel.org \
    /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).