From: dwalker@codeaurora.org (Daniel Walker)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 4/5] msm: add handling for clocks tagged as CLK_MINMAX
Date: Mon, 13 Dec 2010 14:35:10 -0800 [thread overview]
Message-ID: <1292279711-4460-4-git-send-email-dwalker@codeaurora.org> (raw)
In-Reply-To: <1292279711-4460-1-git-send-email-dwalker@codeaurora.org>
CLK_MINMAX is used to denote clocks that have a wide variation
in possible frequencies. This handling just sets the min and
max values to the same value.
This code was original created by Saravana Kannan.
Cc: Saravana Kannan <skannan@codeaurora.org>
Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
---
arch/arm/mach-msm/clock.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-msm/clock.c b/arch/arm/mach-msm/clock.c
index c57210f..2069bfa 100644
--- a/arch/arm/mach-msm/clock.c
+++ b/arch/arm/mach-msm/clock.c
@@ -120,6 +120,21 @@ EXPORT_SYMBOL(clk_get_rate);
int clk_set_rate(struct clk *clk, unsigned long rate)
{
+ int ret;
+ if (clk->flags & CLKFLAG_MAX) {
+ ret = clk->ops->set_max_rate(clk->id, rate);
+ if (ret)
+ return ret;
+ }
+ if (clk->flags & CLKFLAG_MIN) {
+ ret = clk->ops->set_min_rate(clk->id, rate);
+ if (ret)
+ return ret;
+ }
+
+ if (clk->flags & CLKFLAG_MAX || clk->flags & CLKFLAG_MIN)
+ return ret;
+
return clk->ops->set_rate(clk->id, rate);
}
EXPORT_SYMBOL(clk_set_rate);
--
1.7.1
next prev parent reply other threads:[~2010-12-13 22:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-13 22:35 [PATCH v2 1/5] msm: trout: add gpio_to_irq Daniel Walker
2010-12-13 22:35 ` [PATCH v2 2/5] msm: add CLK_MINMAX to pmdh_clk Daniel Walker
2010-12-13 22:35 ` [PATCH v2 3/5] msm: trout: change name of pmdh_clk to mddi_clk Daniel Walker
2010-12-13 22:35 ` Daniel Walker [this message]
2010-12-13 22:35 ` [PATCH v2 5/5] msm: initial framebuffer support Daniel Walker
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=1292279711-4460-4-git-send-email-dwalker@codeaurora.org \
--to=dwalker@codeaurora.org \
--cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).