msm: camera: csiphy: Guarding the cpas start and cpas stop sequence
We are seeing cam warning "cpas gdsc clk is on" and qchannel handshake is failing on next power on. This will happen if some client want to tunr on camnoc axi clk before turning off the gdsc clk in previous run. CRs-Fixed: 3417264 Change-Id: I6927998cb47b7555e22c3d57b4c2f526adf62f34 Signed-off-by: Soumen Ghosh <quic_soumeng@quicinc.com>
This commit is contained in:

committed by
Camera Software Integration

parent
fbdce3ef38
commit
f52a91ab7e
@@ -1473,8 +1473,9 @@ void cam_csiphy_shutdown(struct csiphy_device *csiphy_dev)
|
||||
|
||||
cam_csiphy_reset(csiphy_dev);
|
||||
cam_soc_util_disable_platform_resource(soc_info, CAM_CLK_SW_CLIENT_IDX, true, true);
|
||||
|
||||
if (g_phy_data[soc_info->index].aon_cam_id == NOT_AON_CAM)
|
||||
cam_cpas_stop(csiphy_dev->cpas_handle);
|
||||
|
||||
csiphy_dev->csiphy_state = CAM_CSIPHY_ACQUIRE;
|
||||
}
|
||||
|
||||
@@ -1589,11 +1590,13 @@ static int __csiphy_cpas_configure_for_main_or_aon(
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (get_access) {
|
||||
rc = cam_csiphy_cpas_ops(cpas_handle, true);
|
||||
if (rc) {
|
||||
CAM_ERR(CAM_CSIPHY, "voting CPAS: %d failed", rc);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
cam_cpas_reg_read(cpas_handle, CAM_CPAS_REGBASE_CPASTOP,
|
||||
aon_sel_params->aon_cam_sel_offset[g_phy_data[phy_idx].aon_cam_id],
|
||||
@@ -1620,7 +1623,13 @@ static int __csiphy_cpas_configure_for_main_or_aon(
|
||||
if (rc)
|
||||
CAM_ERR(CAM_CSIPHY, "CPAS AON sel register write failed");
|
||||
|
||||
cam_csiphy_cpas_ops(cpas_handle, false);
|
||||
if (!get_access) {
|
||||
rc = cam_csiphy_cpas_ops(cpas_handle, false);
|
||||
if (rc) {
|
||||
CAM_ERR(CAM_CSIPHY, "voting CPAS: %d failed", rc);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -2270,10 +2279,12 @@ int32_t cam_csiphy_core_cfg(void *phy_dev,
|
||||
if (rc < 0)
|
||||
CAM_ERR(CAM_CSIPHY, "Failed in csiphy release");
|
||||
|
||||
if (!g_phy_data[soc_info->index].is_configured_for_main) {
|
||||
if (cam_csiphy_cpas_ops(csiphy_dev->cpas_handle, false)) {
|
||||
CAM_ERR(CAM_CSIPHY, "Failed in de-voting CPAS");
|
||||
rc = -EFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
csiphy_dev->csiphy_state = CAM_CSIPHY_ACQUIRE;
|
||||
|
||||
@@ -2542,11 +2553,13 @@ int32_t cam_csiphy_core_cfg(void *phy_dev,
|
||||
goto release_mutex;
|
||||
}
|
||||
|
||||
rc = cam_csiphy_cpas_ops(csiphy_dev->cpas_handle, true);
|
||||
if (rc) {
|
||||
if (!g_phy_data[soc_info->index].is_configured_for_main) {
|
||||
if (cam_csiphy_cpas_ops(csiphy_dev->cpas_handle, true)) {
|
||||
rc = -EFAULT;
|
||||
CAM_ERR(CAM_CSIPHY, "voting CPAS: %d", rc);
|
||||
goto release_mutex;
|
||||
}
|
||||
}
|
||||
|
||||
if (csiphy_dev->csiphy_info[offset].secure_mode == 1) {
|
||||
if (!cam_cpas_is_feature_supported(
|
||||
|
Reference in New Issue
Block a user