Merge "msm: camera: common: Fix enable/disable for dsp clock source" into camera-kernel.lnx.4.0
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
3f1cf31dee
@@ -298,11 +298,18 @@ int cam_vfe_soc_enable_clk(struct cam_hw_soc_info *soc_info,
|
|||||||
if (!soc_info) {
|
if (!soc_info) {
|
||||||
CAM_ERR(CAM_ISP, "Error Invalid params");
|
CAM_ERR(CAM_ISP, "Error Invalid params");
|
||||||
rc = -EINVAL;
|
rc = -EINVAL;
|
||||||
return rc;
|
goto end;
|
||||||
}
|
}
|
||||||
soc_private = soc_info->soc_private;
|
soc_private = soc_info->soc_private;
|
||||||
|
|
||||||
if (strcmp(clk_name, CAM_VFE_DSP_CLK_NAME) == 0) {
|
if (!strcmp(clk_name, CAM_VFE_DSP_CLK_NAME)) {
|
||||||
|
if (soc_private->dsp_clk_index == -1) {
|
||||||
|
CAM_ERR(CAM_ISP,
|
||||||
|
"DSP clock not supported for vfe: %d", soc_info->index);
|
||||||
|
rc = -EPERM;
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
rc = cam_soc_util_clk_enable(soc_private->dsp_clk,
|
rc = cam_soc_util_clk_enable(soc_private->dsp_clk,
|
||||||
CAM_VFE_DSP_CLK_NAME, soc_private->dsp_clk_rate);
|
CAM_VFE_DSP_CLK_NAME, soc_private->dsp_clk_rate);
|
||||||
if (rc)
|
if (rc)
|
||||||
@@ -310,6 +317,7 @@ int cam_vfe_soc_enable_clk(struct cam_hw_soc_info *soc_info,
|
|||||||
"Error enable dsp clk failed rc=%d", rc);
|
"Error enable dsp clk failed rc=%d", rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
end:
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -322,18 +330,26 @@ int cam_vfe_soc_disable_clk(struct cam_hw_soc_info *soc_info,
|
|||||||
if (!soc_info) {
|
if (!soc_info) {
|
||||||
CAM_ERR(CAM_ISP, "Error Invalid params");
|
CAM_ERR(CAM_ISP, "Error Invalid params");
|
||||||
rc = -EINVAL;
|
rc = -EINVAL;
|
||||||
return rc;
|
goto end;
|
||||||
}
|
}
|
||||||
soc_private = soc_info->soc_private;
|
soc_private = soc_info->soc_private;
|
||||||
|
|
||||||
if (strcmp(clk_name, CAM_VFE_DSP_CLK_NAME) == 0) {
|
if (!strcmp(clk_name, CAM_VFE_DSP_CLK_NAME)) {
|
||||||
|
if (soc_private->dsp_clk_index == -1) {
|
||||||
|
CAM_ERR(CAM_ISP,
|
||||||
|
"DSP clock not supported for vfe: %d", soc_info->index);
|
||||||
|
rc = -EPERM;
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
rc = cam_soc_util_clk_disable(soc_private->dsp_clk,
|
rc = cam_soc_util_clk_disable(soc_private->dsp_clk,
|
||||||
CAM_VFE_DSP_CLK_NAME);
|
CAM_VFE_DSP_CLK_NAME);
|
||||||
if (rc)
|
if (rc)
|
||||||
CAM_ERR(CAM_ISP,
|
CAM_ERR(CAM_ISP,
|
||||||
"Error enable dsp clk failed rc=%d", rc);
|
"Error disable dsp clk failed rc=%d", rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
end:
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -544,7 +544,6 @@ int cam_soc_util_get_option_clk_by_name(struct cam_hw_soc_info *soc_info,
|
|||||||
|
|
||||||
index = of_property_match_string(of_node, "clock-names-option",
|
index = of_property_match_string(of_node, "clock-names-option",
|
||||||
clk_name);
|
clk_name);
|
||||||
|
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
CAM_DBG(CAM_UTIL, "No clk data for %s", clk_name);
|
CAM_DBG(CAM_UTIL, "No clk data for %s", clk_name);
|
||||||
*clk_index = -1;
|
*clk_index = -1;
|
||||||
@@ -557,6 +556,7 @@ int cam_soc_util_get_option_clk_by_name(struct cam_hw_soc_info *soc_info,
|
|||||||
CAM_ERR(CAM_UTIL, "No clk named %s found. Dev %s", clk_name,
|
CAM_ERR(CAM_UTIL, "No clk named %s found. Dev %s", clk_name,
|
||||||
soc_info->dev_name);
|
soc_info->dev_name);
|
||||||
*clk_index = -1;
|
*clk_index = -1;
|
||||||
|
*clk = NULL;
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
*clk_index = index;
|
*clk_index = index;
|
||||||
|
Reference in New Issue
Block a user