rk312x : cif : cif driver v0.0x1.4
[firefly-linux-kernel-4.4.55.git] / drivers / media / video / rk30_camera_oneframe.c
index e7b0f86e9f756d3a97f758480d95aef35bbb6c09..cead1f273367342f5386095b9ad39cd7464e667e 100755 (executable)
@@ -262,8 +262,10 @@ static u32 DISABLE_INVERT_PCLK_CIF1;
                 1. rk3126 and rk3128 use different dts file.            
 *v0.1.3:
                 1. i2c 1 and wifi use the common io in rk3128,so just enable i2c1 in rk3126 dts file
+*v0.1.4:
+                1. When cif was at work, the aclk is closed ,may cause bus abnormal ,so sleep 100ms before close aclk 
 */
-#define RK_CAM_VERSION_CODE KERNEL_VERSION(0, 1, 0x3)
+#define RK_CAM_VERSION_CODE KERNEL_VERSION(0, 1, 0x4)
 static int version = RK_CAM_VERSION_CODE;
 module_param(version, int, S_IRUGO);
 
@@ -1237,6 +1239,7 @@ static int rk_camera_mclk_ctrl(int cif_idx, int on, int clk_rate)
         clk_set_rate(clk->cif_clk_out,clk_rate);
         clk->on = true;
     } else if (!on && clk->on) {
+       msleep(100);
         clk_disable_unprepare(clk->aclk_cif);
        clk_disable_unprepare(clk->hclk_cif);
        clk_disable_unprepare(clk->cif_clk_in);
@@ -2656,6 +2659,7 @@ static int rk_camera_s_stream(struct soc_camera_device *icd, int enable)
                write_cif_reg(pcdev->base,CIF_CIF_INTEN, 0x0); 
        spin_unlock_irqrestore(&pcdev->lock, flags);
                flush_workqueue((pcdev->camera_wq));
+               msleep(100);
        }
     /*must be reinit,or will be somthing wrong in irq process.*/
     if(enable == false) {