[PATCH 12/28] omap2 clock: stop using clk->src_offset in omap2_clk_set_rate()

Paul Walmsley
2007-08-20T09:53:59Z

[-- Attachment #1: convert_set_rate.patch --]
[-- Type: text/plain, Size: 1472 bytes --]

Stop using clk->rate_offset in omap2_clk_set_rate(); use what we get
from the clksel code instead.

Signed-off-by: Paul Walmsley <paul@pwsan.com>

---
arch/arm/mach-omap2/clock.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)

Index: linux-omap/arch/arm/mach-omap2/clock.c
Index: linux-omap/arch/arm/mach-omap2/clock.c
===================================================================
--- linux-omap.orig/arch/arm/mach-omap2/clock.c
+++ linux-omap/arch/arm/mach-omap2/clock.c
@@ -780,17 +780,14 @@ static u32 omap2_clksel_get_divisor(stru
static int omap2_clk_set_rate(struct clk *clk, unsigned long rate)
{
int ret = -EINVAL;
- u32 div_off, field_mask, field_val, reg_val, validrate;
- u32 new_div = 0;
+ u32 field_mask, field_val, reg_val, new_div = 0;
+ unsigned long validrate;
void __iomem *div_addr;

if (!(clk->flags & CONFIG_PARTICIPANT) && (clk->flags & RATE_CKCTL)) {
if (clk == &dpll_ck)
return omap2_reprogram_dpll(clk, rate);

- /* Isolate control register */
- div_off = clk->rate_offset;
-
validrate = omap2_clksel_round_rate(clk, rate, &new_div);
if (validrate != rate)
return ret;
@@ -805,7 +802,7 @@ static int omap2_clk_set_rate(struct clk

reg_val = cm_read_reg(div_addr);
reg_val &= ~field_mask;
- reg_val |= (field_val << div_off);
+ reg_val |= (field_val << convert_mask_to_shift(field_mask));
cm_write_reg(reg_val, div_addr);
wmb();
clk->rate = clk->parent->rate / new_div;

--