]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00210871-2 IPU: Remove clk_get_usecount and only use clk_enable/clk_disable
authorWayne Zou <b36644@freescale.com>
Fri, 25 May 2012 05:54:52 +0000 (13:54 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:34:44 +0000 (08:34 +0200)
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 <b36644@freescale.com>
drivers/mxc/ipu3/ipu_disp.c

index 4a774396ee992ce83f262a748f12f8f86f23645c..706dc2160f48bf2041e762d2320af9eb6e16e739 100644 (file)
@@ -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);