From patchwork Wed Dec 14 04:31:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Turquette X-Patchwork-Id: 5665 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id DB5B723E01 for ; Wed, 14 Dec 2011 04:34:45 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id D1735A1835A for ; Wed, 14 Dec 2011 04:34:45 +0000 (UTC) Received: by mail-ey0-f180.google.com with SMTP id k10so61148eaa.11 for ; Tue, 13 Dec 2011 20:34:45 -0800 (PST) Received: by 10.204.152.138 with SMTP id g10mr210370bkw.36.1323837285687; Tue, 13 Dec 2011 20:34:45 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.129.2 with SMTP id hg2cs101260bkc; Tue, 13 Dec 2011 20:34:45 -0800 (PST) Received: by 10.68.191.197 with SMTP id ha5mr1122176pbc.32.1323837283261; Tue, 13 Dec 2011 20:34:43 -0800 (PST) Received: from na3sys009aog120.obsmtp.com ([74.125.149.140]) by mx.google.com with SMTP id z4si5118486pbp.34.2011.12.13.20.34.39 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 13 Dec 2011 20:34:43 -0800 (PST) Received-SPF: pass (google.com: domain of mturquette@ti.com designates 74.125.149.140 as permitted sender) client-ip=74.125.149.140; Authentication-Results: mx.google.com; spf=pass (google.com: domain of mturquette@ti.com designates 74.125.149.140 as permitted sender) smtp.mail=mturquette@ti.com Received: from mail-gy0-f179.google.com ([209.85.160.179]) (using TLSv1) by na3sys009aob120.postini.com ([74.125.148.12]) with SMTP ID DSNKTugnXjenGA+oI6e9GhsMYCGh9bAPKsvf@postini.com; Tue, 13 Dec 2011 20:34:43 PST Received: by mail-gy0-f179.google.com with SMTP id r11so333079ghr.38 for ; Tue, 13 Dec 2011 20:34:38 -0800 (PST) Received: by 10.236.153.226 with SMTP id f62mr8950023yhk.62.1323837278651; Tue, 13 Dec 2011 20:34:38 -0800 (PST) Received: from localhost.localdomain (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id v48sm2145601yhk.6.2011.12.13.20.34.35 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 13 Dec 2011 20:34:38 -0800 (PST) From: Mike Turquette To: linux@arm.linux.org.uk Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, khilman@ti.com, tony@atomide.com, b-cousson@ti.com, rnayak@ti.com, jeremy.kerr@canonical.com, paul@pwsan.com, broonie@opensource.wolfsonmicro.com, tglx@linutronix.de, linus.walleij@stericsson.com, amit.kucheria@linaro.org, dsaxena@linaro.org, patches@linaro.org, linaro-dev@lists.linaro.org, grant.likely@secretlab.ca, sboyd@quicinc.com, shawn.guo@freescale.com, skannan@quicinc.com, magnus.damm@gmail.com, arnd.bergmann@linaro.org, eric.miao@linaro.org, richard.zhao@linaro.org, mturquette@linaro.org, mturquette@ti.com, andrew@lunn.ch Subject: [PATCH 2/6] omap: clk: .round_rate for propagating to parents Date: Tue, 13 Dec 2011 20:31:24 -0800 Message-Id: <1323837088-2469-3-git-send-email-mturquette@ti.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1323837088-2469-1-git-send-email-mturquette@ti.com> References: <1323837088-2469-1-git-send-email-mturquette@ti.com> This patch introduces omap2_passthrough_round_rate which is a new .round_rate that works with the generic struct clk_ops defined in include/linux/clk.h. The purpose of this .round_rate is to allow an OMAP clk to make no changes to its own dividers (if applicable) and instead defer the rate change up to the clk's parent. Not-signed-off-by: Mike Turquette --- arch/arm/mach-omap2/clkt_clksel.c | 8 ++++++++ arch/arm/mach-omap2/clock.h | 2 ++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/clkt_clksel.c b/arch/arm/mach-omap2/clkt_clksel.c index ad3befb..0f151ce 100644 --- a/arch/arm/mach-omap2/clkt_clksel.c +++ b/arch/arm/mach-omap2/clkt_clksel.c @@ -438,6 +438,14 @@ long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate, return omap2_clksel_round_rate_div(oclk, target_rate, &new_div); } +long omap2_passthrough_round_rate(struct clk *clk, unsigned long target_rate, + unsigned long *parent_rate) +{ + *parent_rate = target_rate; + + return clk->rate; +} + /** * omap2_clksel_set_rate() - program clock rate in hardware * @clk: struct clk * to program rate diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h index e03060e..05f8a00 100644 --- a/arch/arm/mach-omap2/clock.h +++ b/arch/arm/mach-omap2/clock.h @@ -86,6 +86,8 @@ struct clk *omap2_init_clksel_parent(struct clk *clk); unsigned long omap2_clksel_recalc(struct clk *clk); long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate, unsigned long *parent_rate); +long omap2_passthrough_round_rate(struct clk *clk, unsigned long target_rate, + unsigned long *parent_rate); int omap2_clksel_set_rate(struct clk *clk, unsigned long rate); int omap2_clksel_set_parent(struct clk *clk, struct clk *new_parent);