camsys_drv: v0.0x1d.0
authordalon.zhang <dalon.zhang@rock-chips.com>
Thu, 19 Mar 2015 08:17:47 +0000 (16:17 +0800)
committerdalon.zhang <dalon.zhang@rock-chips.com>
Thu, 19 Mar 2015 08:17:47 +0000 (16:17 +0800)
drivers/media/video/rk_camsys/camsys_internal.h
drivers/media/video/rk_camsys/camsys_marvin.c
drivers/media/video/rk_camsys/camsys_marvin.h

index c70464e45a721879ff110172157ebca02149d858..af8d3889c137586bf95e01702872c9aefe4dbfa8 100755 (executable)
                 1) use of_find_node_by_name to get vpu node instead of of_find_compatible_node
 *v0.0x1c.0:
          1) support rk3368. 
+*v0.0x1d.0:
+         1) enable aclk_rga for rk3368, otherwise, isp reset will cause system halted.
 */
-#define CAMSYS_DRIVER_VERSION                   KERNEL_VERSION(0,0x1c,0)
+#define CAMSYS_DRIVER_VERSION                   KERNEL_VERSION(0,0x1d,0)
 
 
 #define CAMSYS_PLATFORM_DRV_NAME                "RockChip-CamSys"
index 588cea3bc4afb09e3e07bd3c72ecfa32c60dbaf3..bd4ed67345f3113ce5a94eaf9f478d4469effe69 100755 (executable)
@@ -339,6 +339,7 @@ static int camsys_mrv_clkin_cb(void *ptr, unsigned int on)
                if(CHIP_TYPE == 3368){
                        clk_prepare_enable(clk->cif_clk_out);
                        clk_prepare_enable(clk->pclk_dphyrx);
+                       clk_prepare_enable(clk->aclk_rga);
                }else{
                        clk_prepare_enable(clk->pd_isp);
                        clk_prepare_enable(clk->clk_mipi_24m);          
@@ -356,10 +357,11 @@ static int camsys_mrv_clkin_cb(void *ptr, unsigned int on)
         clk_disable_unprepare(clk->hclk_isp);
         clk_disable_unprepare(clk->isp);
         clk_disable_unprepare(clk->isp_jpe);
-        clk_disable_unprepare(clk->pclkin_isp); 
+        clk_disable_unprepare(clk->pclkin_isp);
                if(CHIP_TYPE == 3368){
                clk_disable_unprepare(clk->cif_clk_out);
                        clk_disable_unprepare(clk->pclk_dphyrx);
+                       clk_disable_unprepare(clk->aclk_rga);
                }else{
                clk_disable_unprepare(clk->clk_mipi_24m); 
                        clk_disable_unprepare(clk->pd_isp);
@@ -564,11 +566,11 @@ int camsys_mrv_probe_cb(struct platform_device *pdev, camsys_dev_t *camsys_dev)
            mrv_clk->cif_clk_out = devm_clk_get(&pdev->dev, "clk_cif_out");
            mrv_clk->cif_clk_pll = devm_clk_get(&pdev->dev, "clk_cif_pll");
            mrv_clk->pclk_dphyrx = devm_clk_get(&pdev->dev, "pclk_dphyrx");    
-           
+           mrv_clk->aclk_rga = devm_clk_get(&pdev->dev, "aclk_rga");
            
                if (IS_ERR_OR_NULL(mrv_clk->aclk_isp) || IS_ERR_OR_NULL(mrv_clk->hclk_isp) ||
                IS_ERR_OR_NULL(mrv_clk->isp) || IS_ERR_OR_NULL(mrv_clk->isp_jpe) || IS_ERR_OR_NULL(mrv_clk->pclkin_isp) || 
-               IS_ERR_OR_NULL(mrv_clk->cif_clk_out) || IS_ERR_OR_NULL(mrv_clk->pclk_dphyrx)) {
+               IS_ERR_OR_NULL(mrv_clk->cif_clk_out) || IS_ERR_OR_NULL(mrv_clk->pclk_dphyrx)||IS_ERR_OR_NULL(mrv_clk->aclk_rga)) {
                camsys_err("Get %s clock resouce failed!\n",miscdev_name);
                err = -EINVAL;
                goto clk_failed;
@@ -657,6 +659,9 @@ clk_failed:
                if (!IS_ERR_OR_NULL(mrv_clk->pclk_dphyrx)) {
                    clk_put(mrv_clk->pclk_dphyrx);
                }
+               if (!IS_ERR_OR_NULL(mrv_clk->aclk_rga)) {
+                   clk_put(mrv_clk->aclk_rga);
+               }
                }
 
         kfree(mrv_clk);
index 1c70febf8666e779345cbe53dd3d33a1df139b33..2b4db933bc64e0f20babb9326c57dc29f3addb5f 100755 (executable)
@@ -56,6 +56,7 @@ typedef struct camsys_mrv_clk_s {
     struct clk      *cif_clk_out;
     struct clk      *cif_clk_pll;
        struct clk              *pclk_dphyrx;
+       struct clk              *aclk_rga;
        
     unsigned int     out_on;