From: Ben Dooks <ben-linux@fluff.org>
To: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org
Cc: Ben Dooks <ben-linux@fluff.org>
Subject: [PATCH 1/6] ARM: S3C2443: Use common clock gate code
Date: Sat, 30 Jan 2010 15:11:28 +0200 [thread overview]
Message-ID: <1264857093-4040-2-git-send-email-ben-linux@fluff.org> (raw)
In-Reply-To: <1264857093-4040-1-git-send-email-ben-linux@fluff.org>
Add common clock gate code for each of the S3C2443 clock gate code. Whether
to move this elsewhere will be decided later.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
---
arch/arm/mach-s3c2443/clock.c | 48 +++++++++++-----------------------------
1 files changed, 13 insertions(+), 35 deletions(-)
diff --git a/arch/arm/mach-s3c2443/clock.c b/arch/arm/mach-s3c2443/clock.c
index 3eb8b93..5d061ea 100644
--- a/arch/arm/mach-s3c2443/clock.c
+++ b/arch/arm/mach-s3c2443/clock.c
@@ -53,55 +53,33 @@
* set the correct muxing at initialisation
*/
-static int s3c2443_clkcon_enable_h(struct clk *clk, int enable)
+static int s3c2443_gate(void __iomem *reg, struct clk *clk, int enable)
{
- unsigned int clocks = clk->ctrlbit;
- unsigned long clkcon;
-
- clkcon = __raw_readl(S3C2443_HCLKCON);
+ u32 ctrlbit = clk->ctrlbit;
+ u32 con = __raw_readl(reg);
if (enable)
- clkcon |= clocks;
+ con |= ctrlbit;
else
- clkcon &= ~clocks;
-
- __raw_writel(clkcon, S3C2443_HCLKCON);
+ con &= ~ctrlbit;
+ __raw_writel(con, reg);
return 0;
}
-static int s3c2443_clkcon_enable_p(struct clk *clk, int enable)
+static int s3c2443_clkcon_enable_h(struct clk *clk, int enable)
{
- unsigned int clocks = clk->ctrlbit;
- unsigned long clkcon;
-
- clkcon = __raw_readl(S3C2443_PCLKCON);
-
- if (enable)
- clkcon |= clocks;
- else
- clkcon &= ~clocks;
-
- __raw_writel(clkcon, S3C2443_PCLKCON);
+ return s3c2443_gate(S3C2443_HCLKCON, clk, enable);
+}
- return 0;
+static int s3c2443_clkcon_enable_p(struct clk *clk, int enable)
+{
+ return s3c2443_gate(S3C2443_PCLKCON, clk, enable);
}
static int s3c2443_clkcon_enable_s(struct clk *clk, int enable)
{
- unsigned int clocks = clk->ctrlbit;
- unsigned long clkcon;
-
- clkcon = __raw_readl(S3C2443_SCLKCON);
-
- if (enable)
- clkcon |= clocks;
- else
- clkcon &= ~clocks;
-
- __raw_writel(clkcon, S3C2443_SCLKCON);
-
- return 0;
+ return s3c2443_gate(S3C2443_SCLKCON, clk, enable);
}
static unsigned long s3c2443_roundrate_clksrc(struct clk *clk,
--
1.6.3.3
next prev parent reply other threads:[~2010-01-30 13:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-30 13:11 S3C2443 clock updates Ben Dooks
2010-01-30 13:11 ` Ben Dooks [this message]
2010-01-30 13:11 ` [PATCH 2/6] ARM: S3C2443: Change to using plat-samsung clksrc-clk implementation Ben Dooks
2010-01-30 13:11 ` [PATCH 3/6] ARM: S3C2443: Further clksrc-clk conversions Ben Dooks
2010-01-30 13:11 ` [PATCH 4/6] ARM: S3C2443: Update notes on MPLLREF clock Ben Dooks
2010-01-30 13:11 ` [PATCH 5/6] ARM: S3C2443: Remove #if 0 for clk_mpll Ben Dooks
2010-01-30 13:11 ` [PATCH 6/6] ARM: S3C2443: Add set_rate and round_rate calls for armdiv clock Ben Dooks
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=1264857093-4040-2-git-send-email-ben-linux@fluff.org \
--to=ben-linux@fluff.org \
--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 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.