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

    sh: Support rate rounding for SH7722 FRQCR clocks.
    
    Now that the round_rate() op is supported, hook it up on SH7722
    for the FRQCR (CPU, PCLK, etc.) clocks.
    
    Signed-off-by: Paul Mundt <[EMAIL PROTECTED]>
---
 arch/sh/kernel/cpu/sh4a/clock-sh7722.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c 
b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
index 51b386d..a0fd8bb 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
@@ -387,9 +387,24 @@ out_err:
        return err;
 }
 
+static long sh7722_frqcr_round_rate(struct clk *clk, unsigned long rate)
+{
+       unsigned long parent_rate = clk->parent->rate;
+       int div;
+
+       /* look for multiplier/divisor pair */
+       div = sh7722_find_divisors(parent_rate, rate);
+       if (div < 0)
+               return clk->rate;
+
+       /* calculate new value of clock rate */
+       return parent_rate * 2 / div;
+}
+
 static struct clk_ops sh7722_frqcr_clk_ops = {
        .recalc = sh7722_frqcr_recalc,
        .set_rate = sh7722_frqcr_set_rate,
+       .round_rate = sh7722_frqcr_round_rate,
 };
 
 /*
-
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