From cc3eaa512423713bb5b5a7ee15c43bdfff4690d3 Mon Sep 17 00:00:00 2001 From: Sylwester Nawrocki Date: Tue, 28 Aug 2012 15:59:42 -0700 Subject: [PATCH] --- yaml --- r: 326679 b: refs/heads/master c: 98a7069ba04faf3313dcc5fa69476fc3b5ab3794 h: refs/heads/master i: 326677: 49cdf9793995102e80f4d1ce01a06c282c4aaf56 326675: 520b89410f00a23065ea7c8aa62c87eb0dc17671 326671: d7ec195d4a8fcdebf643f1f609e732c00dc5b2d3 v: v3 --- [refs] | 2 +- trunk/arch/arm/mach-s3c24xx/clock-s3c2440.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index d86765f37b82..b709c3847fa1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 859a09e671772db5781d27c9c0b5828a3bca094c +refs/heads/master: 98a7069ba04faf3313dcc5fa69476fc3b5ab3794 diff --git a/trunk/arch/arm/mach-s3c24xx/clock-s3c2440.c b/trunk/arch/arm/mach-s3c24xx/clock-s3c2440.c index cb2883d553b5..749220f91a70 100644 --- a/trunk/arch/arm/mach-s3c24xx/clock-s3c2440.c +++ b/trunk/arch/arm/mach-s3c24xx/clock-s3c2440.c @@ -87,6 +87,19 @@ static int s3c2440_camif_upll_setrate(struct clk *clk, unsigned long rate) return 0; } +static unsigned long s3c2440_camif_upll_getrate(struct clk *clk) +{ + unsigned long parent_rate = clk_get_rate(clk->parent); + unsigned long camdivn = __raw_readl(S3C2440_CAMDIVN); + + if (!(camdivn & S3C2440_CAMDIVN_CAMCLK_SEL)) + return parent_rate; + + camdivn &= S3C2440_CAMDIVN_CAMCLK_MASK; + + return parent_rate / (camdivn + 1) / 2; +} + /* Extra S3C2440 clocks */ static struct clk s3c2440_clk_cam = { @@ -99,6 +112,7 @@ static struct clk s3c2440_clk_cam_upll = { .name = "camif-upll", .ops = &(struct clk_ops) { .set_rate = s3c2440_camif_upll_setrate, + .get_rate = s3c2440_camif_upll_getrate, .round_rate = s3c2440_camif_upll_round, }, };