Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f6991b0456416186b578d38717efcda2b012b79c
Commit:     f6991b0456416186b578d38717efcda2b012b79c
Parent:     39c7aa9ea9b6175f4313f69ef9f8e0a3a9bba5bb
Author:     Paul Mundt <[EMAIL PROTECTED]>
AuthorDate: Fri Jul 20 13:29:09 2007 +0900
Committer:  Paul Mundt <[EMAIL PROTECTED]>
CommitDate: Fri Jul 20 13:29:09 2007 +0900

    sh: Implement clk_round_rate() in the clock framework.
    
    This is an optional component of the clock framework. However,
    as we're going to be using this in the cpufreq drivers, add
    support for it to the framework.
    
    Signed-off-by: Paul Mundt <[EMAIL PROTECTED]>
---
 arch/sh/kernel/cpu/clock.c |   16 ++++++++++++++++
 include/asm-sh/clock.h     |    1 +
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/arch/sh/kernel/cpu/clock.c b/arch/sh/kernel/cpu/clock.c
index 6325154..92807ff 100644
--- a/arch/sh/kernel/cpu/clock.c
+++ b/arch/sh/kernel/cpu/clock.c
@@ -229,6 +229,22 @@ void clk_recalc_rate(struct clk *clk)
 }
 EXPORT_SYMBOL_GPL(clk_recalc_rate);
 
+long clk_round_rate(struct clk *clk, unsigned long rate)
+{
+       if (likely(clk->ops && clk->ops->round_rate)) {
+               unsigned long flags, rounded;
+
+               spin_lock_irqsave(&clock_lock, flags);
+               rounded = clk->ops->round_rate(clk, rate);
+               spin_unlock_irqrestore(&clock_lock, flags);
+
+               return rounded;
+       }
+
+       return clk_get_rate(clk);
+}
+EXPORT_SYMBOL_GPL(clk_round_rate);
+
 /*
  * Returns a clock. Note that we first try to use device id on the bus
  * and clock name. If this fails, we try to use clock name only.
diff --git a/include/asm-sh/clock.h b/include/asm-sh/clock.h
index 386d797..b550a27 100644
--- a/include/asm-sh/clock.h
+++ b/include/asm-sh/clock.h
@@ -14,6 +14,7 @@ struct clk_ops {
        void (*disable)(struct clk *clk);
        void (*recalc)(struct clk *clk);
        int (*set_rate)(struct clk *clk, unsigned long rate, int algo_id);
+       long (*round_rate)(struct clk *clk, unsigned long rate);
 };
 
 struct clk {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to