From: tomasz.figa@gmail.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 01/12] ARM: S3C24XX: cpufreq-utils: don't write raw values to MPLLCON when using ccf
Date: Sat, 08 Feb 2014 21:23:24 +0100 [thread overview]
Message-ID: <52F6923C.3040103@gmail.com> (raw)
In-Reply-To: <201312131357.19899.heiko@sntech.de>
Hi Heiko,
On 13.12.2013 13:57, Heiko St?bner wrote:
> The s3c24xx cpufreq driver needs to change the mpll speed and was doing
> this by writing raw values from a translation table into the MPLLCON
> register.
>
> Change this to use a regular clk_set_rate call when using the common
> clock framework and only write the raw value in the samsung_clock case.
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
> arch/arm/mach-s3c24xx/cpufreq-utils.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/arch/arm/mach-s3c24xx/cpufreq-utils.c b/arch/arm/mach-s3c24xx/cpufreq-utils.c
> index 2a0aa56..680a031 100644
> --- a/arch/arm/mach-s3c24xx/cpufreq-utils.c
> +++ b/arch/arm/mach-s3c24xx/cpufreq-utils.c
> @@ -14,6 +14,7 @@
> #include <linux/errno.h>
> #include <linux/cpufreq.h>
> #include <linux/io.h>
> +#include <linux/clk.h>
>
> #include <mach/map.h>
> #include <mach/regs-clock.h>
> @@ -60,5 +61,17 @@ void s3c2410_cpufreq_setrefresh(struct s3c_cpufreq_config *cfg)
> */
> void s3c2410_set_fvco(struct s3c_cpufreq_config *cfg)
> {
> +#ifdef CONFIG_SAMSUNG_CLOCK
> __raw_writel(cfg->pll.driver_data, S3C2410_MPLLCON);
> +#endif
> +
> +#ifdef CONFIG_COMMON_CLK
> + struct clk *mpll = clk_get(NULL, "mpll");
> + if (IS_ERR(mpll))
> + return;
Wouldn't it be more sensible to get the clock only once, at the time
cpufreq is initialized? This would avoid going through the list of all
clocks every CPU frequency change and be more semantically correct.
If there is no good place to put this clk_get() then maybe it could be
simply called on first call to s3c2410_set_fvco() and the clock saved to
a static variable.
Best regards,
Tomasz
next prev parent reply other threads:[~2014-02-08 20:23 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-13 12:56 [PATCH 00/12] ARM: S3C24XX: convert s3c2410, s3c2440 s3c2442 to common clock framework Heiko Stübner
2013-12-13 12:57 ` [PATCH 01/12] ARM: S3C24XX: cpufreq-utils: don't write raw values to MPLLCON when using ccf Heiko Stübner
2014-02-08 20:23 ` Tomasz Figa [this message]
2013-12-13 12:59 ` [PATCH 02/12] dt-bindings: document s3c24xx controller for external clock output Heiko Stübner
2014-02-09 1:54 ` Tomasz Figa
2014-02-16 20:33 ` Heiko Stübner
2014-02-16 20:51 ` Tomasz Figa
2013-12-13 12:59 ` [PATCH 03/12] clk: samsung: add clock driver for external clock outputs Heiko Stübner
2013-12-31 19:46 ` Mike Turquette
2014-02-09 2:25 ` Tomasz Figa
2013-12-13 13:00 ` [PATCH 04/12] ARM: S3C24XX: enable usage of common dclk if common clock framework is enabled Heiko Stübner
2013-12-13 13:00 ` [PATCH 05/12] ARM: S3C24XX: only store clock registers when old clock code is active Heiko Stübner
2013-12-13 13:00 ` [PATCH 06/12] clk: samsung: add plls used by the early s3c24xx cpus Heiko Stübner
2013-12-31 19:45 ` Mike Turquette
2013-12-13 13:01 ` [PATCH 08/12] clk: samsung: add clock controller driver for s3c2410, s3c2440 and s3c2442 Heiko Stübner
2014-02-06 14:12 ` Mike Turquette
2014-02-09 19:34 ` Tomasz Figa
2014-02-17 21:05 ` Heiko Stübner
2014-02-17 22:37 ` Tomasz Figa
2014-02-17 22:48 ` Heiko Stübner
2013-12-13 13:02 ` [PATCH 09/12] ARM: S3C24XX: add platform code for conversion to the common clock framework Heiko Stübner
2013-12-13 13:02 ` [PATCH 10/12] ARM: S3C24XX: convert s3c2440 and s3c2442 to " Heiko Stübner
2013-12-13 13:03 ` [PATCH 11/12] ARM: S3C24XX: convert s3c2410 " Heiko Stübner
2013-12-13 13:03 ` [PATCH 12/12] ARM: S3C24XX: remove legacy clock code Heiko Stübner
2014-02-09 19:56 ` [PATCH 00/12] ARM: S3C24XX: convert s3c2410, s3c2440 s3c2442 to common clock framework Tomasz Figa
2014-02-11 6:16 ` Kukjin Kim
2014-02-11 9:20 ` Heiko Stübner
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=52F6923C.3040103@gmail.com \
--to=tomasz.figa@gmail.com \
--cc=linux-arm-kernel@lists.infradead.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).