|
@@ -229,9 +229,14 @@ int cam_csiphy_dump_status_reg(struct csiphy_device *csiphy_dev)
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
+ if (!g_phy_data[soc_info->index].base_address) {
|
|
|
+ CAM_ERR(CAM_CSIPHY, "Invalid cphy_idx: %d", soc_info->index);
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
csiphy_reg = &csiphy_dev->ctrl_reg->csiphy_reg;
|
|
|
status_regs = csiphy_reg->status_reg_params;
|
|
|
- phybase = soc_info->reg_map[0].mem_base;
|
|
|
+ phybase = g_phy_data[soc_info->index].base_address;
|
|
|
|
|
|
if (!status_regs) {
|
|
|
CAM_ERR(CAM_CSIPHY, "2ph/3ph status offset not set");
|
|
@@ -1416,6 +1421,11 @@ int cam_csiphy_util_update_aon_registration
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
+ if (!g_phy_data[phy_idx].base_address) {
|
|
|
+ CAM_ERR(CAM_CSIPHY, "Invalid PHY idx: %d from Sensor user", phy_idx);
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
g_phy_data[phy_idx].enable_aon_support = is_aon_user;
|
|
|
|
|
|
return 0;
|
|
@@ -1433,6 +1443,11 @@ int cam_csiphy_util_update_aon_ops(
|
|
|
return -ENODEV;
|
|
|
}
|
|
|
|
|
|
+ if (!g_phy_data[phy_idx].base_address) {
|
|
|
+ CAM_ERR(CAM_CSIPHY, "phy_idx: %d is not supported", phy_idx);
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
if (!g_phy_data[phy_idx].aon_sel_param) {
|
|
|
CAM_ERR(CAM_CSIPHY, "AON select parameters are null");
|
|
|
return -EINVAL;
|
|
@@ -1680,6 +1695,12 @@ int32_t cam_csiphy_core_cfg(void *phy_dev,
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
+ if (!g_phy_data[soc_info->index].base_address) {
|
|
|
+ CAM_ERR(CAM_CSIPHY, "CSIPHY hw is not avaialble at index: %d",
|
|
|
+ soc_info->index);
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
csiphybase = soc_info->reg_map[0].mem_base;
|
|
|
csiphy_reg = &csiphy_dev->ctrl_reg->csiphy_reg;
|
|
|
status_reg_ptr = csiphy_reg->status_reg_params;
|
|
@@ -2250,19 +2271,19 @@ release_mutex:
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
-void cam_csiphy_register_baseaddress(struct csiphy_device *csiphy_dev)
|
|
|
+int cam_csiphy_register_baseaddress(struct csiphy_device *csiphy_dev)
|
|
|
{
|
|
|
int phy_idx;
|
|
|
|
|
|
if (!csiphy_dev) {
|
|
|
- CAM_WARN(CAM_CSIPHY, "Data is NULL");
|
|
|
- return;
|
|
|
+ CAM_ERR(CAM_CSIPHY, "Data is NULL");
|
|
|
+ return -EINVAL;
|
|
|
}
|
|
|
|
|
|
if (csiphy_dev->soc_info.index >= MAX_CSIPHY) {
|
|
|
CAM_ERR(CAM_CSIPHY, "Invalid soc index: %u Max soc index: %u",
|
|
|
csiphy_dev->soc_info.index, MAX_CSIPHY);
|
|
|
- return;
|
|
|
+ return -EINVAL;
|
|
|
}
|
|
|
|
|
|
phy_idx = csiphy_dev->soc_info.index;
|
|
@@ -2273,4 +2294,6 @@ void cam_csiphy_register_baseaddress(struct csiphy_device *csiphy_dev)
|
|
|
g_phy_data[phy_idx].aon_sel_param =
|
|
|
csiphy_dev->ctrl_reg->csiphy_reg.aon_sel_params;
|
|
|
g_phy_data[phy_idx].enable_aon_support = false;
|
|
|
+
|
|
|
+ return 0;
|
|
|
}
|