summaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-s3c24xx
diff options
context:
space:
mode:
authorHeiko Stuebner <heiko@sntech.de>2011-10-14 08:08:56 +0200
committerKukjin Kim <kgene.kim@samsung.com>2011-10-14 08:15:51 +0200
commit5f33bd76f5c4df45cd5b2e4132c6451dac8afee9 (patch)
tree8ce2f769d4b0ee8b0cdb44eecea1ecf5b1d9395a /arch/arm/plat-s3c24xx
parentARM: S3C2416: Add comment describing the armdiv/armclk (diff)
downloadlinux-5f33bd76f5c4df45cd5b2e4132c6451dac8afee9.tar.xz
linux-5f33bd76f5c4df45cd5b2e4132c6451dac8afee9.zip
ARM: S3C2443: Add get_rate operation for clk_armdiv
Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/plat-s3c24xx')
-rw-r--r--arch/arm/plat-s3c24xx/s3c2443-clock.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/plat-s3c24xx/s3c2443-clock.c b/arch/arm/plat-s3c24xx/s3c2443-clock.c
index f9c5b0343cf3..fea3d5c0252e 100644
--- a/arch/arm/plat-s3c24xx/s3c2443-clock.c
+++ b/arch/arm/plat-s3c24xx/s3c2443-clock.c
@@ -189,6 +189,19 @@ static unsigned long s3c2443_armclk_roundrate(struct clk *clk,
return parent / best;
}
+static unsigned long s3c2443_armclk_getrate(struct clk *clk)
+{
+ unsigned long rate = clk_get_rate(clk->parent);
+ unsigned long clkcon0;
+ int val;
+
+ clkcon0 = __raw_readl(S3C2443_CLKDIV0);
+ clkcon0 &= armdivmask;
+ val = clkcon0 >> S3C2443_CLKDIV0_ARMDIV_SHIFT;
+
+ return rate / armdiv[val];
+}
+
static int s3c2443_armclk_setrate(struct clk *clk, unsigned long rate)
{
unsigned long parent = clk_get_rate(clk->parent);
@@ -224,6 +237,7 @@ static struct clk clk_armdiv = {
.parent = &clk_msysclk.clk,
.ops = &(struct clk_ops) {
.round_rate = s3c2443_armclk_roundrate,
+ .get_rate = s3c2443_armclk_getrate,
.set_rate = s3c2443_armclk_setrate,
},
};