From patchwork Mon Aug 27 20:12:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sylwester Nawrocki X-Patchwork-Id: 1378361 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 27233DF280 for ; Mon, 27 Aug 2012 20:15:20 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T65fm-0007lw-DU; Mon, 27 Aug 2012 20:12:34 +0000 Received: from mail-we0-f177.google.com ([74.125.82.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T65fj-0007lc-7B for linux-arm-kernel@lists.infradead.org; Mon, 27 Aug 2012 20:12:32 +0000 Received: by weyr3 with SMTP id r3so2704485wey.36 for ; Mon, 27 Aug 2012 13:12:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=zT00L9dT5cmAw7oRzBX5J4dRv3pPMu3Y8AhRC/w87xw=; b=Cn7xm25bXE9+8jYI2T21zSKFmRvi8B/bzfWOE/P+tRZ2bH6mLisJi8ValuRD2hotxM fd6xGHxgNjn3ChW4IF2zsVRqCaXpBvoArVV0/CMfS8GOxU6YVOjdQOzpMHW9D4XYyuiQ 1Om7aVNpfMhFESfhBjXjLoH+UhzdFwHy3hVW/ApMzbQZjqgjJKN9sUyKpdGoWDXp3cbH mDedDwM21/BiyQoVH5KC7QgcqKZeiBUwj34ApPxTk77HCNALJF5LSqF8/pWK9T99pnyT R2jkSHfn5ESJcu+s1ifmy6kXQC1boQjOMQjBmfXRqmnws6+4sVf7+6DlkToLSpHtMv7V vZVg== Received: by 10.216.192.85 with SMTP id h63mr7273263wen.7.1346098347545; Mon, 27 Aug 2012 13:12:27 -0700 (PDT) Received: from localhost.localdomain (031011252076.warszawa.vectranet.pl. [31.11.252.76]) by mx.google.com with ESMTPS id cu1sm959493wib.6.2012.08.27.13.12.26 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 27 Aug 2012 13:12:26 -0700 (PDT) From: Sylwester Nawrocki To: kgene.kim@samsung.com Subject: [PATCH] ARM: S3C24XX: Add .get_rate callback for "camif-upll" clock Date: Mon, 27 Aug 2012 22:12:09 +0200 Message-Id: <1346098329-32059-1-git-send-email-sylvester.nawrocki@gmail.com> X-Mailer: git-send-email 1.7.4.1 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.177 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sylvester.nawrocki[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Sylwester Nawrocki , linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add missing get_rate callback for the "camif-upll" clock, so frequency of this clock is properly reported with clk_get_rate(). Signed-off-by: Sylwester Nawrocki --- arch/arm/mach-s3c24xx/clock-s3c2440.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) -- 1.7.4.1 diff --git a/arch/arm/mach-s3c24xx/clock-s3c2440.c b/arch/arm/mach-s3c24xx/clock-s3c2440.c index cb2883d..749220f 100644 --- a/arch/arm/mach-s3c24xx/clock-s3c2440.c +++ b/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, }, };