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>
Dieser Commit ist enthalten in:

committet von
Gerrit - the friendly Code Review server

Ursprung
36765c90e8
Commit
70c486722f
@@ -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);
|
||||
|
||||
|
@@ -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:
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren