Browse Source

msm: camera: icp: Handle OFE config IO separately

Since OFE config IO opcode has the same value as BPS config IO opcode,
generic handling function for config io ack msg cannot distinguish
BPS or OFE based on the opcode. So, instead, this change handles
the OFE IO config ack msg with the help of command type in the packet.

CRs-Fixed: 3406414
Change-Id: I847bf82cec8cdd86b387c75805060d6a7e44fcb6
Signed-off-by: Sokchetra Eung <[email protected]>
Sokchetra Eung 2 years ago
parent
commit
8c3228ced8
1 changed files with 23 additions and 22 deletions
  1. 23 22
      drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c

+ 23 - 22
drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c

@@ -2659,23 +2659,6 @@ static int cam_icp_mgr_process_msg_config_io(uint32_t *msg_ptr)
 		}
 		}
 		CAM_DBG(CAM_ICP, "%s: received BPS config io response",
 		CAM_DBG(CAM_ICP, "%s: received BPS config io response",
 			ctx_data->ctx_id_string);
 			ctx_data->ctx_id_string);
-	} else if (ioconfig_ack->opcode == HFI_OFE_CMD_OPCODE_CONFIG_IO) {
-		struct hfi_msg_ofe_config *ofe_config_ack = NULL;
-		ofe_config_ack =
-			(struct hfi_msg_ofe_config *)(ioconfig_ack->msg_data);
-		if (ofe_config_ack->rc) {
-			CAM_ERR(CAM_ICP, "rc : %u, opcode :%u",
-				ofe_config_ack->rc, ioconfig_ack->opcode);
-			return -EIO;
-		}
-		ctx_data = (struct cam_icp_hw_ctx_data *)
-			U64_TO_PTR(ioconfig_ack->user_data1);
-		if (!ctx_data) {
-			CAM_ERR(CAM_ICP, "wrong ctx data from OFE config io response");
-			return -EINVAL;
-		}
-		CAM_DBG(CAM_ICP, "%s: received OFE config io response",
-			ctx_data->ctx_id_string);
 	} else {
 	} else {
 		CAM_ERR(CAM_ICP, "Invalid OPCODE: %u", ioconfig_ack->opcode);
 		CAM_ERR(CAM_ICP, "Invalid OPCODE: %u", ioconfig_ack->opcode);
 		return -EINVAL;
 		return -EINVAL;
@@ -2778,12 +2761,30 @@ static int cam_icp_mgr_process_ofe_indirect_ack_msg(uint32_t *msg_ptr)
 	int rc = 0;
 	int rc = 0;
 
 
 	switch (msg_ptr[ICP_PACKET_OPCODE]) {
 	switch (msg_ptr[ICP_PACKET_OPCODE]) {
-	case HFI_OFE_CMD_OPCODE_CONFIG_IO:
-		CAM_DBG(CAM_ICP, "received OFE_CONFIG_IO:");
-		rc = cam_icp_mgr_process_msg_config_io(msg_ptr);
-		if (rc)
-			return rc;
+	case HFI_OFE_CMD_OPCODE_CONFIG_IO: {
+		struct hfi_msg_dev_async_ack *ioconfig_ack =
+			(struct hfi_msg_dev_async_ack *)msg_ptr;
+		struct hfi_msg_ofe_config *ofe_config_ack =
+			(struct hfi_msg_ofe_config *)(ioconfig_ack->msg_data);
+		struct cam_icp_hw_ctx_data *ctx_data = NULL;
+
+		if (ofe_config_ack->rc) {
+			CAM_ERR(CAM_ICP, "rc : %u, error type: %u error: [%s] opcode :%u",
+				ofe_config_ack->rc, ioconfig_ack->err_type,
+				cam_icp_error_handle_id_to_type(ioconfig_ack->err_type),
+				ioconfig_ack->opcode);
+			return -EIO;
+		}
+		ctx_data = (struct cam_icp_hw_ctx_data *)
+			U64_TO_PTR(ioconfig_ack->user_data1);
+		if (!ctx_data) {
+			CAM_ERR(CAM_ICP, "wrong ctx data from OFE config io response");
+			return -EINVAL;
+		}
+		CAM_DBG(CAM_ICP, "%s: received OFE config io response",
+			ctx_data->ctx_id_string);
 		break;
 		break;
+	}
 	case HFI_OFE_CMD_OPCODE_FRAME_PROCESS:
 	case HFI_OFE_CMD_OPCODE_FRAME_PROCESS:
 		CAM_DBG(CAM_ICP, "received OFE_FRAME_PROCESS:");
 		CAM_DBG(CAM_ICP, "received OFE_FRAME_PROCESS:");
 		rc = cam_icp_mgr_process_msg_frame_process(msg_ptr);
 		rc = cam_icp_mgr_process_msg_frame_process(msg_ptr);