Commit 5d718e5a authored by Tony Lindgren's avatar Tony Lindgren

Merge with /home/tmlind/src/kernel/linux-omap-2.6

parents 1d045369 254da35d
...@@ -552,25 +552,21 @@ static int omap1_clk_set_rate(struct clk *clk, unsigned long rate) ...@@ -552,25 +552,21 @@ static int omap1_clk_set_rate(struct clk *clk, unsigned long rate)
__u16 regval; __u16 regval;
unsigned long flags; unsigned long flags;
if(clk->set_rate != 0) { if (clk->set_rate)
spin_lock_irqsave(&clockfw_lock, flags);
ret = clk->set_rate(clk, rate); ret = clk->set_rate(clk, rate);
spin_unlock_irqrestore(&clockfw_lock, flags); else if (clk->flags & RATE_CKCTL) {
} else if (clk->flags & RATE_CKCTL) {
dsor_exp = calc_dsor_exp(clk, rate); dsor_exp = calc_dsor_exp(clk, rate);
if (dsor_exp > 3) if (dsor_exp > 3)
dsor_exp = -EINVAL; dsor_exp = -EINVAL;
if (dsor_exp < 0) if (dsor_exp < 0)
return dsor_exp; return dsor_exp;
spin_lock_irqsave(&clockfw_lock, flags);
regval = omap_readw(ARM_CKCTL); regval = omap_readw(ARM_CKCTL);
regval &= ~(3 << clk->rate_offset); regval &= ~(3 << clk->rate_offset);
regval |= dsor_exp << clk->rate_offset; regval |= dsor_exp << clk->rate_offset;
regval = verify_ckctl_value(regval); regval = verify_ckctl_value(regval);
omap_writew(regval, ARM_CKCTL); omap_writew(regval, ARM_CKCTL);
clk->rate = clk->parent->rate / (1 << dsor_exp); clk->rate = clk->parent->rate / (1 << dsor_exp);
spin_unlock_irqrestore(&clockfw_lock, flags);
ret = 0; ret = 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment