From: Wayne Zou Date: Fri, 25 May 2012 05:54:52 +0000 (+0800) Subject: ENGR00210871-2 IPU: Remove clk_get_usecount and only use clk_enable/clk_disable X-Git-Tag: v3.0.35-fsl~961 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8550294d1e47b1e6ae430d80e17cde0c4d120e33;p=karo-tx-linux.git ENGR00210871-2 IPU: Remove clk_get_usecount and only use clk_enable/clk_disable Remove clk_get_usecount API and only use clk_enable/clk_disable APIs for IPU driver. If ipu internal clock is not accurate, use external DI clock. Signed-off-by: Wayne Zou --- diff --git a/drivers/mxc/ipu3/ipu_disp.c b/drivers/mxc/ipu3/ipu_disp.c index 4a774396ee99..706dc2160f48 100644 --- a/drivers/mxc/ipu3/ipu_disp.c +++ b/drivers/mxc/ipu3/ipu_disp.c @@ -1271,26 +1271,21 @@ int32_t ipu_init_sync_panel(struct ipu_soc *ipu, int disp, uint32_t pixel_clk, ((rounded_pixel_clk >= pixel_clk + pixel_clk/200) || (rounded_pixel_clk <= pixel_clk - pixel_clk/200))) { dev_dbg(ipu->dev, "try ipu ext di clk\n"); - if (clk_get_usecount(di_parent)) - dev_warn(ipu->dev, - "ext di clk already in use, go back to internal clk\n"); - else { - rounded_pixel_clk = pixel_clk * 2; - rounded_parent_clk = clk_round_rate(di_parent, - rounded_pixel_clk); - while (rounded_pixel_clk < rounded_parent_clk) { - /* the max divider from parent to di is 8 */ - if (rounded_parent_clk / pixel_clk < 8) - rounded_pixel_clk += pixel_clk * 2; - else - rounded_pixel_clk *= 2; - } - clk_set_rate(di_parent, rounded_pixel_clk); - rounded_pixel_clk = - clk_round_rate(ipu->di_clk[disp], pixel_clk); - clk_set_rate(ipu->di_clk[disp], rounded_pixel_clk); - clk_set_parent(&ipu->pixel_clk[disp], ipu->di_clk[disp]); + rounded_pixel_clk = pixel_clk * 2; + rounded_parent_clk = clk_round_rate(di_parent, + rounded_pixel_clk); + while (rounded_pixel_clk < rounded_parent_clk) { + /* the max divider from parent to di is 8 */ + if (rounded_parent_clk / pixel_clk < 8) + rounded_pixel_clk += pixel_clk * 2; + else + rounded_pixel_clk *= 2; } + clk_set_rate(di_parent, rounded_pixel_clk); + rounded_pixel_clk = + clk_round_rate(ipu->di_clk[disp], pixel_clk); + clk_set_rate(ipu->di_clk[disp], rounded_pixel_clk); + clk_set_parent(&ipu->pixel_clk[disp], ipu->di_clk[disp]); } } rounded_pixel_clk = clk_round_rate(&ipu->pixel_clk[disp], pixel_clk);