rk3066: support set_rate_even div = 1
authorchenxing <chenxing@rock-chips.com>
Fri, 21 Jun 2013 09:14:21 +0000 (17:14 +0800)
committerchenxing <chenxing@rock-chips.com>
Fri, 21 Jun 2013 09:14:52 +0000 (17:14 +0800)
arch/arm/mach-rk30/clock_data.c

index 927d271d15b4dcb7b35611afadc63391dfc5ccbe..1394e1ddbe78cebbe1b88a91229b190352531b11 100644 (file)
@@ -298,9 +298,11 @@ static int clksel_set_rate_shift_2(struct clk *clk, unsigned long rate)
 //for div 1 2 4 2*n
 static int clksel_set_rate_even(struct clk *clk, unsigned long rate)
 {
-       u32 div;
-       for (div = 2; div < clk->div_max; div += 2) {
-               u32 new_rate = clk->parent->rate / div;
+       u32 div = 0, new_rate = 0;
+       for (div = 1; div < clk->div_max; div++) {
+               if (div >= 3 && div % 2 != 0)
+                       continue;
+               new_rate = clk->parent->rate / div;
                if (new_rate <= rate) {
                        set_cru_bits_w_msk(div - 1, clk->div_mask, clk->div_shift, clk->clksel_con);
                        clk->rate = new_rate;