Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70c48672 authored by Mukund Madhusudan Atre's avatar Mukund Madhusudan Atre Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarMukund Madhusudan Atre <matre@codeaurora.org>
parent 36765c90
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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);

+5 −2
Original line number Diff line number Diff line
@@ -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: