linux-samsung-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jaecheol Lee <jc.lee@samsung.com>
To: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org
Cc: ben-linux@fluff.org, kgene.kim@samsung.com,
	Jaecheol Lee <jc.lee@samsung.com>
Subject: [PATCH 2/5] ARM: S5PV210: Add struct clk_ops for clk_fout_apll
Date: Wed, 15 Sep 2010 16:52:39 +0900	[thread overview]
Message-ID: <1284537162-3129-3-git-send-email-jc.lee@samsung.com> (raw)
In-Reply-To: <1284537162-3129-1-git-send-email-jc.lee@samsung.com>

Current fout_apll has fixed rate value which was set in initializing
S5PV210 clock structures. CPUFREQ driver gets incorrect frequency when
finding current cpu frequency, because some operation level need to
change APLL. Newly added get_rate function for fout_apll can give
correct frequency when calling get_rate function by CPUFREQ driver.

Signed-off-by: Jaecheol Lee <jc.lee@samsung.com>
---
 arch/arm/mach-s5pv210/clock.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c
index d562670..e18e098 100644
--- a/arch/arm/mach-s5pv210/clock.c
+++ b/arch/arm/mach-s5pv210/clock.c
@@ -31,6 +31,8 @@
 #include <plat/clock-clksrc.h>
 #include <plat/s5pv210.h>
 
+static unsigned long xtal;
+
 static struct clksrc_clk clk_mout_apll = {
 	.clk	= {
 		.name		= "mout_apll",
@@ -268,6 +270,15 @@ static struct clk_ops clk_hclk_imem_ops = {
 	.get_rate	= s5pv210_clk_imem_get_rate,
 };
 
+static unsigned long s5pv210_clk_fout_apll_get_rate(struct clk *clk)
+{
+	return s5p_get_pll45xx(xtal, __raw_readl(S5P_APLL_CON), pll_4508);
+}
+
+static struct clk_ops clk_fout_apll_ops = {
+	.get_rate	= s5pv210_clk_fout_apll_get_rate,
+};
+
 static struct clk init_clocks_disable[] = {
 	{
 		.name		= "rot",
@@ -958,7 +969,6 @@ static struct clksrc_clk *sysclks[] = {
 void __init_or_cpufreq s5pv210_setup_clocks(void)
 {
 	struct clk *xtal_clk;
-	unsigned long xtal;
 	unsigned long vpllsrc;
 	unsigned long armclk;
 	unsigned long hclk_msys;
@@ -996,7 +1006,7 @@ void __init_or_cpufreq s5pv210_setup_clocks(void)
 	vpllsrc = clk_get_rate(&clk_vpllsrc.clk);
 	vpll = s5p_get_pll45xx(vpllsrc, __raw_readl(S5P_VPLL_CON), pll_4502);
 
-	clk_fout_apll.rate = apll;
+	clk_fout_apll.ops = &clk_fout_apll_ops;
 	clk_fout_mpll.rate = mpll;
 	clk_fout_epll.rate = epll;
 	clk_fout_vpll.rate = vpll;
-- 
1.6.2.5

  parent reply	other threads:[~2010-09-15  8:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-15  7:52 [PATCH 0/5] ARM: S5PV210: Add support CPUFREQ for S5PV210/S5PC110 Jaecheol Lee
2010-09-15  7:52 ` [PATCH 1/5] ARM: S5PV210: Add support DMC map_desc table Jaecheol Lee
2010-09-15  7:52 ` Jaecheol Lee [this message]
2010-09-15  7:52 ` [PATCH 3/5] ARM: S5PV210: Add Register definition for CMU Jaecheol Lee
2010-09-15  7:52 ` [PATCH 4/5] ARM: S5PV210: Add support CPUFREQ Jaecheol Lee
2010-09-16  0:36   ` MyungJoo Ham
2010-09-15  7:52 ` [PATCH 5/5] ARM: S5PV210: Update Kconfig and Makefile for supporting CPUFREQ driver Jaecheol Lee
2010-09-16  0:33 ` [PATCH 0/5] ARM: S5PV210: Add support CPUFREQ for S5PV210/S5PC110 Kyungmin Park
2010-09-17  4:24   ` Kukjin Kim
2010-09-17  4:30     ` Kyungmin Park

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=1284537162-3129-3-git-send-email-jc.lee@samsung.com \
    --to=jc.lee@samsung.com \
    --cc=ben-linux@fluff.org \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-samsung-soc@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).