diff options
author | Paul Mundt <lethal@linux-sh.org> | 2007-07-20 13:29:09 +0900 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2007-07-20 13:29:09 +0900 |
commit | f6991b0456416186b578d38717efcda2b012b79c (patch) | |
tree | 6adebd4c26abed39fe5b4db65dc3398cd09b9236 /arch/sh | |
parent | 39c7aa9ea9b6175f4313f69ef9f8e0a3a9bba5bb (diff) | |
download | op-kernel-dev-f6991b0456416186b578d38717efcda2b012b79c.zip op-kernel-dev-f6991b0456416186b578d38717efcda2b012b79c.tar.gz |
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 <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/kernel/cpu/clock.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/sh/kernel/cpu/clock.c b/arch/sh/kernel/cpu/clock.c index 6325154..92807ffa 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. |