aboutsummaryrefslogtreecommitdiff
path: root/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-20 08:52:53 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-20 08:52:53 -0700
commit5f7e08ca7b657f5678dd62a080f7f3a8f923ad02 (patch)
tree8ec61964df164dd9a2b6d5cbabd338a5728b7e3a /arch/sh/kernel/cpu/sh4a/clock-sh7722.c
parent7f46e6ca0183568a688e6bfe40e3ab9adb305d03 (diff)
parent56386f6424f242cff46e2cfd7be44624cd37dce1 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6: (26 commits) sh: intc - add support for SH7750 and its variants sh: Move entry point code to .text.head. sh: heartbeat: Shut up resource size warning. sh: update r2d defconfig and fix SH7751R pci compliation sh: Many symbol exports for nommu allmodconfig. sh: zero terminate 8250 platform data for r2d board sh: cpufreq: Fix up the build for SH-2. sh: Make on-chip DMA channel selection explicit. sh: Fix up CPU dependencies for on-chip DMAC. sh: cpufreq: clock framework support. sh: Support rate rounding for SH7722 FRQCR clocks. sh: Implement clk_round_rate() in the clock framework. sh: Fix up PCI section mismatch warnings. sh: Wire up fallocate() syscall. sh: intc - add support for 7780 sh: intc - improve group support sh: Fix up SH-3 and SH-4 driver dependencies. sh: push-switch: Correct license string. sh: cpufreq: Fix driver dependencies and flag as broken. sh: IPR/INTC2 IRQ setup consolidation. ...
Diffstat (limited to 'arch/sh/kernel/cpu/sh4a/clock-sh7722.c')
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7722.c15
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 51b386d454d..a0fd8bb21f7 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,
};
/*