mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
camsys_drv: v0.0x1e.0
This commit is contained in:
@@ -115,8 +115,11 @@
|
||||
1) support rk3368.
|
||||
*v0.0x1d.0:
|
||||
1) enable aclk_rga for rk3368, otherwise, isp reset will cause system halted.
|
||||
*v0.0x1e.0:
|
||||
1) dts remove aclk_rga, change aclk_isp from <clk_gates17 0> to <&clk_gates16 0>.
|
||||
2) add rl3369 pd_isp enable/disable.
|
||||
*/
|
||||
#define CAMSYS_DRIVER_VERSION KERNEL_VERSION(0,0x1d,0)
|
||||
#define CAMSYS_DRIVER_VERSION KERNEL_VERSION(0,0x1e,0)
|
||||
|
||||
|
||||
#define CAMSYS_PLATFORM_DRV_NAME "RockChip-CamSys"
|
||||
|
||||
@@ -331,17 +331,17 @@ static int camsys_mrv_clkin_cb(void *ptr, unsigned int on)
|
||||
clk_set_rate(clk->isp,isp_clk);
|
||||
clk_set_rate(clk->isp_jpe, isp_clk);
|
||||
|
||||
clk_prepare_enable(clk->pd_isp);
|
||||
clk_prepare_enable(clk->aclk_isp);
|
||||
clk_prepare_enable(clk->hclk_isp);
|
||||
clk_prepare_enable(clk->isp);
|
||||
clk_prepare_enable(clk->isp_jpe);
|
||||
clk_prepare_enable(clk->isp_jpe);
|
||||
clk_prepare_enable(clk->pclkin_isp);
|
||||
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);
|
||||
}
|
||||
clk->in_on = true;
|
||||
@@ -361,11 +361,12 @@ static int camsys_mrv_clkin_cb(void *ptr, unsigned int on)
|
||||
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);
|
||||
}
|
||||
clk_disable_unprepare(clk->pd_isp);
|
||||
|
||||
rockchip_clear_system_status(SYS_STATUS_ISP);
|
||||
clk->in_on = false;
|
||||
camsys_trace(1, "%s clock in turn off",dev_name(camsys_dev->miscdev.this_device));
|
||||
@@ -557,7 +558,7 @@ int camsys_mrv_probe_cb(struct platform_device *pdev, camsys_dev_t *camsys_dev)
|
||||
goto clk_failed;
|
||||
}
|
||||
if(CHIP_TYPE == 3368){
|
||||
mrv_clk->pd_isp = NULL;
|
||||
mrv_clk->pd_isp = devm_clk_get(&pdev->dev, "pd_isp");
|
||||
mrv_clk->aclk_isp = devm_clk_get(&pdev->dev, "aclk_isp");
|
||||
mrv_clk->hclk_isp = devm_clk_get(&pdev->dev, "hclk_isp");
|
||||
mrv_clk->isp = devm_clk_get(&pdev->dev, "clk_isp");
|
||||
@@ -566,11 +567,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->aclk_rga)) {
|
||||
IS_ERR_OR_NULL(mrv_clk->cif_clk_out) || IS_ERR_OR_NULL(mrv_clk->pclk_dphyrx)||
|
||||
IS_ERR_OR_NULL(mrv_clk->pd_isp)) {
|
||||
camsys_err("Get %s clock resouce failed!\n",miscdev_name);
|
||||
err = -EINVAL;
|
||||
goto clk_failed;
|
||||
@@ -659,9 +660,6 @@ 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);
|
||||
|
||||
@@ -56,7 +56,6 @@ 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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user