Skip to content

Commit

Permalink
sh: clock-cpg div4 set_rate() shift fix
Browse files Browse the repository at this point in the history
Make sure the div4 bitfield is shifted according
to the enable_bit value in sh_clk_div4_set_rate().

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Magnus Damm authored and Paul Mundt committed Feb 22, 2010
1 parent 8c563a3 commit de7ca21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/sh/kernel/cpu/clock-cpg.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ static int sh_clk_div4_set_rate(struct clk *clk, unsigned long rate, int algo_id
return idx;

value = __raw_readl(clk->enable_reg);
value &= ~0xf;
value |= idx;
value &= ~(0xf << clk->enable_bit);
value |= (idx << clk->enable_bit);
__raw_writel(value, clk->enable_reg);

return 0;
Expand Down

0 comments on commit de7ca21

Please sign in to comment.