From: chenxing Date: Fri, 10 Aug 2012 03:11:02 +0000 (+0800) Subject: rk2928:sdk: add cif set rate interface X-Git-Tag: firefly_0821_release~8912^2~18 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b1be4be2e6a87feeb3ecce933df6fd8f06bb834d;p=firefly-linux-kernel-4.4.55.git rk2928:sdk: add cif set rate interface --- diff --git a/arch/arm/mach-rk2928/clock_data.c b/arch/arm/mach-rk2928/clock_data.c index 229272289feb..8584e6d4d955 100644 --- a/arch/arm/mach-rk2928/clock_data.c +++ b/arch/arm/mach-rk2928/clock_data.c @@ -1393,6 +1393,24 @@ static struct clk hclk_gps = { }; #endif /****************camera*******************/ +static int cif_out_set_rate(struct clk *clk, unsigned long rate) +{ + int ret = 0; + struct clk *parent; + + if (rate == 24 * MHZ) { + parent =clk->parents[1]; + } else { + parent=clk->parents[0]; + ret = clk_set_rate_nolock(parent, rate); + if (ret) + return ret; + } + if (clk->parent != parent) + ret = clk_set_parent_nolock(clk, parent); + + return ret; +} static struct clk *clk_cif_out_div_parents[] = SELECT_FROM_2PLLS_CG; static struct clk clk_cif_out_div = { .name = "cif_out_div", @@ -1410,6 +1428,7 @@ static struct clk *clk_cif_out_parents[] = {&clk_cif_out_div, &xin24m}; static struct clk clk_cif_out = { .name = "cif0_out", .parent = &clk_cif_out_div, + .set_rate = cif_out_set_rate, .clksel_con = CRU_CLKSELS_CON(29), CRU_SRC_SET(0x1, 7), CRU_PARENTS_SET(clk_cif_out_parents),