From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org,
Mike Turquette <mturquette@ti.com>,
Mike Turquette <mturquette@linaro.org>,
Samuel Ortiz <sameo@linux.intel.com>,
cpufreq@vger.kernel.org, linux-pm@vger.kernel.org,
Linus Walleij <linus.walleij@linaro.org>,
Lee Jones <lee.jones@linaro.org>,
Philippe Begnic <philippe.begnic@st.com>,
Rickard Andersson <rickard.andersson@stericsson.com>,
Jonas Aberg <jonas.aberg@stericsson.com>,
Vincent Guittot <vincent.guittot@linaro.org>
Subject: Re: [PATCH 8/8] cpufreq: db8500: Use armss clk to update frequency
Date: Fri, 26 Oct 2012 13:20:38 +0200 [thread overview]
Message-ID: <2835962.VLrrN08061@vostro.rjw.lan> (raw)
In-Reply-To: <CAPDyKFp8OVn1kXzQB_PVxb4PBYCdvE7QGzCiqN+Zmm9LsX3HDg@mail.gmail.com>
On Friday, October 26, 2012 10:10:40 AM Ulf Hansson wrote:
> On 10 October 2012 13:42, Ulf Hansson <ulf.hansson@stericsson.com> wrote:
> > From: Ulf Hansson <ulf.hansson@linaro.org>
> >
> > Using the armss clk to update the frequency makes the driver no more
> > directly dependant on the prmcu API.
> >
> > Cc: Rafael J. Wysocki <rjw@sisk.pl>
> > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> > ---
> > drivers/cpufreq/db8500-cpufreq.c | 24 ++++++++++++++++--------
> > 1 file changed, 16 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/cpufreq/db8500-cpufreq.c b/drivers/cpufreq/db8500-cpufreq.c
> > index dea9a49..4f154bc 100644
> > --- a/drivers/cpufreq/db8500-cpufreq.c
> > +++ b/drivers/cpufreq/db8500-cpufreq.c
> > @@ -14,10 +14,11 @@
> > #include <linux/delay.h>
> > #include <linux/slab.h>
> > #include <linux/platform_device.h>
> > -#include <linux/mfd/dbx500-prcmu.h>
> > +#include <linux/clk.h>
> > #include <mach/id.h>
> >
> > static struct cpufreq_frequency_table *freq_table;
> > +static struct clk *armss_clk;
> >
> > static struct freq_attr *db8500_cpufreq_attr[] = {
> > &cpufreq_freq_attr_scaling_available_freqs,
> > @@ -58,9 +59,9 @@ static int db8500_cpufreq_target(struct cpufreq_policy *policy,
> > for_each_cpu(freqs.cpu, policy->cpus)
> > cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
> >
> > - /* request the PRCM unit for opp change */
> > - if (prcmu_set_arm_opp(freq_table[idx].index)) {
> > - pr_err("db8500-cpufreq: Failed to set OPP level\n");
> > + /* update armss clk frequency */
> > + if (clk_set_rate(armss_clk, freq_table[idx].frequency * 1000)) {
> > + pr_err("db8500-cpufreq: Failed to update armss clk\n");
> > return -EINVAL;
> > }
> >
> > @@ -74,16 +75,16 @@ static int db8500_cpufreq_target(struct cpufreq_policy *policy,
> > static unsigned int db8500_cpufreq_getspeed(unsigned int cpu)
> > {
> > int i = 0;
> > - /* request the prcm to get the current ARM opp */
> > - int opp = prcmu_get_arm_opp();
> > + unsigned long freq = clk_get_rate(armss_clk) / 1000;
> >
> > while (freq_table[i].frequency != CPUFREQ_TABLE_END) {
> > - if (opp == freq_table[i].index)
> > + if (freq <= freq_table[i].frequency)
> > return freq_table[i].frequency;
> > i++;
> > }
> >
> > - /* We could not find a corresponding opp frequency. */
> > + /* We could not find a corresponding frequency. */
> > + pr_err("db8500-cpufreq: Failed to find cpufreq speed\n");
> > return 0;
> > }
> >
> > @@ -92,6 +93,12 @@ static int __cpuinit db8500_cpufreq_init(struct cpufreq_policy *policy)
> > int i = 0;
> > int res;
> >
> > + armss_clk = clk_get(NULL, "armss");
> > + if (IS_ERR(armss_clk)) {
> > + pr_err("db8500-cpufreq : Failed to get armss clk\n");
> > + return PTR_ERR(armss_clk);
> > + }
> > +
> > pr_info("db8500-cpufreq : Available frequencies:\n");
> > while (freq_table[i].frequency != CPUFREQ_TABLE_END) {
> > pr_info(" %d Mhz\n", freq_table[i].frequency/1000);
> > @@ -104,6 +111,7 @@ static int __cpuinit db8500_cpufreq_init(struct cpufreq_policy *policy)
> > cpufreq_frequency_table_get_attr(freq_table, policy->cpu);
> > else {
> > pr_err("db8500-cpufreq : Failed to read policy table\n");
> > + clk_put(armss_clk);
> > return res;
> > }
> >
> > --
> > 1.7.10
> >
>
> Just a kind reminder on this Rafael; trying to collect acks, do you
> think we can advise Mike to merge this though his clk tree?
Yes, please.
Thanks,
Rafael
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
WARNING: multiple messages have this Message-ID (diff)
From: rjw@sisk.pl (Rafael J. Wysocki)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 8/8] cpufreq: db8500: Use armss clk to update frequency
Date: Fri, 26 Oct 2012 13:20:38 +0200 [thread overview]
Message-ID: <2835962.VLrrN08061@vostro.rjw.lan> (raw)
In-Reply-To: <CAPDyKFp8OVn1kXzQB_PVxb4PBYCdvE7QGzCiqN+Zmm9LsX3HDg@mail.gmail.com>
On Friday, October 26, 2012 10:10:40 AM Ulf Hansson wrote:
> On 10 October 2012 13:42, Ulf Hansson <ulf.hansson@stericsson.com> wrote:
> > From: Ulf Hansson <ulf.hansson@linaro.org>
> >
> > Using the armss clk to update the frequency makes the driver no more
> > directly dependant on the prmcu API.
> >
> > Cc: Rafael J. Wysocki <rjw@sisk.pl>
> > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> > ---
> > drivers/cpufreq/db8500-cpufreq.c | 24 ++++++++++++++++--------
> > 1 file changed, 16 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/cpufreq/db8500-cpufreq.c b/drivers/cpufreq/db8500-cpufreq.c
> > index dea9a49..4f154bc 100644
> > --- a/drivers/cpufreq/db8500-cpufreq.c
> > +++ b/drivers/cpufreq/db8500-cpufreq.c
> > @@ -14,10 +14,11 @@
> > #include <linux/delay.h>
> > #include <linux/slab.h>
> > #include <linux/platform_device.h>
> > -#include <linux/mfd/dbx500-prcmu.h>
> > +#include <linux/clk.h>
> > #include <mach/id.h>
> >
> > static struct cpufreq_frequency_table *freq_table;
> > +static struct clk *armss_clk;
> >
> > static struct freq_attr *db8500_cpufreq_attr[] = {
> > &cpufreq_freq_attr_scaling_available_freqs,
> > @@ -58,9 +59,9 @@ static int db8500_cpufreq_target(struct cpufreq_policy *policy,
> > for_each_cpu(freqs.cpu, policy->cpus)
> > cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
> >
> > - /* request the PRCM unit for opp change */
> > - if (prcmu_set_arm_opp(freq_table[idx].index)) {
> > - pr_err("db8500-cpufreq: Failed to set OPP level\n");
> > + /* update armss clk frequency */
> > + if (clk_set_rate(armss_clk, freq_table[idx].frequency * 1000)) {
> > + pr_err("db8500-cpufreq: Failed to update armss clk\n");
> > return -EINVAL;
> > }
> >
> > @@ -74,16 +75,16 @@ static int db8500_cpufreq_target(struct cpufreq_policy *policy,
> > static unsigned int db8500_cpufreq_getspeed(unsigned int cpu)
> > {
> > int i = 0;
> > - /* request the prcm to get the current ARM opp */
> > - int opp = prcmu_get_arm_opp();
> > + unsigned long freq = clk_get_rate(armss_clk) / 1000;
> >
> > while (freq_table[i].frequency != CPUFREQ_TABLE_END) {
> > - if (opp == freq_table[i].index)
> > + if (freq <= freq_table[i].frequency)
> > return freq_table[i].frequency;
> > i++;
> > }
> >
> > - /* We could not find a corresponding opp frequency. */
> > + /* We could not find a corresponding frequency. */
> > + pr_err("db8500-cpufreq: Failed to find cpufreq speed\n");
> > return 0;
> > }
> >
> > @@ -92,6 +93,12 @@ static int __cpuinit db8500_cpufreq_init(struct cpufreq_policy *policy)
> > int i = 0;
> > int res;
> >
> > + armss_clk = clk_get(NULL, "armss");
> > + if (IS_ERR(armss_clk)) {
> > + pr_err("db8500-cpufreq : Failed to get armss clk\n");
> > + return PTR_ERR(armss_clk);
> > + }
> > +
> > pr_info("db8500-cpufreq : Available frequencies:\n");
> > while (freq_table[i].frequency != CPUFREQ_TABLE_END) {
> > pr_info(" %d Mhz\n", freq_table[i].frequency/1000);
> > @@ -104,6 +111,7 @@ static int __cpuinit db8500_cpufreq_init(struct cpufreq_policy *policy)
> > cpufreq_frequency_table_get_attr(freq_table, policy->cpu);
> > else {
> > pr_err("db8500-cpufreq : Failed to read policy table\n");
> > + clk_put(armss_clk);
> > return res;
> > }
> >
> > --
> > 1.7.10
> >
>
> Just a kind reminder on this Rafael; trying to collect acks, do you
> think we can advise Mike to merge this though his clk tree?
Yes, please.
Thanks,
Rafael
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
next prev parent reply other threads:[~2012-10-26 11:20 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-10 11:42 [PATCH 0/8] clk: ux500: Fixup smp_twd clk for clk notifiers Ulf Hansson
2012-10-10 11:42 ` Ulf Hansson
2012-10-10 11:42 ` [PATCH 1/8] ARM: ux500: Remove cpufreq platform device Ulf Hansson
2012-10-10 11:42 ` Ulf Hansson
2012-10-10 11:42 ` [PATCH 2/8] mfd: db8500: Provide cpufreq table as platform data Ulf Hansson
2012-10-10 11:42 ` Ulf Hansson
2012-10-10 11:42 ` [PATCH 3/8] cpufreq: db8500: Register as a platform driver Ulf Hansson
2012-10-10 11:42 ` Ulf Hansson
2012-10-10 11:42 ` [PATCH 4/8] cpufreq: db8500: Fetch cpufreq table from platform data Ulf Hansson
2012-10-10 11:42 ` Ulf Hansson
2012-10-11 13:41 ` Lee Jones
2012-10-11 13:41 ` Lee Jones
2012-10-11 15:49 ` Lee Jones
2012-10-11 15:49 ` Lee Jones
2012-10-10 11:42 ` [PATCH 5/8] mfd: db8500: Connect ARMSS clk to ARM OPP Ulf Hansson
2012-10-10 11:42 ` Ulf Hansson
2012-10-10 11:42 ` [PATCH 6/8] clk: ux500: Support for prcmu_scalable_rate clock Ulf Hansson
2012-10-10 11:42 ` Ulf Hansson
2012-10-10 11:42 ` [PATCH 7/8] clk: ux500: Add armss clk and fixup smp_twd clk for u8500 Ulf Hansson
2012-10-10 11:42 ` Ulf Hansson
2012-10-10 11:42 ` [PATCH 8/8] cpufreq: db8500: Use armss clk to update frequency Ulf Hansson
2012-10-10 11:42 ` Ulf Hansson
2012-10-26 8:10 ` Ulf Hansson
2012-10-26 8:10 ` Ulf Hansson
2012-10-26 11:20 ` Rafael J. Wysocki [this message]
2012-10-26 11:20 ` Rafael J. Wysocki
2012-10-11 13:44 ` [PATCH 0/8] clk: ux500: Fixup smp_twd clk for clk notifiers Lee Jones
2012-10-11 13:44 ` Lee Jones
2012-10-11 14:24 ` Linus Walleij
2012-10-11 14:24 ` Linus Walleij
2012-10-11 15:19 ` Lee Jones
2012-10-11 15:19 ` Lee Jones
2012-10-26 8:19 ` Ulf Hansson
2012-10-26 8:19 ` Ulf Hansson
2012-10-26 8:19 ` Ulf Hansson
2012-10-26 8:57 ` Linus Walleij
2012-10-26 8:57 ` Linus Walleij
2012-10-26 18:03 ` Mike Turquette
2012-10-26 18:03 ` Mike Turquette
2012-10-26 23:34 ` Linus Walleij
2012-10-26 23:34 ` Linus Walleij
2012-10-28 22:59 ` Samuel Ortiz
2012-10-28 22:59 ` Samuel Ortiz
2012-10-28 22:59 ` Samuel Ortiz
2012-11-05 12:33 ` Ulf Hansson
2012-11-05 12:33 ` Ulf Hansson
2012-11-05 12:33 ` Ulf Hansson
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=2835962.VLrrN08061@vostro.rjw.lan \
--to=rjw@sisk.pl \
--cc=cpufreq@vger.kernel.org \
--cc=jonas.aberg@stericsson.com \
--cc=lee.jones@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=mturquette@linaro.org \
--cc=mturquette@ti.com \
--cc=philippe.begnic@st.com \
--cc=rickard.andersson@stericsson.com \
--cc=sameo@linux.intel.com \
--cc=ulf.hansson@linaro.org \
--cc=vincent.guittot@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.