msm: camera: csiphy: Refine MINK API usage for secure camera

Use MINK API for all the targets that support domain ID and
use legacy API for all other targets. In addition, use a
target based macro to not compile the MINK API for the
older targets where those APIs are not defined.

Change-Id: I0d8f05df6ca8126db1e3ad8456fe78aa77a33ebf
CRs-Fixed: 3529425
Signed-off-by: Vijay Kumar Tumati <quic_vtumati@quicinc.com>
This commit is contained in:
Vijay Kumar Tumati
2023-06-13 11:45:12 -07:00
committed by Camera Software Integration
parent a795d64c87
commit db988fcff4
6 changed files with 21 additions and 17 deletions

View File

@@ -487,10 +487,8 @@ static int cam_csiphy_update_secure_info(struct csiphy_device *csiphy_dev, int32
uint32_t cpas_version;
int rc;
if (cam_is_mink_api_available()) {
CAM_DBG(CAM_CSIPHY, "Using MINK API for CSIPHY [%u], skipping legacy update",
csiphy_dev->soc_info.index);
if (csiphy_dev->domain_id_security) {
CAM_DBG(CAM_CSIPHY, "Target supports domain ID security, skipping legacy update");
return 0;
}
@@ -1314,14 +1312,18 @@ static int cam_csiphy_program_secure_mode(struct csiphy_device *csiphy_dev,
}
rc = cam_cpas_enable_clks_for_domain_id(true);
if (rc)
if (rc) {
CAM_ERR(CAM_CSIPHY, "Failed to enable the Domain ID clocks");
return rc;
}
}
rc = cam_csiphy_notify_secure_mode(csiphy_dev, protect, offset, is_shutdown);
if (csiphy_dev->domain_id_security) {
cam_cpas_enable_clks_for_domain_id(false);
if (cam_cpas_enable_clks_for_domain_id(false))
CAM_ERR(CAM_CSIPHY, "Failed to disable the Domain ID clocks");
if (!protect)
csiphy_dev->csiphy_info[offset].secure_info_updated = false;
}