瀏覽代碼

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 年之前
父節點
當前提交
8c3228ced8
共有 1 個文件被更改,包括 23 次插入22 次删除
  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",
 			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 {
 		CAM_ERR(CAM_ICP, "Invalid OPCODE: %u", ioconfig_ack->opcode);
 		return -EINVAL;
@@ -2778,12 +2761,30 @@ static int cam_icp_mgr_process_ofe_indirect_ack_msg(uint32_t *msg_ptr)
 	int rc = 0;
 
 	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;
+	}
 	case HFI_OFE_CMD_OPCODE_FRAME_PROCESS:
 		CAM_DBG(CAM_ICP, "received OFE_FRAME_PROCESS:");
 		rc = cam_icp_mgr_process_msg_frame_process(msg_ptr);