linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: Update comment for clk_round_rate()
@ 2012-04-04 17:27 viresh kumar
  2012-04-04 18:07 ` Turquette, Mike
  0 siblings, 1 reply; 6+ messages in thread
From: viresh kumar @ 2012-04-04 17:27 UTC (permalink / raw)
  To: linux-arm-kernel

From: Viresh Kumar <viresh.kumar@st.com>

clk_round_rate() must not provide rate greater than requested rate, as hardware
may not work at it. This wasn't clear from documentation of clk_round_rate().

This patch updates documentation for this.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
---

Mike,

I don't know if this holds true for common clock framework or not?
But it looks more logical to me and this is how it was implemented for SPEAr.

 drivers/clk/clk.c   |    6 +++---
 include/linux/clk.h |    3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 9cf6f59..2f58455 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -603,9 +603,9 @@ unsigned long __clk_round_rate(struct clk *clk,
unsigned long rate)
  * @clk: the clk for which we are rounding a rate
  * @rate: the rate which is to be rounded
  *
- * Takes in a rate as input and rounds it to a rate that the clk can actually
- * use which is then returned.  If clk doesn't support round_rate operation
- * then the parent rate is returned.
+ * Takes in a rate as input and rounds it to a rate <= input rate that the clk
+ * can actually use which is then returned.  If clk doesn't support round_rate
+ * operation then the parent rate is returned.
  */
 long clk_round_rate(struct clk *clk, unsigned long rate)
 {
diff --git a/include/linux/clk.h b/include/linux/clk.h
index b025272..19d31ef 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -213,7 +213,8 @@ void clk_put(struct clk *clk);


 /**
- * clk_round_rate - adjust a rate to the exact rate a clock can provide
+ * clk_round_rate - adjust a rate to the exact rate a clock can provide. Output
+ *		    clock rate should be <= requested rate
  * @clk: clock source
  * @rate: desired clock rate in Hz
  *
-- 
1.7.9

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-04-05  7:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-04 17:27 [PATCH] clk: Update comment for clk_round_rate() viresh kumar
2012-04-04 18:07 ` Turquette, Mike
2012-04-05  5:11   ` Viresh Kumar
2012-04-05  7:03     ` Uwe Kleine-König
2012-04-05  7:07       ` Viresh Kumar
2012-04-05  7:26         ` Uwe Kleine-König

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).