From 784a31ab465f00cc039447ea2dc4b5c94e6db533 Mon Sep 17 00:00:00 2001 From: chenxing Date: Fri, 21 Jun 2013 17:14:33 +0800 Subject: [PATCH] rk292x: support set_rate_even div = 1 --- arch/arm/mach-rk2928/clock_data.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-rk2928/clock_data.c b/arch/arm/mach-rk2928/clock_data.c index d2f2d76d87b8..ee828cf28f30 100755 --- a/arch/arm/mach-rk2928/clock_data.c +++ b/arch/arm/mach-rk2928/clock_data.c @@ -378,9 +378,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; -- 2.34.1