msm: camera: common: Fix cpas register for custom hw

The client handle is obtained by providing client identifier
to cpas. Add identifier in custom hw registration for cpas
to recognize client. Also, improve identifier string
validation in cpas register client.

CRs-Fixed: 2528679
Change-Id: I924f5c98a8affa26753710fa542c1bb651d0af13
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
Bu işleme şunda yer alıyor:
Mukund Madhusudan Atre
2019-09-13 15:52:38 -07:00
işlemeyi yapan: Gerrit - the friendly Code Review server
ebeveyn 36765c90e8
işleme 70c486722f
2 değiştirilmiş dosya ile 11 ekleme ve 2 silme

Dosyayı Görüntüle

@@ -1369,6 +1369,12 @@ static int cam_cpas_hw_register_client(struct cam_hw_info *cpas_hw,
struct cam_cpas_private_soc *soc_private =
(struct cam_cpas_private_soc *) cpas_hw->soc_info.soc_private;
if ((!register_params) ||
(strlen(register_params->identifier) < 1)) {
CAM_ERR(CAM_CPAS, "Invalid cpas client identifier");
return -EINVAL;
}
CAM_DBG(CAM_CPAS, "Register params : identifier=%s, cell_index=%d",
register_params->identifier, register_params->cell_index);

Dosyayı Görüntüle

@@ -41,17 +41,20 @@ int cam_custom_hw_sub_mod_init_soc_resources(struct cam_hw_soc_info *soc_info,
memset(&cpas_register_param, 0, sizeof(cpas_register_param));
strlcpy(cpas_register_param.identifier, "custom",
CAM_HW_IDENTIFIER_LENGTH);
cpas_register_param.cell_index = soc_info->index;
cpas_register_param.dev = soc_info->dev;
cpas_register_param.cam_cpas_client_cb = NULL;
cpas_register_param.userdata = soc_info;
soc_private->cpas_handle =
cpas_register_param.client_handle;
rc = cam_cpas_register_client(&cpas_register_param);
if (rc < 0)
goto release_soc;
soc_private->cpas_handle =
cpas_register_param.client_handle;
return rc;
release_soc: