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 15/16] cpufreq: tegra: use cpufreq_generic_get() routine
Date: Thu, 31 Oct 2013 04:22:13 +0530 [thread overview]
Message-ID: <9d3de82b097a5d05a1ca5cff4e23399e28fbcfff.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.
Cc: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/cpufreq/tegra-cpufreq.c | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/drivers/cpufreq/tegra-cpufreq.c b/drivers/cpufreq/tegra-cpufreq.c
index 7d36b54..360d1a7 100644
--- a/drivers/cpufreq/tegra-cpufreq.c
+++ b/drivers/cpufreq/tegra-cpufreq.c
@@ -50,17 +50,6 @@ static struct clk *emc_clk;
static DEFINE_MUTEX(tegra_cpu_lock);
static bool is_suspended;
-static unsigned int tegra_getspeed(unsigned int cpu)
-{
- unsigned long rate;
-
- if (cpu >= NUM_CPUS)
- return 0;
-
- rate = clk_get_rate(cpu_clk) / 1000;
- return rate;
-}
-
static int tegra_cpu_clk_set_rate(unsigned long rate)
{
int ret;
@@ -144,7 +133,7 @@ static int tegra_pm_notify(struct notifier_block *nb, unsigned long event,
is_suspended = true;
pr_info("Tegra cpufreq suspend: setting frequency to %d kHz\n",
freq_table[0].frequency);
- if (tegra_getspeed(0) != freq_table[0].frequency)
+ if (clk_get_rate(cpu_clk) / 1000 != freq_table[0].frequency)
tegra_update_cpu_speed(policy, freq_table[0].frequency);
cpufreq_cpu_put(policy);
} else if (event == PM_POST_SUSPEND) {
@@ -180,6 +169,7 @@ static int tegra_cpu_init(struct cpufreq_policy *policy)
if (policy->cpu == 0)
register_pm_notifier(&tegra_cpu_pm_notifier);
+ policy->clk = cpu_clk;
return 0;
}
@@ -194,7 +184,7 @@ static int tegra_cpu_exit(struct cpufreq_policy *policy)
static struct cpufreq_driver tegra_cpufreq_driver = {
.verify = cpufreq_generic_frequency_table_verify,
.target_index = tegra_target,
- .get = tegra_getspeed,
+ .get = cpufreq_generic_get,
.init = tegra_cpu_init,
.exit = tegra_cpu_exit,
.name = "tegra",
--
1.7.12.rc2.18.g61b472e
next prev parent reply other threads:[~2013-10-30 22:52 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 ` [PATCH V2 Resend 03/16] cpufreq: cpu0: " Viresh Kumar
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 ` Viresh Kumar [this message]
2013-10-30 22:52 ` [PATCH V2 Resend 16/16] cpufreq: unicore2: use cpufreq_generic_get() routine 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=9d3de82b097a5d05a1ca5cff4e23399e28fbcfff.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;
as well as URLs for NNTP newsgroup(s).