Browse Source

msm: camera: common: Change shutdown sequence for subdevices

In subdev close call if CRM is still active wait for shutdown
from CRM [media device]. Remove subdevice check for active
handles, shutdown to happen irrespective of any active context.

If CRM is not active, subdevice shutdown should ensure there is
no access to kernel allocated buffers since at this point
memmgr is de-initialized.

As part of ICP close, remove usage of HFI queues, trigger PIL
to transfer FW memory ownership back to HLOS and power off ICP.

CRs-Fixed: 2976107
Change-Id: Ib05b3fbdcc33f4072da7ef77cf0118a807860e8c
Signed-off-by: Karthik Anantha Ram <[email protected]>
Karthik Anantha Ram 4 years ago
parent
commit
d785949196
40 changed files with 85 additions and 397 deletions
  1. 0 25
      drivers/cam_core/cam_context.c
  2. 0 16
      drivers/cam_core/cam_context.h
  3. 0 21
      drivers/cam_core/cam_node.c
  4. 12 21
      drivers/cam_core/cam_node.h
  5. 12 6
      drivers/cam_core/cam_subdev.c
  6. 1 1
      drivers/cam_cpas/cam_cpas_intf.c
  7. 15 1
      drivers/cam_cre/cam_cre_dev.c
  8. 0 18
      drivers/cam_cust/cam_custom_context.c
  9. 0 12
      drivers/cam_cust/cam_custom_context.h
  10. 3 2
      drivers/cam_cust/cam_custom_dev.c
  11. 2 22
      drivers/cam_fd/cam_fd_context.c
  12. 0 11
      drivers/cam_fd/cam_fd_context.h
  13. 2 1
      drivers/cam_fd/cam_fd_dev.c
  14. 2 15
      drivers/cam_icp/cam_icp_context.c
  15. 0 8
      drivers/cam_icp/cam_icp_context.h
  16. 3 2
      drivers/cam_icp/cam_icp_subdev.c
  17. 4 41
      drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c
  18. 0 11
      drivers/cam_isp/cam_isp_context.c
  19. 0 12
      drivers/cam_isp/cam_isp_context.h
  20. 3 2
      drivers/cam_isp/cam_isp_dev.c
  21. 3 17
      drivers/cam_jpeg/cam_jpeg_context.c
  22. 0 12
      drivers/cam_jpeg/cam_jpeg_context.h
  23. 3 2
      drivers/cam_jpeg/cam_jpeg_dev.c
  24. 2 15
      drivers/cam_lrme/cam_lrme_context.c
  25. 0 12
      drivers/cam_lrme/cam_lrme_context.h
  26. 3 2
      drivers/cam_lrme/cam_lrme_dev.c
  27. 2 15
      drivers/cam_ope/cam_ope_context.c
  28. 0 8
      drivers/cam_ope/cam_ope_context.h
  29. 3 2
      drivers/cam_ope/cam_ope_subdev.c
  30. 2 13
      drivers/cam_req_mgr/cam_req_mgr_dev.c
  31. 0 4
      drivers/cam_req_mgr/cam_req_mgr_dev.h
  32. 0 31
      drivers/cam_req_mgr/cam_req_mgr_util.c
  33. 1 8
      drivers/cam_req_mgr/cam_req_mgr_util.h
  34. 1 2
      drivers/cam_req_mgr/cam_subdev.h
  35. 1 1
      drivers/cam_sensor_module/cam_actuator/cam_actuator_dev.c
  36. 1 1
      drivers/cam_sensor_module/cam_csiphy/cam_csiphy_dev.c
  37. 1 1
      drivers/cam_sensor_module/cam_eeprom/cam_eeprom_dev.c
  38. 1 1
      drivers/cam_sensor_module/cam_flash/cam_flash_dev.c
  39. 1 1
      drivers/cam_sensor_module/cam_ois/cam_ois_dev.c
  40. 1 1
      drivers/cam_sensor_module/cam_sensor/cam_sensor_dev.c

+ 0 - 25
drivers/cam_core/cam_context.c

@@ -610,31 +610,6 @@ int cam_context_handle_stop_dev(struct cam_context *ctx,
 	return rc;
 	return rc;
 }
 }
 
 
-int cam_context_handle_shutdown_dev(struct cam_context *ctx,
-	struct cam_control *cmd, struct v4l2_subdev_fh *fh)
-{
-	int rc = 0;
-
-	if (!ctx || !ctx->state_machine) {
-		CAM_ERR(CAM_CORE, "Context is not ready");
-		return -EINVAL;
-	}
-
-	if (!cmd) {
-		CAM_ERR(CAM_CORE, "Invalid stop device command payload");
-		return -EINVAL;
-	}
-
-	if (ctx->state_machine[ctx->state].ioctl_ops.shutdown_dev)
-		rc = ctx->state_machine[ctx->state].ioctl_ops.shutdown_dev(
-			(struct v4l2_subdev *)cmd->handle, fh);
-	else
-		CAM_WARN(CAM_CORE, "No shutdown device in dev %d, state %d",
-			ctx->dev_hdl, ctx->state);
-
-	return rc;
-}
-
 int cam_context_handle_info_dump(void *context,
 int cam_context_handle_info_dump(void *context,
 	enum cam_context_dump_id id)
 	enum cam_context_dump_id id)
 {
 {

+ 0 - 16
drivers/cam_core/cam_context.h

@@ -98,7 +98,6 @@ struct cam_ctx_request {
  * @acquire_hw:            Function pointer for acquire hw
  * @acquire_hw:            Function pointer for acquire hw
  * @release_hw:            Function pointer for release hw
  * @release_hw:            Function pointer for release hw
  * @dump_dev:              Function pointer for dump dev
  * @dump_dev:              Function pointer for dump dev
- * @shutdown_dev:          Function pointer for shutdown dev
  *
  *
  */
  */
 struct cam_ctx_ioctl_ops {
 struct cam_ctx_ioctl_ops {
@@ -118,8 +117,6 @@ struct cam_ctx_ioctl_ops {
 	int (*release_hw)(struct cam_context *ctx, void *args);
 	int (*release_hw)(struct cam_context *ctx, void *args);
 	int (*dump_dev)(struct cam_context *ctx,
 	int (*dump_dev)(struct cam_context *ctx,
 			struct cam_dump_req_cmd *cmd);
 			struct cam_dump_req_cmd *cmd);
-	int (*shutdown_dev)(struct v4l2_subdev *sd,
-			struct v4l2_subdev_fh *fh);
 };
 };
 
 
 /**
 /**
@@ -517,19 +514,6 @@ int cam_context_handle_start_dev(struct cam_context *ctx,
 int cam_context_handle_stop_dev(struct cam_context *ctx,
 int cam_context_handle_stop_dev(struct cam_context *ctx,
 		struct cam_start_stop_dev_cmd *cmd);
 		struct cam_start_stop_dev_cmd *cmd);
 
 
-/**
- * cam_context_handle_shutdown_dev()
- *
- * @brief:        Handle shutdown device command
- *
- * @ctx:          Object pointer for cam_context
- * @cmd:          Shutdown device command payload
- * @fh:           Pointer to struct v4l2_subdev_fh
- *
- */
-int cam_context_handle_shutdown_dev(struct cam_context *ctx,
-	struct cam_control *cmd, struct v4l2_subdev_fh *fh);
-
 /**
 /**
  * cam_context_handle_dump_dev()
  * cam_context_handle_dump_dev()
  *
  *

+ 0 - 21
drivers/cam_core/cam_node.c

@@ -297,27 +297,6 @@ static int __cam_node_handle_stop_dev(struct cam_node *node,
 	return rc;
 	return rc;
 }
 }
 
 
-int cam_node_handle_shutdown_dev(struct cam_node *node,
-	struct cam_control *cmd, struct v4l2_subdev_fh *fh)
-{
-	struct cam_context *ctx = NULL;
-	int32_t dev_index = -1;
-	int rc = 0, ret = 0;
-
-	while ((dev_index = cam_get_dev_handle_info(cmd->handle,
-		&ctx, dev_index)) < CAM_REQ_MGR_MAX_HANDLES_V2) {
-		ret = cam_context_handle_shutdown_dev(ctx, cmd, fh);
-		if (ret) {
-			rc = ret;
-			CAM_ERR(CAM_CORE, "Shutdown failure for node %s",
-					node->name);
-			continue;
-		}
-	}
-
-	return rc;
-}
-
 static int __cam_node_handle_config_dev(struct cam_node *node,
 static int __cam_node_handle_config_dev(struct cam_node *node,
 	struct cam_config_dev_cmd *config)
 	struct cam_config_dev_cmd *config)
 {
 {

+ 12 - 21
drivers/cam_core/cam_node.h

@@ -27,21 +27,25 @@
  * @ctx_size:              Context list size
  * @ctx_size:              Context list size
  * @hw_mgr_intf:           Interface for cam_node to HW
  * @hw_mgr_intf:           Interface for cam_node to HW
  * @crm_node_intf:         Interface for the CRM to cam_node
  * @crm_node_intf:         Interface for the CRM to cam_node
+ * @sd_handler:            Shutdown handler for this subdev
  *
  *
  */
  */
 struct cam_node {
 struct cam_node {
-	char                         name[CAM_CTX_DEV_NAME_MAX_LENGTH];
-	uint32_t                     state;
+	char                              name[CAM_CTX_DEV_NAME_MAX_LENGTH];
+	uint32_t                          state;
 
 
 	/* context pool */
 	/* context pool */
-	struct mutex                 list_mutex;
-	struct list_head             free_ctx_list;
-	struct cam_context          *ctx_list;
-	uint32_t                     ctx_size;
+	struct mutex                      list_mutex;
+	struct list_head                  free_ctx_list;
+	struct cam_context               *ctx_list;
+	uint32_t                          ctx_size;
 
 
 	/* interfaces */
 	/* interfaces */
-	struct cam_hw_mgr_intf       hw_mgr_intf;
-	struct cam_req_mgr_kmd_ops   crm_node_intf;
+	struct cam_hw_mgr_intf            hw_mgr_intf;
+	struct cam_req_mgr_kmd_ops        crm_node_intf;
+
+	int (*sd_handler)(struct v4l2_subdev *sd,
+		struct v4l2_subdev_fh *fh);
 };
 };
 
 
 /**
 /**
@@ -113,17 +117,4 @@ void cam_node_put_ctxt_to_free_list(struct kref *ref);
 int32_t cam_get_dev_handle_info(uint64_t handle,
 int32_t cam_get_dev_handle_info(uint64_t handle,
 	struct cam_context **ctx, int32_t dev_index);
 	struct cam_context **ctx, int32_t dev_index);
 
 
-/**
- * cam_node_handle_shutdown_dev()
- *
- * @brief:       Shutdowns all the active devices.
- *
- * @node:        pointer to struct node
- * @cmd:         pointer to struct cmd
- * @fh:          pointer to struct v4l2_subdev_fh
- *
- */
-int cam_node_handle_shutdown_dev(struct cam_node *node,
-	struct cam_control *cmd, struct v4l2_subdev_fh *fh);
-
 #endif /* _CAM_NODE_H_ */
 #endif /* _CAM_NODE_H_ */

+ 12 - 6
drivers/cam_core/cam_subdev.c

@@ -46,7 +46,6 @@ static long cam_subdev_ioctl(struct v4l2_subdev *sd, unsigned int cmd,
 	struct cam_node *node =
 	struct cam_node *node =
 		(struct cam_node *) v4l2_get_subdevdata(sd);
 		(struct cam_node *) v4l2_get_subdevdata(sd);
 	struct v4l2_subdev_fh *fh = (struct v4l2_subdev_fh *)arg;
 	struct v4l2_subdev_fh *fh = (struct v4l2_subdev_fh *)arg;
-	struct cam_control cntrl_cmd;
 
 
 	if (!node || node->state == CAM_NODE_STATE_UNINIT) {
 	if (!node || node->state == CAM_NODE_STATE_UNINIT) {
 		rc = -EINVAL;
 		rc = -EINVAL;
@@ -64,12 +63,19 @@ static long cam_subdev_ioctl(struct v4l2_subdev *sd, unsigned int cmd,
 			return 0;
 			return 0;
 		}
 		}
 
 
-		cntrl_cmd.op_code = CAM_SD_SHUTDOWN;
-		cntrl_cmd.handle = (uint64_t)sd;
-		rc = cam_node_handle_shutdown_dev(node, &cntrl_cmd, fh);
+		if (!node->sd_handler) {
+			CAM_ERR(CAM_CORE,
+				"No shutdown routine for %s", node->name);
+			rc = -EINVAL;
+			goto end;
+		}
+
+		CAM_DBG(CAM_CORE, "Shutdown for %s from media device", node->name);
+		rc = node->sd_handler(sd, fh);
 		if (rc)
 		if (rc)
-			CAM_ERR(CAM_CORE, "shutdown device failed(rc = %d)",
-				rc);
+			CAM_ERR(CAM_CORE,
+				"shutdown device failed(rc = %d) for %s",
+				rc, node->name);
 		break;
 		break;
 	default:
 	default:
 		CAM_ERR(CAM_CORE, "Invalid command %d for %s", cmd,
 		CAM_ERR(CAM_CORE, "Invalid command %d for %s", cmd,

+ 1 - 1
drivers/cam_cpas/cam_cpas_intf.c

@@ -805,7 +805,7 @@ static int __cam_cpas_subdev_close(struct v4l2_subdev *sd,
 static int cam_cpas_subdev_close(struct v4l2_subdev *sd,
 static int cam_cpas_subdev_close(struct v4l2_subdev *sd,
 	struct v4l2_subdev_fh *fh)
 	struct v4l2_subdev_fh *fh)
 {
 {
-	bool crm_active = cam_req_mgr_is_open(CAM_CPAS);
+	bool crm_active = cam_req_mgr_is_open();
 
 
 	if (crm_active) {
 	if (crm_active) {
 		CAM_DBG(CAM_CPAS, "CRM is ACTIVE, close should be from CRM");
 		CAM_DBG(CAM_CPAS, "CRM is ACTIVE, close should be from CRM");

+ 15 - 1
drivers/cam_cre/cam_cre_dev.c

@@ -58,7 +58,7 @@ static int cam_cre_subdev_open(struct v4l2_subdev *sd,
 	return 0;
 	return 0;
 }
 }
 
 
-static int cam_cre_subdev_close(struct v4l2_subdev *sd,
+static int cam_cre_subdev_close_internal(struct v4l2_subdev *sd,
 	struct v4l2_subdev_fh *fh)
 	struct v4l2_subdev_fh *fh)
 {
 {
 	int rc = 0;
 	int rc = 0;
@@ -88,6 +88,19 @@ end:
 	return rc;
 	return rc;
 }
 }
 
 
+static int cam_cre_subdev_close(struct v4l2_subdev *sd,
+	struct v4l2_subdev_fh *fh)
+{
+	bool crm_active = cam_req_mgr_is_open();
+
+	if (crm_active) {
+		CAM_DBG(CAM_ICP, "CRM is ACTIVE, close should be from CRM");
+		return 0;
+	}
+
+	return cam_cre_subdev_close_internal(sd, fh);
+}
+
 static const struct v4l2_subdev_internal_ops cam_cre_subdev_internal_ops = {
 static const struct v4l2_subdev_internal_ops cam_cre_subdev_internal_ops = {
 	.close = cam_cre_subdev_close,
 	.close = cam_cre_subdev_close,
 	.open = cam_cre_subdev_open,
 	.open = cam_cre_subdev_open,
@@ -139,6 +152,7 @@ static int cam_cre_subdev_component_bind(struct device *dev,
 		goto ctx_init_fail;
 		goto ctx_init_fail;
 	}
 	}
 
 
+	node->sd_handler = cam_cre_subdev_close_internal;
 	cam_smmu_set_client_page_fault_handler(iommu_hdl,
 	cam_smmu_set_client_page_fault_handler(iommu_hdl,
 		cam_cre_dev_iommu_fault_handler, node);
 		cam_cre_dev_iommu_fault_handler, node);
 
 

+ 0 - 18
drivers/cam_cust/cam_custom_context.c

@@ -1605,19 +1605,6 @@ static int __cam_custom_ctx_apply_default_req(
 	return rc;
 	return rc;
 }
 }
 
 
-static int __cam_custom_ctx_shutdown_dev(
-	struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
-{
-	int rc = -EINVAL;
-
-	if (!sd || !fh) {
-		CAM_ERR(CAM_CUSTOM, "Invalid input pointer");
-		return rc;
-	}
-
-	return cam_custom_subdev_close_internal(sd, fh);
-}
-
 /* top state machine */
 /* top state machine */
 static struct cam_ctx_ops
 static struct cam_ctx_ops
 	cam_custom_dev_ctx_top_state_machine[CAM_CTX_STATE_MAX] = {
 	cam_custom_dev_ctx_top_state_machine[CAM_CTX_STATE_MAX] = {
@@ -1632,7 +1619,6 @@ static struct cam_ctx_ops
 		.ioctl_ops = {
 		.ioctl_ops = {
 			.acquire_dev =
 			.acquire_dev =
 				__cam_custom_ctx_acquire_dev_in_available,
 				__cam_custom_ctx_acquire_dev_in_available,
-			.shutdown_dev = __cam_custom_ctx_shutdown_dev,
 		},
 		},
 		.crm_ops = {},
 		.crm_ops = {},
 		.irq_ops = NULL,
 		.irq_ops = NULL,
@@ -1644,7 +1630,6 @@ static struct cam_ctx_ops
 			.release_dev = __cam_custom_release_dev_in_acquired,
 			.release_dev = __cam_custom_release_dev_in_acquired,
 			.config_dev = __cam_custom_ctx_config_dev_in_acquired,
 			.config_dev = __cam_custom_ctx_config_dev_in_acquired,
 			.release_hw = __cam_custom_ctx_release_hw_in_top_state,
 			.release_hw = __cam_custom_ctx_release_hw_in_top_state,
-			.shutdown_dev = __cam_custom_ctx_shutdown_dev,
 		},
 		},
 		.crm_ops = {
 		.crm_ops = {
 			.link = __cam_custom_ctx_link_in_acquired,
 			.link = __cam_custom_ctx_link_in_acquired,
@@ -1663,7 +1648,6 @@ static struct cam_ctx_ops
 			.release_dev = __cam_custom_release_dev_in_acquired,
 			.release_dev = __cam_custom_release_dev_in_acquired,
 			.config_dev = __cam_custom_ctx_config_dev,
 			.config_dev = __cam_custom_ctx_config_dev,
 			.release_hw = __cam_custom_ctx_release_hw_in_top_state,
 			.release_hw = __cam_custom_ctx_release_hw_in_top_state,
-			.shutdown_dev = __cam_custom_ctx_shutdown_dev,
 		},
 		},
 		.crm_ops = {
 		.crm_ops = {
 			.unlink = __cam_custom_ctx_unlink_in_ready,
 			.unlink = __cam_custom_ctx_unlink_in_ready,
@@ -1681,7 +1665,6 @@ static struct cam_ctx_ops
 			.config_dev = __cam_custom_ctx_config_dev_in_flushed,
 			.config_dev = __cam_custom_ctx_config_dev_in_flushed,
 			.release_hw =
 			.release_hw =
 				__cam_custom_ctx_release_hw_in_activated_state,
 				__cam_custom_ctx_release_hw_in_activated_state,
-			.shutdown_dev = __cam_custom_ctx_shutdown_dev,
 		},
 		},
 		.crm_ops = {
 		.crm_ops = {
 			.unlink = __cam_custom_ctx_unlink_in_ready,
 			.unlink = __cam_custom_ctx_unlink_in_ready,
@@ -1698,7 +1681,6 @@ static struct cam_ctx_ops
 			.config_dev = __cam_custom_ctx_config_dev,
 			.config_dev = __cam_custom_ctx_config_dev,
 			.release_hw =
 			.release_hw =
 				__cam_custom_ctx_release_hw_in_activated_state,
 				__cam_custom_ctx_release_hw_in_activated_state,
-			.shutdown_dev = __cam_custom_ctx_shutdown_dev,
 		},
 		},
 		.crm_ops = {
 		.crm_ops = {
 			.unlink = __cam_custom_ctx_unlink_in_activated,
 			.unlink = __cam_custom_ctx_unlink_in_activated,

+ 0 - 12
drivers/cam_cust/cam_custom_context.h

@@ -150,16 +150,4 @@ int cam_custom_dev_context_init(struct cam_custom_context *ctx,
  */
  */
 int cam_custom_dev_context_deinit(struct cam_custom_context *ctx);
 int cam_custom_dev_context_deinit(struct cam_custom_context *ctx);
 
 
-/**
- * cam_custom_subdev_close_internal()
- *
- * @brief:               Close function for the Custom context
- *
- * @sd:                  Pointer to struct v4l2_subdev
- * @fh:                  Pointer to struct v4l2_subdev_fh
- *
- */
-int cam_custom_subdev_close_internal(struct v4l2_subdev *sd,
-	struct v4l2_subdev_fh *fh);
-
 #endif  /* _CAM_CUSTOM_CONTEXT_H_ */
 #endif  /* _CAM_CUSTOM_CONTEXT_H_ */

+ 3 - 2
drivers/cam_cust/cam_custom_dev.c

@@ -58,7 +58,7 @@ static int cam_custom_subdev_open(struct v4l2_subdev *sd,
 	return 0;
 	return 0;
 }
 }
 
 
-int cam_custom_subdev_close_internal(struct v4l2_subdev *sd,
+static int cam_custom_subdev_close_internal(struct v4l2_subdev *sd,
 	struct v4l2_subdev_fh *fh)
 	struct v4l2_subdev_fh *fh)
 {
 {
 	int rc = 0;
 	int rc = 0;
@@ -89,7 +89,7 @@ end:
 static int cam_custom_subdev_close(struct v4l2_subdev *sd,
 static int cam_custom_subdev_close(struct v4l2_subdev *sd,
 	struct v4l2_subdev_fh *fh)
 	struct v4l2_subdev_fh *fh)
 {
 {
-	bool crm_active = cam_req_mgr_is_open(CAM_CUSTOM);
+	bool crm_active = cam_req_mgr_is_open();
 
 
 	if (crm_active) {
 	if (crm_active) {
 		CAM_DBG(CAM_CUSTOM, "CRM is ACTIVE, close should be from CRM");
 		CAM_DBG(CAM_CUSTOM, "CRM is ACTIVE, close should be from CRM");
@@ -152,6 +152,7 @@ static int cam_custom_component_bind(struct device *dev,
 		goto unregister;
 		goto unregister;
 	}
 	}
 
 
+	node->sd_handler = cam_custom_subdev_close_internal;
 	cam_smmu_set_client_page_fault_handler(iommu_hdl,
 	cam_smmu_set_client_page_fault_handler(iommu_hdl,
 		cam_custom_dev_iommu_fault_handler, node);
 		cam_custom_dev_iommu_fault_handler, node);
 
 

+ 2 - 22
drivers/cam_fd/cam_fd_context.c

@@ -169,19 +169,6 @@ static int __cam_fd_ctx_handle_irq_in_activated(void *context,
 	return rc;
 	return rc;
 }
 }
 
 
-static int __cam_fd_shutdown_dev(struct v4l2_subdev *sd,
-	struct v4l2_subdev_fh *fh)
-{
-	int rc = -EINVAL;
-
-	if (!sd || !fh) {
-		CAM_ERR(CAM_FD, "Invalid input pointer");
-		return rc;
-	}
-
-	return cam_fd_dev_close_internal(sd, fh);
-}
-
 /* top state machine */
 /* top state machine */
 static struct cam_ctx_ops
 static struct cam_ctx_ops
 	cam_fd_ctx_state_machine[CAM_CTX_STATE_MAX] = {
 	cam_fd_ctx_state_machine[CAM_CTX_STATE_MAX] = {
@@ -195,7 +182,6 @@ static struct cam_ctx_ops
 	{
 	{
 		.ioctl_ops = {
 		.ioctl_ops = {
 			.acquire_dev = __cam_fd_ctx_acquire_dev_in_available,
 			.acquire_dev = __cam_fd_ctx_acquire_dev_in_available,
-			.shutdown_dev = __cam_fd_shutdown_dev,
 		},
 		},
 		.crm_ops = {},
 		.crm_ops = {},
 		.irq_ops = NULL,
 		.irq_ops = NULL,
@@ -206,24 +192,19 @@ static struct cam_ctx_ops
 			.release_dev = __cam_fd_ctx_release_dev_in_acquired,
 			.release_dev = __cam_fd_ctx_release_dev_in_acquired,
 			.config_dev = __cam_fd_ctx_config_dev_in_acquired,
 			.config_dev = __cam_fd_ctx_config_dev_in_acquired,
 			.start_dev = __cam_fd_ctx_start_dev_in_acquired,
 			.start_dev = __cam_fd_ctx_start_dev_in_acquired,
-			.shutdown_dev = __cam_fd_shutdown_dev,
 		},
 		},
 		.crm_ops = {},
 		.crm_ops = {},
 		.irq_ops = NULL,
 		.irq_ops = NULL,
 	},
 	},
 	/* Ready */
 	/* Ready */
 	{
 	{
-		.ioctl_ops = {
-			.shutdown_dev = __cam_fd_shutdown_dev,
-		},
+		.ioctl_ops = {},
 		.crm_ops = {},
 		.crm_ops = {},
 		.irq_ops = NULL,
 		.irq_ops = NULL,
 	},
 	},
 	/* Flushed */
 	/* Flushed */
 	{
 	{
-		.ioctl_ops = {
-			.shutdown_dev = __cam_fd_shutdown_dev,
-		},
+		.ioctl_ops = {},
 	},
 	},
 	/* Activated */
 	/* Activated */
 	{
 	{
@@ -233,7 +214,6 @@ static struct cam_ctx_ops
 			.config_dev = __cam_fd_ctx_config_dev_in_activated,
 			.config_dev = __cam_fd_ctx_config_dev_in_activated,
 			.flush_dev = __cam_fd_ctx_flush_dev_in_activated,
 			.flush_dev = __cam_fd_ctx_flush_dev_in_activated,
 			.dump_dev = __cam_fd_ctx_dump_dev_in_activated,
 			.dump_dev = __cam_fd_ctx_dump_dev_in_activated,
-			.shutdown_dev = __cam_fd_shutdown_dev,
 		},
 		},
 		.crm_ops = {},
 		.crm_ops = {},
 		.irq_ops = __cam_fd_ctx_handle_irq_in_activated,
 		.irq_ops = __cam_fd_ctx_handle_irq_in_activated,

+ 0 - 11
drivers/cam_fd/cam_fd_context.h

@@ -27,15 +27,4 @@ int cam_fd_context_init(struct cam_fd_context *fd_ctx,
 	uint32_t ctx_id);
 	uint32_t ctx_id);
 int cam_fd_context_deinit(struct cam_fd_context *ctx);
 int cam_fd_context_deinit(struct cam_fd_context *ctx);
 
 
-/**
- * cam_fd_dev_close_internal()
- *
- * @brief:     Close function for the fd dev
- *
- * @sd:        Pointer to struct v4l2_subdev
- * @fh:        Pointer to struct v4l2_subdev_fh
- */
-int cam_fd_dev_close_internal(struct v4l2_subdev *sd,
-	struct v4l2_subdev_fh *fh);
-
 #endif /* _CAM_FD_CONTEXT_H_ */
 #endif /* _CAM_FD_CONTEXT_H_ */

+ 2 - 1
drivers/cam_fd/cam_fd_dev.c

@@ -91,7 +91,7 @@ static int cam_fd_dev_close_internal(struct v4l2_subdev *sd,
 static int cam_fd_dev_close(struct v4l2_subdev *sd,
 static int cam_fd_dev_close(struct v4l2_subdev *sd,
 	struct v4l2_subdev_fh *fh)
 	struct v4l2_subdev_fh *fh)
 {
 {
-	bool crm_active = cam_req_mgr_is_open(CAM_FD);
+	bool crm_active = cam_req_mgr_is_open();
 
 
 	if (crm_active) {
 	if (crm_active) {
 		CAM_DBG(CAM_FD, "CRM is ACTIVE, close should be from CRM");
 		CAM_DBG(CAM_FD, "CRM is ACTIVE, close should be from CRM");
@@ -151,6 +151,7 @@ static int cam_fd_dev_component_bind(struct device *dev,
 		goto deinit_ctx;
 		goto deinit_ctx;
 	}
 	}
 
 
+	node->sd_handler = cam_fd_dev_close_internal;
 	mutex_init(&g_fd_dev.lock);
 	mutex_init(&g_fd_dev.lock);
 	g_fd_dev.probe_done = true;
 	g_fd_dev.probe_done = true;
 	CAM_DBG(CAM_FD, "Component bound successfully");
 	CAM_DBG(CAM_FD, "Component bound successfully");

+ 2 - 15
drivers/cam_icp/cam_icp_context.c

@@ -221,12 +221,6 @@ static int __cam_icp_handle_buf_done_in_ready(void *ctx,
 	return cam_context_buf_done_from_hw(ctx, done, evt_id);
 	return cam_context_buf_done_from_hw(ctx, done, evt_id);
 }
 }
 
 
-static int __cam_icp_shutdown_dev(
-	struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
-{
-	return cam_icp_subdev_close_internal(sd, fh);
-}
-
 static struct cam_ctx_ops
 static struct cam_ctx_ops
 	cam_icp_ctx_state_machine[CAM_CTX_STATE_MAX] = {
 	cam_icp_ctx_state_machine[CAM_CTX_STATE_MAX] = {
 	/* Uninit */
 	/* Uninit */
@@ -239,7 +233,6 @@ static struct cam_ctx_ops
 	{
 	{
 		.ioctl_ops = {
 		.ioctl_ops = {
 			.acquire_dev = __cam_icp_acquire_dev_in_available,
 			.acquire_dev = __cam_icp_acquire_dev_in_available,
-			.shutdown_dev = __cam_icp_shutdown_dev,
 		},
 		},
 		.crm_ops = {},
 		.crm_ops = {},
 		.irq_ops = NULL,
 		.irq_ops = NULL,
@@ -252,7 +245,6 @@ static struct cam_ctx_ops
 			.config_dev = __cam_icp_config_dev_in_ready,
 			.config_dev = __cam_icp_config_dev_in_ready,
 			.flush_dev = __cam_icp_flush_dev_in_ready,
 			.flush_dev = __cam_icp_flush_dev_in_ready,
 			.dump_dev = __cam_icp_dump_dev_in_ready,
 			.dump_dev = __cam_icp_dump_dev_in_ready,
-			.shutdown_dev = __cam_icp_shutdown_dev,
 		},
 		},
 		.crm_ops = {},
 		.crm_ops = {},
 		.irq_ops = __cam_icp_handle_buf_done_in_ready,
 		.irq_ops = __cam_icp_handle_buf_done_in_ready,
@@ -266,7 +258,6 @@ static struct cam_ctx_ops
 			.config_dev = __cam_icp_config_dev_in_ready,
 			.config_dev = __cam_icp_config_dev_in_ready,
 			.flush_dev = __cam_icp_flush_dev_in_ready,
 			.flush_dev = __cam_icp_flush_dev_in_ready,
 			.dump_dev = __cam_icp_dump_dev_in_ready,
 			.dump_dev = __cam_icp_dump_dev_in_ready,
-			.shutdown_dev = __cam_icp_shutdown_dev,
 		},
 		},
 		.crm_ops = {},
 		.crm_ops = {},
 		.irq_ops = __cam_icp_handle_buf_done_in_ready,
 		.irq_ops = __cam_icp_handle_buf_done_in_ready,
@@ -274,15 +265,11 @@ static struct cam_ctx_ops
 	},
 	},
 	/* Flushed */
 	/* Flushed */
 	{
 	{
-		.ioctl_ops = {
-			.shutdown_dev = __cam_icp_shutdown_dev,
-		},
+		.ioctl_ops = {},
 	},
 	},
 	/* Activated */
 	/* Activated */
 	{
 	{
-		.ioctl_ops = {
-			.shutdown_dev = __cam_icp_shutdown_dev,
-		},
+		.ioctl_ops = {},
 		.crm_ops = {},
 		.crm_ops = {},
 		.irq_ops = NULL,
 		.irq_ops = NULL,
 		.pagefault_ops = cam_icp_context_dump_active_request,
 		.pagefault_ops = cam_icp_context_dump_active_request,

+ 0 - 8
drivers/cam_icp/cam_icp_context.h

@@ -39,12 +39,4 @@ int cam_icp_context_init(struct cam_icp_context *ctx,
  */
  */
 int cam_icp_context_deinit(struct cam_icp_context *ctx);
 int cam_icp_context_deinit(struct cam_icp_context *ctx);
 
 
-/**
- * cam_icp_subdev_close_internal() - Close function for the icp dev
- * @sd: Pointer to struct v4l2_subdev
- * @fh: Pointer to struct v4l2_subdev_fh
- */
-int cam_icp_subdev_close_internal(struct v4l2_subdev *sd,
-	struct v4l2_subdev_fh *fh);
-
 #endif /* _CAM_ICP_CONTEXT_H_ */
 #endif /* _CAM_ICP_CONTEXT_H_ */

+ 3 - 2
drivers/cam_icp/cam_icp_subdev.c

@@ -98,7 +98,7 @@ end:
 	return rc;
 	return rc;
 }
 }
 
 
-int cam_icp_subdev_close_internal(struct v4l2_subdev *sd,
+static int cam_icp_subdev_close_internal(struct v4l2_subdev *sd,
 	struct v4l2_subdev_fh *fh)
 	struct v4l2_subdev_fh *fh)
 {
 {
 	int rc = 0;
 	int rc = 0;
@@ -138,7 +138,7 @@ end:
 static int cam_icp_subdev_close(struct v4l2_subdev *sd,
 static int cam_icp_subdev_close(struct v4l2_subdev *sd,
 	struct v4l2_subdev_fh *fh)
 	struct v4l2_subdev_fh *fh)
 {
 {
-	bool crm_active = cam_req_mgr_is_open(CAM_ICP);
+	bool crm_active = cam_req_mgr_is_open();
 
 
 	if (crm_active) {
 	if (crm_active) {
 		CAM_DBG(CAM_ICP, "CRM is ACTIVE, close should be from CRM");
 		CAM_DBG(CAM_ICP, "CRM is ACTIVE, close should be from CRM");
@@ -210,6 +210,7 @@ static int cam_icp_component_bind(struct device *dev,
 		goto ctx_fail;
 		goto ctx_fail;
 	}
 	}
 
 
+	node->sd_handler = cam_icp_subdev_close_internal;
 	cam_smmu_set_client_page_fault_handler(iommu_hdl,
 	cam_smmu_set_client_page_fault_handler(iommu_hdl,
 		cam_icp_dev_iommu_fault_handler, node);
 		cam_icp_dev_iommu_fault_handler, node);
 
 

+ 4 - 41
drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c

@@ -3363,42 +3363,6 @@ static int cam_icp_mgr_proc_boot(struct cam_icp_hw_mgr *hw_mgr)
 	return rc;
 	return rc;
 }
 }
 
 
-static int __resume_and_idle(struct cam_icp_hw_mgr *hw_mgr)
-{
-	struct cam_hw_intf *icp_dev_intf = hw_mgr->icp_dev_intf;
-	int rc;
-
-	rc = icp_dev_intf->hw_ops.init(icp_dev_intf->hw_priv, NULL, 0);
-	if (rc) {
-		CAM_ERR(CAM_ICP, "icp hw init failed rc=%d", rc);
-		return rc;
-	}
-
-	rc = cam_icp_mgr_proc_resume(hw_mgr);
-	if (rc) {
-		CAM_ERR(CAM_ICP, "icp resume failed rc=%d", rc);
-		goto out_deinit;
-	}
-
-	if (hw_mgr->icp_pc_flag) {
-		rc = cam_icp_mgr_send_pc_prep(hw_mgr);
-		if (rc) {
-			CAM_ERR(CAM_ICP,
-				"send power collapse prep failed rc=%d",
-				rc);
-			goto out_collapse;
-		}
-	}
-
-	return 0;
-
-out_collapse:
-	cam_icp_mgr_proc_suspend(hw_mgr);
-out_deinit:
-	icp_dev_intf->hw_ops.deinit(icp_dev_intf->hw_priv, NULL, 0);
-	return rc;
-}
-
 static void cam_icp_mgr_proc_shutdown(struct cam_icp_hw_mgr *hw_mgr)
 static void cam_icp_mgr_proc_shutdown(struct cam_icp_hw_mgr *hw_mgr)
 {
 {
 	struct cam_hw_intf *icp_dev_intf = hw_mgr->icp_dev_intf;
 	struct cam_hw_intf *icp_dev_intf = hw_mgr->icp_dev_intf;
@@ -3408,13 +3372,12 @@ static void cam_icp_mgr_proc_shutdown(struct cam_icp_hw_mgr *hw_mgr)
 		return;
 		return;
 	}
 	}
 
 
-	if (!hw_mgr->icp_resumed && __resume_and_idle(hw_mgr))
-		return;
+	icp_dev_intf->hw_ops.init(icp_dev_intf->hw_priv, NULL, 0);
 
 
 	icp_dev_intf->hw_ops.process_cmd(
 	icp_dev_intf->hw_ops.process_cmd(
-			icp_dev_intf->hw_priv,
-			CAM_ICP_CMD_PROC_SHUTDOWN,
-			NULL, 0);
+		icp_dev_intf->hw_priv,
+		CAM_ICP_CMD_PROC_SHUTDOWN,
+		NULL, 0);
 
 
 	icp_dev_intf->hw_ops.deinit(icp_dev_intf->hw_priv, NULL, 0);
 	icp_dev_intf->hw_ops.deinit(icp_dev_intf->hw_priv, NULL, 0);
 
 

+ 0 - 11
drivers/cam_isp/cam_isp_context.c

@@ -6409,12 +6409,6 @@ static int __cam_isp_ctx_handle_irq_in_activated(void *context,
 	return rc;
 	return rc;
 }
 }
 
 
-static int __cam_isp_shutdown_dev(
-	struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
-{
-	return cam_isp_subdev_close_internal(sd, fh);
-}
-
 /* top state machine */
 /* top state machine */
 static struct cam_ctx_ops
 static struct cam_ctx_ops
 	cam_isp_ctx_top_state_machine[CAM_CTX_STATE_MAX] = {
 	cam_isp_ctx_top_state_machine[CAM_CTX_STATE_MAX] = {
@@ -6428,7 +6422,6 @@ static struct cam_ctx_ops
 	{
 	{
 		.ioctl_ops = {
 		.ioctl_ops = {
 			.acquire_dev = __cam_isp_ctx_acquire_dev_in_available,
 			.acquire_dev = __cam_isp_ctx_acquire_dev_in_available,
-			.shutdown_dev = __cam_isp_shutdown_dev,
 		},
 		},
 		.crm_ops = {},
 		.crm_ops = {},
 		.irq_ops = NULL,
 		.irq_ops = NULL,
@@ -6440,7 +6433,6 @@ static struct cam_ctx_ops
 			.release_dev = __cam_isp_ctx_release_dev_in_top_state,
 			.release_dev = __cam_isp_ctx_release_dev_in_top_state,
 			.config_dev = __cam_isp_ctx_config_dev_in_acquired,
 			.config_dev = __cam_isp_ctx_config_dev_in_acquired,
 			.release_hw = __cam_isp_ctx_release_hw_in_top_state,
 			.release_hw = __cam_isp_ctx_release_hw_in_top_state,
-			.shutdown_dev = __cam_isp_shutdown_dev,
 		},
 		},
 		.crm_ops = {
 		.crm_ops = {
 			.link = __cam_isp_ctx_link_in_acquired,
 			.link = __cam_isp_ctx_link_in_acquired,
@@ -6460,7 +6452,6 @@ static struct cam_ctx_ops
 			.release_dev = __cam_isp_ctx_release_dev_in_top_state,
 			.release_dev = __cam_isp_ctx_release_dev_in_top_state,
 			.config_dev = __cam_isp_ctx_config_dev_in_top_state,
 			.config_dev = __cam_isp_ctx_config_dev_in_top_state,
 			.release_hw = __cam_isp_ctx_release_hw_in_top_state,
 			.release_hw = __cam_isp_ctx_release_hw_in_top_state,
-			.shutdown_dev = __cam_isp_shutdown_dev,
 		},
 		},
 		.crm_ops = {
 		.crm_ops = {
 			.unlink = __cam_isp_ctx_unlink_in_ready,
 			.unlink = __cam_isp_ctx_unlink_in_ready,
@@ -6478,7 +6469,6 @@ static struct cam_ctx_ops
 			.release_dev = __cam_isp_ctx_release_dev_in_activated,
 			.release_dev = __cam_isp_ctx_release_dev_in_activated,
 			.config_dev = __cam_isp_ctx_config_dev_in_flushed,
 			.config_dev = __cam_isp_ctx_config_dev_in_flushed,
 			.release_hw = __cam_isp_ctx_release_hw_in_activated,
 			.release_hw = __cam_isp_ctx_release_hw_in_activated,
-			.shutdown_dev = __cam_isp_shutdown_dev,
 		},
 		},
 		.crm_ops = {
 		.crm_ops = {
 			.unlink = __cam_isp_ctx_unlink_in_ready,
 			.unlink = __cam_isp_ctx_unlink_in_ready,
@@ -6495,7 +6485,6 @@ static struct cam_ctx_ops
 			.release_dev = __cam_isp_ctx_release_dev_in_activated,
 			.release_dev = __cam_isp_ctx_release_dev_in_activated,
 			.config_dev = __cam_isp_ctx_config_dev_in_top_state,
 			.config_dev = __cam_isp_ctx_config_dev_in_top_state,
 			.release_hw = __cam_isp_ctx_release_hw_in_activated,
 			.release_hw = __cam_isp_ctx_release_hw_in_activated,
-			.shutdown_dev = __cam_isp_shutdown_dev,
 		},
 		},
 		.crm_ops = {
 		.crm_ops = {
 			.unlink = __cam_isp_ctx_unlink_in_activated,
 			.unlink = __cam_isp_ctx_unlink_in_activated,

+ 0 - 12
drivers/cam_isp/cam_isp_context.h

@@ -372,16 +372,4 @@ int cam_isp_context_init(struct cam_isp_context *ctx,
  */
  */
 int cam_isp_context_deinit(struct cam_isp_context *ctx);
 int cam_isp_context_deinit(struct cam_isp_context *ctx);
 
 
-/**
- * cam_isp_subdev_close_internal()
- *
- * @brief:              Close function for the isp dev
- *
- * @sd:                 Pointer to struct v4l2_subdev
- * @fh:                 Pointer to struct v4l2_subdev_fh
- *
- */
-int cam_isp_subdev_close_internal(struct v4l2_subdev *sd,
-	struct v4l2_subdev_fh *fh);
-
 #endif  /* __CAM_ISP_CONTEXT_H__ */
 #endif  /* __CAM_ISP_CONTEXT_H__ */

+ 3 - 2
drivers/cam_isp/cam_isp_dev.c

@@ -55,7 +55,7 @@ static int cam_isp_subdev_open(struct v4l2_subdev *sd,
 	return 0;
 	return 0;
 }
 }
 
 
-int cam_isp_subdev_close_internal(struct v4l2_subdev *sd,
+static int cam_isp_subdev_close_internal(struct v4l2_subdev *sd,
 	struct v4l2_subdev_fh *fh)
 	struct v4l2_subdev_fh *fh)
 {
 {
 	int rc = 0;
 	int rc = 0;
@@ -86,7 +86,7 @@ end:
 static int cam_isp_subdev_close(struct v4l2_subdev *sd,
 static int cam_isp_subdev_close(struct v4l2_subdev *sd,
 	struct v4l2_subdev_fh *fh)
 	struct v4l2_subdev_fh *fh)
 {
 {
-	bool crm_active = cam_req_mgr_is_open(CAM_ISP);
+	bool crm_active = cam_req_mgr_is_open();
 
 
 	if (crm_active) {
 	if (crm_active) {
 		CAM_DBG(CAM_ISP, "CRM is ACTIVE, close should be from CRM");
 		CAM_DBG(CAM_ISP, "CRM is ACTIVE, close should be from CRM");
@@ -188,6 +188,7 @@ static int cam_isp_dev_component_bind(struct device *dev,
 		goto kfree;
 		goto kfree;
 	}
 	}
 
 
+	node->sd_handler = cam_isp_subdev_close_internal;
 	cam_smmu_set_client_page_fault_handler(iommu_hdl,
 	cam_smmu_set_client_page_fault_handler(iommu_hdl,
 		cam_isp_dev_iommu_fault_handler, node);
 		cam_isp_dev_iommu_fault_handler, node);
 
 

+ 3 - 17
drivers/cam_jpeg/cam_jpeg_context.c

@@ -135,12 +135,6 @@ static int __cam_jpeg_ctx_stop_dev_in_acquired(struct cam_context *ctx,
 	return rc;
 	return rc;
 }
 }
 
 
-static int __cam_jpeg_shutdown_dev(
-	struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
-{
-	return cam_jpeg_subdev_close_internal(sd, fh);
-}
-
 /* top state machine */
 /* top state machine */
 static struct cam_ctx_ops
 static struct cam_ctx_ops
 	cam_jpeg_ctx_state_machine[CAM_CTX_STATE_MAX] = {
 	cam_jpeg_ctx_state_machine[CAM_CTX_STATE_MAX] = {
@@ -154,7 +148,6 @@ static struct cam_ctx_ops
 	{
 	{
 		.ioctl_ops = {
 		.ioctl_ops = {
 			.acquire_dev = __cam_jpeg_ctx_acquire_dev_in_available,
 			.acquire_dev = __cam_jpeg_ctx_acquire_dev_in_available,
-			.shutdown_dev = __cam_jpeg_shutdown_dev,
 		},
 		},
 		.crm_ops = { },
 		.crm_ops = { },
 		.irq_ops = NULL,
 		.irq_ops = NULL,
@@ -167,7 +160,6 @@ static struct cam_ctx_ops
 			.stop_dev = __cam_jpeg_ctx_stop_dev_in_acquired,
 			.stop_dev = __cam_jpeg_ctx_stop_dev_in_acquired,
 			.flush_dev = __cam_jpeg_ctx_flush_dev_in_acquired,
 			.flush_dev = __cam_jpeg_ctx_flush_dev_in_acquired,
 			.dump_dev = __cam_jpeg_ctx_dump_dev_in_acquired,
 			.dump_dev = __cam_jpeg_ctx_dump_dev_in_acquired,
-			.shutdown_dev = __cam_jpeg_shutdown_dev,
 		},
 		},
 		.crm_ops = { },
 		.crm_ops = { },
 		.irq_ops = __cam_jpeg_ctx_handle_buf_done_in_acquired,
 		.irq_ops = __cam_jpeg_ctx_handle_buf_done_in_acquired,
@@ -175,21 +167,15 @@ static struct cam_ctx_ops
 	},
 	},
 	/* Ready */
 	/* Ready */
 	{
 	{
-		.ioctl_ops = {
-			.shutdown_dev = __cam_jpeg_shutdown_dev,
-		},
+		.ioctl_ops = {},
 	},
 	},
 	/* Flushed */
 	/* Flushed */
 	{
 	{
-		.ioctl_ops = {
-			.shutdown_dev = __cam_jpeg_shutdown_dev,
-		},
+		.ioctl_ops = {},
 	},
 	},
 	/* Activated */
 	/* Activated */
 	{
 	{
-		.ioctl_ops = {
-			.shutdown_dev = __cam_jpeg_shutdown_dev,
-		},
+		.ioctl_ops = {},
 	},
 	},
 };
 };
 
 

+ 0 - 12
drivers/cam_jpeg/cam_jpeg_context.h

@@ -64,16 +64,4 @@ int cam_jpeg_context_init(struct cam_jpeg_context *ctx,
  */
  */
 int cam_jpeg_context_deinit(struct cam_jpeg_context *ctx);
 int cam_jpeg_context_deinit(struct cam_jpeg_context *ctx);
 
 
-/**
- * cam_jpeg_subdev_close_internal()
- *
- * @brief: Close function for the jpeg dev
- *
- * @sd: Pointer to struct v4l2_subdev
- * @fh: Pointer to struct v4l2_subdev_fh
- *
- */
-int cam_jpeg_subdev_close_internal(struct v4l2_subdev *sd,
-	struct v4l2_subdev_fh *fh);
-
 #endif  /* __CAM_JPEG_CONTEXT_H__ */
 #endif  /* __CAM_JPEG_CONTEXT_H__ */

+ 3 - 2
drivers/cam_jpeg/cam_jpeg_dev.c

@@ -56,7 +56,7 @@ static int cam_jpeg_subdev_open(struct v4l2_subdev *sd,
 	return 0;
 	return 0;
 }
 }
 
 
-int cam_jpeg_subdev_close_internal(struct v4l2_subdev *sd,
+static int cam_jpeg_subdev_close_internal(struct v4l2_subdev *sd,
 	struct v4l2_subdev_fh *fh)
 	struct v4l2_subdev_fh *fh)
 {
 {
 	int rc = 0;
 	int rc = 0;
@@ -88,7 +88,7 @@ end:
 static int cam_jpeg_subdev_close(struct v4l2_subdev *sd,
 static int cam_jpeg_subdev_close(struct v4l2_subdev *sd,
 	struct v4l2_subdev_fh *fh)
 	struct v4l2_subdev_fh *fh)
 {
 {
-	bool crm_active = cam_req_mgr_is_open(CAM_JPEG);
+	bool crm_active = cam_req_mgr_is_open();
 
 
 	if (crm_active) {
 	if (crm_active) {
 		CAM_DBG(CAM_JPEG, "CRM is ACTIVE, close should be from CRM");
 		CAM_DBG(CAM_JPEG, "CRM is ACTIVE, close should be from CRM");
@@ -148,6 +148,7 @@ static int cam_jpeg_dev_component_bind(struct device *dev,
 		goto ctx_init_fail;
 		goto ctx_init_fail;
 	}
 	}
 
 
+	node->sd_handler = cam_jpeg_subdev_close_internal;
 	cam_smmu_set_client_page_fault_handler(iommu_hdl,
 	cam_smmu_set_client_page_fault_handler(iommu_hdl,
 		cam_jpeg_dev_iommu_fault_handler, node);
 		cam_jpeg_dev_iommu_fault_handler, node);
 
 

+ 2 - 15
drivers/cam_lrme/cam_lrme_context.c

@@ -172,12 +172,6 @@ static int __cam_lrme_ctx_handle_irq_in_activated(void *context,
 	return rc;
 	return rc;
 }
 }
 
 
-static int __cam_lrme_shutdown_dev(
-	struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
-{
-	return cam_lrme_dev_close_internal(sd, fh);
-}
-
 /* top state machine */
 /* top state machine */
 static struct cam_ctx_ops
 static struct cam_ctx_ops
 	cam_lrme_ctx_state_machine[CAM_CTX_STATE_MAX] = {
 	cam_lrme_ctx_state_machine[CAM_CTX_STATE_MAX] = {
@@ -191,7 +185,6 @@ static struct cam_ctx_ops
 	{
 	{
 		.ioctl_ops = {
 		.ioctl_ops = {
 			.acquire_dev = __cam_lrme_ctx_acquire_dev_in_available,
 			.acquire_dev = __cam_lrme_ctx_acquire_dev_in_available,
-			.shutdown_dev = __cam_lrme_shutdown_dev,
 		},
 		},
 		.crm_ops = {},
 		.crm_ops = {},
 		.irq_ops = NULL,
 		.irq_ops = NULL,
@@ -202,24 +195,19 @@ static struct cam_ctx_ops
 			.config_dev = __cam_lrme_ctx_config_dev_in_activated,
 			.config_dev = __cam_lrme_ctx_config_dev_in_activated,
 			.release_dev = __cam_lrme_ctx_release_dev_in_acquired,
 			.release_dev = __cam_lrme_ctx_release_dev_in_acquired,
 			.start_dev = __cam_lrme_ctx_start_dev_in_acquired,
 			.start_dev = __cam_lrme_ctx_start_dev_in_acquired,
-			.shutdown_dev = __cam_lrme_shutdown_dev,
 		},
 		},
 		.crm_ops = {},
 		.crm_ops = {},
 		.irq_ops = NULL,
 		.irq_ops = NULL,
 	},
 	},
 	/* Ready */
 	/* Ready */
 	{
 	{
-		.ioctl_ops = {
-			.shutdown_dev = __cam_lrme_shutdown_dev,
-		},
+		.ioctl_ops = {},
 		.crm_ops = {},
 		.crm_ops = {},
 		.irq_ops = NULL,
 		.irq_ops = NULL,
 	},
 	},
 	/* Flushed */
 	/* Flushed */
 	{
 	{
-		.ioctl_ops = {
-			.shutdown_dev = __cam_lrme_shutdown_dev,
-	},
+		.ioctl_ops = {},
 	},
 	},
 	/* Activate */
 	/* Activate */
 	{
 	{
@@ -229,7 +217,6 @@ static struct cam_ctx_ops
 			.stop_dev = __cam_lrme_ctx_stop_dev_in_activated,
 			.stop_dev = __cam_lrme_ctx_stop_dev_in_activated,
 			.flush_dev = __cam_lrme_ctx_flush_dev_in_activated,
 			.flush_dev = __cam_lrme_ctx_flush_dev_in_activated,
 			.dump_dev = __cam_lrme_ctx_dump_dev_in_activated,
 			.dump_dev = __cam_lrme_ctx_dump_dev_in_activated,
-			.shutdown_dev = __cam_lrme_shutdown_dev,
 		},
 		},
 		.crm_ops = {},
 		.crm_ops = {},
 		.irq_ops = __cam_lrme_ctx_handle_irq_in_activated,
 		.irq_ops = __cam_lrme_ctx_handle_irq_in_activated,

+ 0 - 12
drivers/cam_lrme/cam_lrme_context.h

@@ -30,16 +30,4 @@ int cam_lrme_context_init(struct cam_lrme_context *lrme_ctx,
 	uint32_t index);
 	uint32_t index);
 int cam_lrme_context_deinit(struct cam_lrme_context *lrme_ctx);
 int cam_lrme_context_deinit(struct cam_lrme_context *lrme_ctx);
 
 
-/**
- * cam_lrme_dev_close_internal()
- *
- * @brief: Close function for the jpeg dev
- *
- * @sd: Pointer to struct v4l2_subdev
- * @fh: Pointer to struct v4l2_subdev_fh
- *
- */
-int cam_lrme_dev_close_internal(struct v4l2_subdev *sd,
-	struct v4l2_subdev_fh *fh);
-
 #endif /* _CAM_LRME_CONTEXT_H_ */
 #endif /* _CAM_LRME_CONTEXT_H_ */

+ 3 - 2
drivers/cam_lrme/cam_lrme_dev.c

@@ -72,7 +72,7 @@ static int cam_lrme_dev_open(struct v4l2_subdev *sd,
 	return 0;
 	return 0;
 }
 }
 
 
-int cam_lrme_dev_close_internal(struct v4l2_subdev *sd,
+static int cam_lrme_dev_close_internal(struct v4l2_subdev *sd,
 	struct v4l2_subdev_fh *fh)
 	struct v4l2_subdev_fh *fh)
 {
 {
 	int rc = 0;
 	int rc = 0;
@@ -109,7 +109,7 @@ end:
 static int cam_lrme_dev_close(struct v4l2_subdev *sd,
 static int cam_lrme_dev_close(struct v4l2_subdev *sd,
 	struct v4l2_subdev_fh *fh)
 	struct v4l2_subdev_fh *fh)
 {
 {
-	bool crm_active = cam_req_mgr_is_open(CAM_LRME);
+	bool crm_active = cam_req_mgr_is_open();
 
 
 	if (crm_active) {
 	if (crm_active) {
 		CAM_DBG(CAM_LRME, "CRM is ACTIVE, close should be from CRM");
 		CAM_DBG(CAM_LRME, "CRM is ACTIVE, close should be from CRM");
@@ -173,6 +173,7 @@ static int cam_lrme_component_bind(struct device *dev,
 		goto deinit_ctx;
 		goto deinit_ctx;
 	}
 	}
 
 
+	node->sd_handler = cam_lrme_dev_close_internal;
 	CAM_DBG(CAM_LRME, "Component bound successfully");
 	CAM_DBG(CAM_LRME, "Component bound successfully");
 
 
 	return 0;
 	return 0;

+ 2 - 15
drivers/cam_ope/cam_ope_context.c

@@ -195,12 +195,6 @@ static int __cam_ope_handle_buf_done_in_ready(void *ctx,
 	return cam_context_buf_done_from_hw(ctx, done, evt_id);
 	return cam_context_buf_done_from_hw(ctx, done, evt_id);
 }
 }
 
 
-static int __cam_ope_shutdown_dev(
-	struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
-{
-	return cam_ope_subdev_close_internal(sd, fh);
-}
-
 static struct cam_ctx_ops
 static struct cam_ctx_ops
 	cam_ope_ctx_state_machine[CAM_CTX_STATE_MAX] = {
 	cam_ope_ctx_state_machine[CAM_CTX_STATE_MAX] = {
 	/* Uninit */
 	/* Uninit */
@@ -213,7 +207,6 @@ static struct cam_ctx_ops
 	{
 	{
 		.ioctl_ops = {
 		.ioctl_ops = {
 			.acquire_dev = __cam_ope_acquire_dev_in_available,
 			.acquire_dev = __cam_ope_acquire_dev_in_available,
-			.shutdown_dev = __cam_ope_shutdown_dev,
 		},
 		},
 		.crm_ops = {},
 		.crm_ops = {},
 		.irq_ops = NULL,
 		.irq_ops = NULL,
@@ -226,7 +219,6 @@ static struct cam_ctx_ops
 			.config_dev = __cam_ope_config_dev_in_ready,
 			.config_dev = __cam_ope_config_dev_in_ready,
 			.flush_dev = __cam_ope_flush_dev_in_ready,
 			.flush_dev = __cam_ope_flush_dev_in_ready,
 			.dump_dev = __cam_ope_dump_dev_in_ready,
 			.dump_dev = __cam_ope_dump_dev_in_ready,
-			.shutdown_dev = __cam_ope_shutdown_dev,
 		},
 		},
 		.crm_ops = {},
 		.crm_ops = {},
 		.irq_ops = __cam_ope_handle_buf_done_in_ready,
 		.irq_ops = __cam_ope_handle_buf_done_in_ready,
@@ -240,7 +232,6 @@ static struct cam_ctx_ops
 			.config_dev = __cam_ope_config_dev_in_ready,
 			.config_dev = __cam_ope_config_dev_in_ready,
 			.flush_dev = __cam_ope_flush_dev_in_ready,
 			.flush_dev = __cam_ope_flush_dev_in_ready,
 			.dump_dev = __cam_ope_dump_dev_in_ready,
 			.dump_dev = __cam_ope_dump_dev_in_ready,
-			.shutdown_dev = __cam_ope_shutdown_dev,
 		},
 		},
 		.crm_ops = {},
 		.crm_ops = {},
 		.irq_ops = __cam_ope_handle_buf_done_in_ready,
 		.irq_ops = __cam_ope_handle_buf_done_in_ready,
@@ -248,15 +239,11 @@ static struct cam_ctx_ops
 	},
 	},
 	/* Flushed */
 	/* Flushed */
 	{
 	{
-		.ioctl_ops = {
-			.shutdown_dev = __cam_ope_shutdown_dev,
-		},
+		.ioctl_ops = {},
 	},
 	},
 	/* Activated */
 	/* Activated */
 	{
 	{
-		.ioctl_ops = {
-			.shutdown_dev = __cam_ope_shutdown_dev,
-		},
+		.ioctl_ops = {},
 		.crm_ops = {},
 		.crm_ops = {},
 		.irq_ops = NULL,
 		.irq_ops = NULL,
 		.pagefault_ops = cam_ope_context_dump_active_request,
 		.pagefault_ops = cam_ope_context_dump_active_request,

+ 0 - 8
drivers/cam_ope/cam_ope_context.h

@@ -41,12 +41,4 @@ int cam_ope_context_init(struct cam_ope_context *ctx,
  */
  */
 int cam_ope_context_deinit(struct cam_ope_context *ctx);
 int cam_ope_context_deinit(struct cam_ope_context *ctx);
 
 
-/**
- * cam_ope_subdev_close_internal() - Close function for the icp dev
- * @sd: Pointer to struct v4l2_subdev
- * @fh: Pointer to struct v4l2_subdev_fh
- */
-int cam_ope_subdev_close_internal(struct v4l2_subdev *sd,
-	struct v4l2_subdev_fh *fh);
-
 #endif /* _CAM_OPE_CONTEXT_H_ */
 #endif /* _CAM_OPE_CONTEXT_H_ */

+ 3 - 2
drivers/cam_ope/cam_ope_subdev.c

@@ -95,7 +95,7 @@ end:
 	return rc;
 	return rc;
 }
 }
 
 
-int cam_ope_subdev_close_internal(struct v4l2_subdev *sd,
+static int cam_ope_subdev_close_internal(struct v4l2_subdev *sd,
 	struct v4l2_subdev_fh *fh)
 	struct v4l2_subdev_fh *fh)
 {
 {
 	int rc = 0;
 	int rc = 0;
@@ -137,7 +137,7 @@ end:
 static int cam_ope_subdev_close(struct v4l2_subdev *sd,
 static int cam_ope_subdev_close(struct v4l2_subdev *sd,
 	struct v4l2_subdev_fh *fh)
 	struct v4l2_subdev_fh *fh)
 {
 {
-	bool crm_active = cam_req_mgr_is_open(CAM_OPE);
+	bool crm_active = cam_req_mgr_is_open();
 
 
 	if (crm_active) {
 	if (crm_active) {
 		CAM_DBG(CAM_OPE, "CRM is ACTIVE, close should be from CRM");
 		CAM_DBG(CAM_OPE, "CRM is ACTIVE, close should be from CRM");
@@ -215,6 +215,7 @@ static int cam_ope_subdev_component_bind(struct device *dev,
 	g_ope_dev.open_cnt = 0;
 	g_ope_dev.open_cnt = 0;
 	mutex_init(&g_ope_dev.ope_lock);
 	mutex_init(&g_ope_dev.ope_lock);
 
 
+	node->sd_handler = cam_ope_subdev_close_internal;
 	CAM_DBG(CAM_OPE, "Subdev component bound successfully");
 	CAM_DBG(CAM_OPE, "Subdev component bound successfully");
 
 
 	return rc;
 	return rc;

+ 2 - 13
drivers/cam_req_mgr/cam_req_mgr_dev.c

@@ -124,7 +124,6 @@ static int cam_req_mgr_open(struct file *filep)
 	spin_unlock_bh(&g_dev.cam_eventq_lock);
 	spin_unlock_bh(&g_dev.cam_eventq_lock);
 
 
 	g_dev.open_cnt++;
 	g_dev.open_cnt++;
-	g_dev.read_active_dev_id_hdls = 0;
 	rc = cam_mem_mgr_init();
 	rc = cam_mem_mgr_init();
 	if (rc) {
 	if (rc) {
 		g_dev.open_cnt--;
 		g_dev.open_cnt--;
@@ -192,7 +191,6 @@ static int cam_req_mgr_close(struct file *filep)
 
 
 	g_dev.open_cnt--;
 	g_dev.open_cnt--;
 	g_dev.shutdown_state = false;
 	g_dev.shutdown_state = false;
-	g_dev.read_active_dev_id_hdls = 0;
 	v4l2_fh_release(filep);
 	v4l2_fh_release(filep);
 
 
 	spin_lock_bh(&g_dev.cam_eventq_lock);
 	spin_lock_bh(&g_dev.cam_eventq_lock);
@@ -687,21 +685,12 @@ static int cam_req_mgr_ordered_list_cmp(void *priv,
 		return 0;
 		return 0;
 }
 }
 
 
-bool cam_req_mgr_is_open(uint64_t dev_id)
+bool cam_req_mgr_is_open(void)
 {
 {
-	bool crm_status;
-	bool dev_id_status;
+	bool crm_status = false;
 
 
 	mutex_lock(&g_dev.cam_lock);
 	mutex_lock(&g_dev.cam_lock);
 	crm_status = g_dev.open_cnt ? true : false;
 	crm_status = g_dev.open_cnt ? true : false;
-
-	if (!g_dev.read_active_dev_id_hdls) {
-		g_dev.active_dev_id_hdls = cam_get_dev_handle_status();
-		g_dev.read_active_dev_id_hdls++;
-	}
-
-	dev_id_status = (g_dev.active_dev_id_hdls & dev_id) ? true : false;
-	crm_status &=  dev_id_status;
 	mutex_unlock(&g_dev.cam_lock);
 	mutex_unlock(&g_dev.cam_lock);
 
 
 	return crm_status;
 	return crm_status;

+ 0 - 4
drivers/cam_req_mgr/cam_req_mgr_dev.h

@@ -20,8 +20,6 @@
  * @cam_eventq: event queue
  * @cam_eventq: event queue
  * @cam_eventq_lock: lock for event queue
  * @cam_eventq_lock: lock for event queue
  * @shutdown_state: shutdown state
  * @shutdown_state: shutdown state
- * @active_dev_id_hdls: active dev id handles
- * @read_active_dev_id_hdls: read active_dev_id_hdls status
  */
  */
 struct cam_req_mgr_device {
 struct cam_req_mgr_device {
 	struct video_device *video;
 	struct video_device *video;
@@ -34,8 +32,6 @@ struct cam_req_mgr_device {
 	struct v4l2_fh *cam_eventq;
 	struct v4l2_fh *cam_eventq;
 	spinlock_t cam_eventq_lock;
 	spinlock_t cam_eventq_lock;
 	bool shutdown_state;
 	bool shutdown_state;
-	uint64_t active_dev_id_hdls;
-	int read_active_dev_id_hdls;
 };
 };
 
 
 #define CAM_REQ_MGR_GET_PAYLOAD_PTR(ev, type)        \
 #define CAM_REQ_MGR_GET_PAYLOAD_PTR(ev, type)        \

+ 0 - 31
drivers/cam_req_mgr/cam_req_mgr_util.c

@@ -14,7 +14,6 @@
 #include <media/cam_req_mgr.h>
 #include <media/cam_req_mgr.h>
 #include "cam_req_mgr_util.h"
 #include "cam_req_mgr_util.h"
 #include "cam_debug_util.h"
 #include "cam_debug_util.h"
-#include "cam_context.h"
 
 
 static struct cam_req_mgr_util_hdl_tbl *hdl_tbl;
 static struct cam_req_mgr_util_hdl_tbl *hdl_tbl;
 static DEFINE_SPINLOCK(hdl_tbl_lock);
 static DEFINE_SPINLOCK(hdl_tbl_lock);
@@ -210,36 +209,6 @@ int32_t cam_create_device_hdl(struct cam_create_dev_hdl *hdl_data)
 	return handle;
 	return handle;
 }
 }
 
 
-int32_t cam_get_dev_handle_info(uint64_t handle,
-	struct cam_context **ctx, int32_t dev_index)
-{
-	int32_t idx;
-	struct v4l2_subdev *sd = (struct v4l2_subdev *)handle;
-
-	for (idx = dev_index + 1; idx < CAM_REQ_MGR_MAX_HANDLES_V2; idx++) {
-		if (hdl_tbl->hdl[idx].state == HDL_ACTIVE) {
-			*ctx = (struct cam_context *)cam_get_device_priv(
-					hdl_tbl->hdl[idx].hdl_value);
-			if ((*ctx) && !strcmp(sd->name, (*ctx)->dev_name))
-				return idx;
-		}
-	}
-	*ctx = NULL;
-	return CAM_REQ_MGR_MAX_HANDLES_V2;
-}
-
-uint64_t cam_get_dev_handle_status(void)
-{
-	int32_t idx;
-	uint64_t active_dev_hdls = 0;
-
-	for (idx = 0; idx < CAM_REQ_MGR_MAX_HANDLES_V2; idx++)
-		if (hdl_tbl->hdl[idx].state == HDL_ACTIVE)
-			active_dev_hdls |= hdl_tbl->hdl[idx].dev_id;
-
-	return active_dev_hdls;
-}
-
 void *cam_get_device_priv(int32_t dev_hdl)
 void *cam_get_device_priv(int32_t dev_hdl)
 {
 {
 	int idx;
 	int idx;

+ 1 - 8
drivers/cam_req_mgr/cam_req_mgr_util.h

@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
 /*
- * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
  */
  */
 
 
 #ifndef _CAM_REQ_MGR_UTIL_API_H_
 #ifndef _CAM_REQ_MGR_UTIL_API_H_
@@ -166,11 +166,4 @@ int32_t cam_req_mgr_util_deinit(void);
  */
  */
 int32_t cam_req_mgr_util_free_hdls(void);
 int32_t cam_req_mgr_util_free_hdls(void);
 
 
-/**
- * cam_get_dev_handle_status() - get dev handles status
- *
- * Returns dev handle status
- */
-uint64_t cam_get_dev_handle_status(void);
-
 #endif /* _CAM_REQ_MGR_UTIL_API_H_ */
 #endif /* _CAM_REQ_MGR_UTIL_API_H_ */

+ 1 - 2
drivers/cam_req_mgr/cam_subdev.h

@@ -134,9 +134,8 @@ int cam_unregister_subdev(struct cam_subdev *sd);
  *
  *
  * @brief:    This common utility function returns the crm active status
  * @brief:    This common utility function returns the crm active status
  *
  *
- * @dev_id: device id type
  */
  */
-bool  cam_req_mgr_is_open(uint64_t dev_id);
+bool  cam_req_mgr_is_open(void);
 
 
 /**
 /**
  * cam_req_mgr_is_shutdown()
  * cam_req_mgr_is_shutdown()

+ 1 - 1
drivers/cam_sensor_module/cam_actuator/cam_actuator_dev.c

@@ -31,7 +31,7 @@ static int cam_actuator_subdev_close_internal(struct v4l2_subdev *sd,
 static int cam_actuator_subdev_close(struct v4l2_subdev *sd,
 static int cam_actuator_subdev_close(struct v4l2_subdev *sd,
 	struct v4l2_subdev_fh *fh)
 	struct v4l2_subdev_fh *fh)
 {
 {
-	bool crm_active = cam_req_mgr_is_open(CAM_ACTUATOR);
+	bool crm_active = cam_req_mgr_is_open();
 
 
 	if (crm_active) {
 	if (crm_active) {
 		CAM_DBG(CAM_ACTUATOR,
 		CAM_DBG(CAM_ACTUATOR,

+ 1 - 1
drivers/cam_sensor_module/cam_csiphy/cam_csiphy_dev.c

@@ -113,7 +113,7 @@ static int cam_csiphy_subdev_close_internal(struct v4l2_subdev *sd,
 static int cam_csiphy_subdev_close(struct v4l2_subdev *sd,
 static int cam_csiphy_subdev_close(struct v4l2_subdev *sd,
 	struct v4l2_subdev_fh *fh)
 	struct v4l2_subdev_fh *fh)
 {
 {
-	bool crm_active = cam_req_mgr_is_open(CAM_CSIPHY);
+	bool crm_active = cam_req_mgr_is_open();
 
 
 	if (crm_active) {
 	if (crm_active) {
 		CAM_DBG(CAM_CSIPHY, "CRM is ACTIVE, close should be from CRM");
 		CAM_DBG(CAM_CSIPHY, "CRM is ACTIVE, close should be from CRM");

+ 1 - 1
drivers/cam_sensor_module/cam_eeprom/cam_eeprom_dev.c

@@ -31,7 +31,7 @@ static int cam_eeprom_subdev_close_internal(struct v4l2_subdev *sd,
 static int cam_eeprom_subdev_close(struct v4l2_subdev *sd,
 static int cam_eeprom_subdev_close(struct v4l2_subdev *sd,
 	struct v4l2_subdev_fh *fh)
 	struct v4l2_subdev_fh *fh)
 {
 {
-	bool crm_active = cam_req_mgr_is_open(CAM_EEPROM);
+	bool crm_active = cam_req_mgr_is_open();
 
 
 	if (crm_active) {
 	if (crm_active) {
 		CAM_DBG(CAM_EEPROM, "CRM is ACTIVE, close should be from CRM");
 		CAM_DBG(CAM_EEPROM, "CRM is ACTIVE, close should be from CRM");

+ 1 - 1
drivers/cam_sensor_module/cam_flash/cam_flash_dev.c

@@ -257,7 +257,7 @@ static int cam_flash_subdev_close_internal(struct v4l2_subdev *sd,
 static int cam_flash_subdev_close(struct v4l2_subdev *sd,
 static int cam_flash_subdev_close(struct v4l2_subdev *sd,
 	struct v4l2_subdev_fh *fh)
 	struct v4l2_subdev_fh *fh)
 {
 {
-	bool crm_active = cam_req_mgr_is_open(CAM_FLASH);
+	bool crm_active = cam_req_mgr_is_open();
 
 
 	if (crm_active) {
 	if (crm_active) {
 		CAM_DBG(CAM_FLASH, "CRM is ACTIVE, close should be from CRM");
 		CAM_DBG(CAM_FLASH, "CRM is ACTIVE, close should be from CRM");

+ 1 - 1
drivers/cam_sensor_module/cam_ois/cam_ois_dev.c

@@ -31,7 +31,7 @@ static int cam_ois_subdev_close_internal(struct v4l2_subdev *sd,
 static int cam_ois_subdev_close(struct v4l2_subdev *sd,
 static int cam_ois_subdev_close(struct v4l2_subdev *sd,
 	struct v4l2_subdev_fh *fh)
 	struct v4l2_subdev_fh *fh)
 {
 {
-	bool crm_active = cam_req_mgr_is_open(CAM_OIS);
+	bool crm_active = cam_req_mgr_is_open();
 
 
 	if (crm_active) {
 	if (crm_active) {
 		CAM_DBG(CAM_OIS, "CRM is ACTIVE, close should be from CRM");
 		CAM_DBG(CAM_OIS, "CRM is ACTIVE, close should be from CRM");

+ 1 - 1
drivers/cam_sensor_module/cam_sensor/cam_sensor_dev.c

@@ -30,7 +30,7 @@ static int cam_sensor_subdev_close_internal(struct v4l2_subdev *sd,
 static int cam_sensor_subdev_close(struct v4l2_subdev *sd,
 static int cam_sensor_subdev_close(struct v4l2_subdev *sd,
 	struct v4l2_subdev_fh *fh)
 	struct v4l2_subdev_fh *fh)
 {
 {
-	bool crm_active = cam_req_mgr_is_open(CAM_SENSOR);
+	bool crm_active = cam_req_mgr_is_open();
 
 
 	if (crm_active) {
 	if (crm_active) {
 		CAM_DBG(CAM_SENSOR, "CRM is ACTIVE, close should be from CRM");
 		CAM_DBG(CAM_SENSOR, "CRM is ACTIVE, close should be from CRM");