mirror of https://lore.kernel.org/lkml/
 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@linaro.org
Subject: [PATCH V2 Resend 03/16] cpufreq: cpu0: use cpufreq_generic_get() routine
Date: Thu, 31 Oct 2013 04:22:01 +0530	[thread overview]
Message-ID: <bcd82142b14cb445e9fbae0aa87f7da469c2d6bd.1383173230.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <cover.1383173230.git.viresh.kumar@linaro.org>
In-Reply-To: <cover.1383173230.git.viresh.kumar@linaro.org>

We have common infrastructure available with us for getting a CPUs clk rate.
Lets use it for this driver.

Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/cpufreq-cpu0.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c
index d4585ce..73f5485 100644
--- a/drivers/cpufreq/cpufreq-cpu0.c
+++ b/drivers/cpufreq/cpufreq-cpu0.c
@@ -30,11 +30,6 @@ static struct clk *cpu_clk;
 static struct regulator *cpu_reg;
 static struct cpufreq_frequency_table *freq_table;
 
-static unsigned int cpu0_get_speed(unsigned int cpu)
-{
-	return clk_get_rate(cpu_clk) / 1000;
-}
-
 static int cpu0_set_target(struct cpufreq_policy *policy, unsigned int index)
 {
 	struct dev_pm_opp *opp;
@@ -100,6 +95,7 @@ static int cpu0_set_target(struct cpufreq_policy *policy, unsigned int index)
 
 static int cpu0_cpufreq_init(struct cpufreq_policy *policy)
 {
+	policy->clk = cpu_clk;
 	return cpufreq_generic_init(policy, freq_table, transition_latency);
 }
 
@@ -107,7 +103,7 @@ static struct cpufreq_driver cpu0_cpufreq_driver = {
 	.flags = CPUFREQ_STICKY,
 	.verify = cpufreq_generic_frequency_table_verify,
 	.target_index = cpu0_set_target,
-	.get = cpu0_get_speed,
+	.get = cpufreq_generic_get,
 	.init = cpu0_cpufreq_init,
 	.exit = cpufreq_generic_exit,
 	.name = "generic_cpu0",
-- 
1.7.12.rc2.18.g61b472e


  parent reply	other threads:[~2013-10-30 22:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-30 22:51 [PATCH V2 Resend 00/16] CPUFreq Cleanup Part V Viresh Kumar
2013-10-30 22:51 ` [PATCH V2 Resend 01/16] cpufreq: create cpufreq_generic_get() routine Viresh Kumar
2013-10-30 22:52 ` [PATCH V2 Resend 02/16] cpufreq: at32ap: use " Viresh Kumar
2013-10-30 22:52 ` Viresh Kumar [this message]
2013-10-30 22:52 ` [PATCH V2 Resend 04/16] cpufreq: davinci: " Viresh Kumar
2013-10-30 22:52 ` [PATCH V2 Resend 05/16] cpufreq: dbx500: " Viresh Kumar
2013-10-30 22:52 ` [PATCH V2 Resend 06/16] cpufreq: exynos: " Viresh Kumar
2013-10-30 22:52 ` [PATCH V2 Resend 07/16] cpufreq: imx6q: " Viresh Kumar
2013-10-30 22:52 ` [PATCH V2 Resend 08/16] cpufreq: loongson2: " Viresh Kumar
2013-10-30 22:52 ` [PATCH V2 Resend 09/16] cpufreq: omap: " Viresh Kumar
2013-10-30 22:52 ` [PATCH V2 Resend 10/16] cpufreq: ppc: " Viresh Kumar
2013-10-30 22:52 ` [PATCH V2 Resend 11/16] cpufreq: s3c: " Viresh Kumar
2013-10-30 22:52 ` [PATCH V2 Resend 12/16] cpufreq: s5pv210: " Viresh Kumar
2013-10-30 22:52 ` [PATCH V2 Resend 13/16] cpufreq: spear: " Viresh Kumar
2013-10-30 22:52 ` [PATCH V2 Resend 14/16] cpufreq: tegra: remove target_cpu_speed[] array Viresh Kumar
2013-10-30 22:52 ` [PATCH V2 Resend 15/16] cpufreq: tegra: use cpufreq_generic_get() routine Viresh Kumar
2013-10-30 22:52 ` [PATCH V2 Resend 16/16] cpufreq: unicore2: " 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=bcd82142b14cb445e9fbae0aa87f7da469c2d6bd.1383173230.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=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

Powered by JetHome