diff --git a/drivers/cam_core/cam_context.c b/drivers/cam_core/cam_context.c index 6332fe9482..d435a163e1 100644 --- a/drivers/cam_core/cam_context.c +++ b/drivers/cam_core/cam_context.c @@ -610,31 +610,6 @@ int cam_context_handle_stop_dev(struct cam_context *ctx, 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, enum cam_context_dump_id id) { diff --git a/drivers/cam_core/cam_context.h b/drivers/cam_core/cam_context.h index 6ea7dcce07..89caef9238 100644 --- a/drivers/cam_core/cam_context.h +++ b/drivers/cam_core/cam_context.h @@ -98,7 +98,6 @@ struct cam_ctx_request { * @acquire_hw: Function pointer for acquire hw * @release_hw: Function pointer for release hw * @dump_dev: Function pointer for dump dev - * @shutdown_dev: Function pointer for shutdown dev * */ struct cam_ctx_ioctl_ops { @@ -118,8 +117,6 @@ struct cam_ctx_ioctl_ops { int (*release_hw)(struct cam_context *ctx, void *args); int (*dump_dev)(struct cam_context *ctx, 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, 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() * diff --git a/drivers/cam_core/cam_node.c b/drivers/cam_core/cam_node.c index db19a20bfe..7d17f92b64 100644 --- a/drivers/cam_core/cam_node.c +++ b/drivers/cam_core/cam_node.c @@ -297,27 +297,6 @@ static int __cam_node_handle_stop_dev(struct cam_node *node, 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, struct cam_config_dev_cmd *config) { diff --git a/drivers/cam_core/cam_node.h b/drivers/cam_core/cam_node.h index 8b707a1524..7a134ae17e 100644 --- a/drivers/cam_core/cam_node.h +++ b/drivers/cam_core/cam_node.h @@ -27,21 +27,25 @@ * @ctx_size: Context list size * @hw_mgr_intf: Interface for cam_node to HW * @crm_node_intf: Interface for the CRM to cam_node + * @sd_handler: Shutdown handler for this subdev * */ 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 */ - 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 */ - 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, 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_ */ diff --git a/drivers/cam_core/cam_subdev.c b/drivers/cam_core/cam_subdev.c index a0e3458400..59b222e61d 100644 --- a/drivers/cam_core/cam_subdev.c +++ b/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 *) v4l2_get_subdevdata(sd); struct v4l2_subdev_fh *fh = (struct v4l2_subdev_fh *)arg; - struct cam_control cntrl_cmd; if (!node || node->state == CAM_NODE_STATE_UNINIT) { rc = -EINVAL; @@ -64,12 +63,19 @@ static long cam_subdev_ioctl(struct v4l2_subdev *sd, unsigned int cmd, 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) - 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; default: CAM_ERR(CAM_CORE, "Invalid command %d for %s", cmd, diff --git a/drivers/cam_cpas/cam_cpas_intf.c b/drivers/cam_cpas/cam_cpas_intf.c index 1f6eab848e..3053d2dd99 100644 --- a/drivers/cam_cpas/cam_cpas_intf.c +++ b/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, 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) { CAM_DBG(CAM_CPAS, "CRM is ACTIVE, close should be from CRM"); diff --git a/drivers/cam_cre/cam_cre_dev.c b/drivers/cam_cre/cam_cre_dev.c index 16eae26768..86710da656 100644 --- a/drivers/cam_cre/cam_cre_dev.c +++ b/drivers/cam_cre/cam_cre_dev.c @@ -58,7 +58,7 @@ static int cam_cre_subdev_open(struct v4l2_subdev *sd, 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) { int rc = 0; @@ -88,6 +88,19 @@ end: 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 = { .close = cam_cre_subdev_close, .open = cam_cre_subdev_open, @@ -139,6 +152,7 @@ static int cam_cre_subdev_component_bind(struct device *dev, goto ctx_init_fail; } + node->sd_handler = cam_cre_subdev_close_internal; cam_smmu_set_client_page_fault_handler(iommu_hdl, cam_cre_dev_iommu_fault_handler, node); diff --git a/drivers/cam_cust/cam_custom_context.c b/drivers/cam_cust/cam_custom_context.c index 3975db69f1..a38748d392 100644 --- a/drivers/cam_cust/cam_custom_context.c +++ b/drivers/cam_cust/cam_custom_context.c @@ -1605,19 +1605,6 @@ static int __cam_custom_ctx_apply_default_req( 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 */ static struct cam_ctx_ops cam_custom_dev_ctx_top_state_machine[CAM_CTX_STATE_MAX] = { @@ -1632,7 +1619,6 @@ static struct cam_ctx_ops .ioctl_ops = { .acquire_dev = __cam_custom_ctx_acquire_dev_in_available, - .shutdown_dev = __cam_custom_ctx_shutdown_dev, }, .crm_ops = {}, .irq_ops = NULL, @@ -1644,7 +1630,6 @@ static struct cam_ctx_ops .release_dev = __cam_custom_release_dev_in_acquired, .config_dev = __cam_custom_ctx_config_dev_in_acquired, .release_hw = __cam_custom_ctx_release_hw_in_top_state, - .shutdown_dev = __cam_custom_ctx_shutdown_dev, }, .crm_ops = { .link = __cam_custom_ctx_link_in_acquired, @@ -1663,7 +1648,6 @@ static struct cam_ctx_ops .release_dev = __cam_custom_release_dev_in_acquired, .config_dev = __cam_custom_ctx_config_dev, .release_hw = __cam_custom_ctx_release_hw_in_top_state, - .shutdown_dev = __cam_custom_ctx_shutdown_dev, }, .crm_ops = { .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, .release_hw = __cam_custom_ctx_release_hw_in_activated_state, - .shutdown_dev = __cam_custom_ctx_shutdown_dev, }, .crm_ops = { .unlink = __cam_custom_ctx_unlink_in_ready, @@ -1698,7 +1681,6 @@ static struct cam_ctx_ops .config_dev = __cam_custom_ctx_config_dev, .release_hw = __cam_custom_ctx_release_hw_in_activated_state, - .shutdown_dev = __cam_custom_ctx_shutdown_dev, }, .crm_ops = { .unlink = __cam_custom_ctx_unlink_in_activated, diff --git a/drivers/cam_cust/cam_custom_context.h b/drivers/cam_cust/cam_custom_context.h index 12a5ffd6a9..f8eae6a2cf 100644 --- a/drivers/cam_cust/cam_custom_context.h +++ b/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); -/** - * 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_ */ diff --git a/drivers/cam_cust/cam_custom_dev.c b/drivers/cam_cust/cam_custom_dev.c index 36dde62fc5..1c997f6595 100644 --- a/drivers/cam_cust/cam_custom_dev.c +++ b/drivers/cam_cust/cam_custom_dev.c @@ -58,7 +58,7 @@ static int cam_custom_subdev_open(struct v4l2_subdev *sd, 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) { int rc = 0; @@ -89,7 +89,7 @@ end: static int cam_custom_subdev_close(struct v4l2_subdev *sd, 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) { 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; } + node->sd_handler = cam_custom_subdev_close_internal; cam_smmu_set_client_page_fault_handler(iommu_hdl, cam_custom_dev_iommu_fault_handler, node); diff --git a/drivers/cam_fd/cam_fd_context.c b/drivers/cam_fd/cam_fd_context.c index 2037215630..4328a1376f 100644 --- a/drivers/cam_fd/cam_fd_context.c +++ b/drivers/cam_fd/cam_fd_context.c @@ -169,19 +169,6 @@ static int __cam_fd_ctx_handle_irq_in_activated(void *context, 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 */ static struct cam_ctx_ops cam_fd_ctx_state_machine[CAM_CTX_STATE_MAX] = { @@ -195,7 +182,6 @@ static struct cam_ctx_ops { .ioctl_ops = { .acquire_dev = __cam_fd_ctx_acquire_dev_in_available, - .shutdown_dev = __cam_fd_shutdown_dev, }, .crm_ops = {}, .irq_ops = NULL, @@ -206,24 +192,19 @@ static struct cam_ctx_ops .release_dev = __cam_fd_ctx_release_dev_in_acquired, .config_dev = __cam_fd_ctx_config_dev_in_acquired, .start_dev = __cam_fd_ctx_start_dev_in_acquired, - .shutdown_dev = __cam_fd_shutdown_dev, }, .crm_ops = {}, .irq_ops = NULL, }, /* Ready */ { - .ioctl_ops = { - .shutdown_dev = __cam_fd_shutdown_dev, - }, + .ioctl_ops = {}, .crm_ops = {}, .irq_ops = NULL, }, /* Flushed */ { - .ioctl_ops = { - .shutdown_dev = __cam_fd_shutdown_dev, - }, + .ioctl_ops = {}, }, /* Activated */ { @@ -233,7 +214,6 @@ static struct cam_ctx_ops .config_dev = __cam_fd_ctx_config_dev_in_activated, .flush_dev = __cam_fd_ctx_flush_dev_in_activated, .dump_dev = __cam_fd_ctx_dump_dev_in_activated, - .shutdown_dev = __cam_fd_shutdown_dev, }, .crm_ops = {}, .irq_ops = __cam_fd_ctx_handle_irq_in_activated, diff --git a/drivers/cam_fd/cam_fd_context.h b/drivers/cam_fd/cam_fd_context.h index a57ed91d45..caa7645531 100644 --- a/drivers/cam_fd/cam_fd_context.h +++ b/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); 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_ */ diff --git a/drivers/cam_fd/cam_fd_dev.c b/drivers/cam_fd/cam_fd_dev.c index a58db056f6..3c9377f9e8 100644 --- a/drivers/cam_fd/cam_fd_dev.c +++ b/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, 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) { 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; } + node->sd_handler = cam_fd_dev_close_internal; mutex_init(&g_fd_dev.lock); g_fd_dev.probe_done = true; CAM_DBG(CAM_FD, "Component bound successfully"); diff --git a/drivers/cam_icp/cam_icp_context.c b/drivers/cam_icp/cam_icp_context.c index 88a84105b8..1e01077b85 100644 --- a/drivers/cam_icp/cam_icp_context.c +++ b/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); } -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 cam_icp_ctx_state_machine[CAM_CTX_STATE_MAX] = { /* Uninit */ @@ -239,7 +233,6 @@ static struct cam_ctx_ops { .ioctl_ops = { .acquire_dev = __cam_icp_acquire_dev_in_available, - .shutdown_dev = __cam_icp_shutdown_dev, }, .crm_ops = {}, .irq_ops = NULL, @@ -252,7 +245,6 @@ static struct cam_ctx_ops .config_dev = __cam_icp_config_dev_in_ready, .flush_dev = __cam_icp_flush_dev_in_ready, .dump_dev = __cam_icp_dump_dev_in_ready, - .shutdown_dev = __cam_icp_shutdown_dev, }, .crm_ops = {}, .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, .flush_dev = __cam_icp_flush_dev_in_ready, .dump_dev = __cam_icp_dump_dev_in_ready, - .shutdown_dev = __cam_icp_shutdown_dev, }, .crm_ops = {}, .irq_ops = __cam_icp_handle_buf_done_in_ready, @@ -274,15 +265,11 @@ static struct cam_ctx_ops }, /* Flushed */ { - .ioctl_ops = { - .shutdown_dev = __cam_icp_shutdown_dev, - }, + .ioctl_ops = {}, }, /* Activated */ { - .ioctl_ops = { - .shutdown_dev = __cam_icp_shutdown_dev, - }, + .ioctl_ops = {}, .crm_ops = {}, .irq_ops = NULL, .pagefault_ops = cam_icp_context_dump_active_request, diff --git a/drivers/cam_icp/cam_icp_context.h b/drivers/cam_icp/cam_icp_context.h index 9150bcf43f..dc9018d1c2 100644 --- a/drivers/cam_icp/cam_icp_context.h +++ b/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); -/** - * 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_ */ diff --git a/drivers/cam_icp/cam_icp_subdev.c b/drivers/cam_icp/cam_icp_subdev.c index 1a3be9b64a..5116e2fb0f 100644 --- a/drivers/cam_icp/cam_icp_subdev.c +++ b/drivers/cam_icp/cam_icp_subdev.c @@ -98,7 +98,7 @@ end: 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) { int rc = 0; @@ -138,7 +138,7 @@ end: static int cam_icp_subdev_close(struct v4l2_subdev *sd, 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) { 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; } + node->sd_handler = cam_icp_subdev_close_internal; cam_smmu_set_client_page_fault_handler(iommu_hdl, cam_icp_dev_iommu_fault_handler, node); diff --git a/drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c b/drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c index 35a5dbb56f..0d1fe50ecf 100644 --- a/drivers/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c +++ b/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; } -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) { 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; } - 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_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); diff --git a/drivers/cam_isp/cam_isp_context.c b/drivers/cam_isp/cam_isp_context.c index 692c2a96ad..c2ca6e0d81 100644 --- a/drivers/cam_isp/cam_isp_context.c +++ b/drivers/cam_isp/cam_isp_context.c @@ -6409,12 +6409,6 @@ static int __cam_isp_ctx_handle_irq_in_activated(void *context, 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 */ static struct cam_ctx_ops cam_isp_ctx_top_state_machine[CAM_CTX_STATE_MAX] = { @@ -6428,7 +6422,6 @@ static struct cam_ctx_ops { .ioctl_ops = { .acquire_dev = __cam_isp_ctx_acquire_dev_in_available, - .shutdown_dev = __cam_isp_shutdown_dev, }, .crm_ops = {}, .irq_ops = NULL, @@ -6440,7 +6433,6 @@ static struct cam_ctx_ops .release_dev = __cam_isp_ctx_release_dev_in_top_state, .config_dev = __cam_isp_ctx_config_dev_in_acquired, .release_hw = __cam_isp_ctx_release_hw_in_top_state, - .shutdown_dev = __cam_isp_shutdown_dev, }, .crm_ops = { .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, .config_dev = __cam_isp_ctx_config_dev_in_top_state, .release_hw = __cam_isp_ctx_release_hw_in_top_state, - .shutdown_dev = __cam_isp_shutdown_dev, }, .crm_ops = { .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, .config_dev = __cam_isp_ctx_config_dev_in_flushed, .release_hw = __cam_isp_ctx_release_hw_in_activated, - .shutdown_dev = __cam_isp_shutdown_dev, }, .crm_ops = { .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, .config_dev = __cam_isp_ctx_config_dev_in_top_state, .release_hw = __cam_isp_ctx_release_hw_in_activated, - .shutdown_dev = __cam_isp_shutdown_dev, }, .crm_ops = { .unlink = __cam_isp_ctx_unlink_in_activated, diff --git a/drivers/cam_isp/cam_isp_context.h b/drivers/cam_isp/cam_isp_context.h index c27f081bcc..fe28fc9227 100644 --- a/drivers/cam_isp/cam_isp_context.h +++ b/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); -/** - * 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__ */ diff --git a/drivers/cam_isp/cam_isp_dev.c b/drivers/cam_isp/cam_isp_dev.c index afd6c2d977..2ab976e221 100644 --- a/drivers/cam_isp/cam_isp_dev.c +++ b/drivers/cam_isp/cam_isp_dev.c @@ -55,7 +55,7 @@ static int cam_isp_subdev_open(struct v4l2_subdev *sd, 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) { int rc = 0; @@ -86,7 +86,7 @@ end: static int cam_isp_subdev_close(struct v4l2_subdev *sd, 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) { 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; } + node->sd_handler = cam_isp_subdev_close_internal; cam_smmu_set_client_page_fault_handler(iommu_hdl, cam_isp_dev_iommu_fault_handler, node); diff --git a/drivers/cam_jpeg/cam_jpeg_context.c b/drivers/cam_jpeg/cam_jpeg_context.c index 1bc4e54e28..6c72427517 100644 --- a/drivers/cam_jpeg/cam_jpeg_context.c +++ b/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; } -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 */ static struct cam_ctx_ops cam_jpeg_ctx_state_machine[CAM_CTX_STATE_MAX] = { @@ -154,7 +148,6 @@ static struct cam_ctx_ops { .ioctl_ops = { .acquire_dev = __cam_jpeg_ctx_acquire_dev_in_available, - .shutdown_dev = __cam_jpeg_shutdown_dev, }, .crm_ops = { }, .irq_ops = NULL, @@ -167,7 +160,6 @@ static struct cam_ctx_ops .stop_dev = __cam_jpeg_ctx_stop_dev_in_acquired, .flush_dev = __cam_jpeg_ctx_flush_dev_in_acquired, .dump_dev = __cam_jpeg_ctx_dump_dev_in_acquired, - .shutdown_dev = __cam_jpeg_shutdown_dev, }, .crm_ops = { }, .irq_ops = __cam_jpeg_ctx_handle_buf_done_in_acquired, @@ -175,21 +167,15 @@ static struct cam_ctx_ops }, /* Ready */ { - .ioctl_ops = { - .shutdown_dev = __cam_jpeg_shutdown_dev, - }, + .ioctl_ops = {}, }, /* Flushed */ { - .ioctl_ops = { - .shutdown_dev = __cam_jpeg_shutdown_dev, - }, + .ioctl_ops = {}, }, /* Activated */ { - .ioctl_ops = { - .shutdown_dev = __cam_jpeg_shutdown_dev, - }, + .ioctl_ops = {}, }, }; diff --git a/drivers/cam_jpeg/cam_jpeg_context.h b/drivers/cam_jpeg/cam_jpeg_context.h index d36bfb8bb1..86573553cc 100644 --- a/drivers/cam_jpeg/cam_jpeg_context.h +++ b/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); -/** - * 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__ */ diff --git a/drivers/cam_jpeg/cam_jpeg_dev.c b/drivers/cam_jpeg/cam_jpeg_dev.c index a47476a061..1cb0bf148c 100644 --- a/drivers/cam_jpeg/cam_jpeg_dev.c +++ b/drivers/cam_jpeg/cam_jpeg_dev.c @@ -56,7 +56,7 @@ static int cam_jpeg_subdev_open(struct v4l2_subdev *sd, 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) { int rc = 0; @@ -88,7 +88,7 @@ end: static int cam_jpeg_subdev_close(struct v4l2_subdev *sd, 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) { 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; } + node->sd_handler = cam_jpeg_subdev_close_internal; cam_smmu_set_client_page_fault_handler(iommu_hdl, cam_jpeg_dev_iommu_fault_handler, node); diff --git a/drivers/cam_lrme/cam_lrme_context.c b/drivers/cam_lrme/cam_lrme_context.c index a61ab4f914..3a11ff4ad8 100644 --- a/drivers/cam_lrme/cam_lrme_context.c +++ b/drivers/cam_lrme/cam_lrme_context.c @@ -172,12 +172,6 @@ static int __cam_lrme_ctx_handle_irq_in_activated(void *context, 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 */ static struct cam_ctx_ops cam_lrme_ctx_state_machine[CAM_CTX_STATE_MAX] = { @@ -191,7 +185,6 @@ static struct cam_ctx_ops { .ioctl_ops = { .acquire_dev = __cam_lrme_ctx_acquire_dev_in_available, - .shutdown_dev = __cam_lrme_shutdown_dev, }, .crm_ops = {}, .irq_ops = NULL, @@ -202,24 +195,19 @@ static struct cam_ctx_ops .config_dev = __cam_lrme_ctx_config_dev_in_activated, .release_dev = __cam_lrme_ctx_release_dev_in_acquired, .start_dev = __cam_lrme_ctx_start_dev_in_acquired, - .shutdown_dev = __cam_lrme_shutdown_dev, }, .crm_ops = {}, .irq_ops = NULL, }, /* Ready */ { - .ioctl_ops = { - .shutdown_dev = __cam_lrme_shutdown_dev, - }, + .ioctl_ops = {}, .crm_ops = {}, .irq_ops = NULL, }, /* Flushed */ { - .ioctl_ops = { - .shutdown_dev = __cam_lrme_shutdown_dev, - }, + .ioctl_ops = {}, }, /* Activate */ { @@ -229,7 +217,6 @@ static struct cam_ctx_ops .stop_dev = __cam_lrme_ctx_stop_dev_in_activated, .flush_dev = __cam_lrme_ctx_flush_dev_in_activated, .dump_dev = __cam_lrme_ctx_dump_dev_in_activated, - .shutdown_dev = __cam_lrme_shutdown_dev, }, .crm_ops = {}, .irq_ops = __cam_lrme_ctx_handle_irq_in_activated, diff --git a/drivers/cam_lrme/cam_lrme_context.h b/drivers/cam_lrme/cam_lrme_context.h index f1b5ff267f..6b67bf247f 100644 --- a/drivers/cam_lrme/cam_lrme_context.h +++ b/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); 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_ */ diff --git a/drivers/cam_lrme/cam_lrme_dev.c b/drivers/cam_lrme/cam_lrme_dev.c index 5055444c3d..3aa9fd8f57 100644 --- a/drivers/cam_lrme/cam_lrme_dev.c +++ b/drivers/cam_lrme/cam_lrme_dev.c @@ -72,7 +72,7 @@ static int cam_lrme_dev_open(struct v4l2_subdev *sd, 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) { int rc = 0; @@ -109,7 +109,7 @@ end: static int cam_lrme_dev_close(struct v4l2_subdev *sd, 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) { 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; } + node->sd_handler = cam_lrme_dev_close_internal; CAM_DBG(CAM_LRME, "Component bound successfully"); return 0; diff --git a/drivers/cam_ope/cam_ope_context.c b/drivers/cam_ope/cam_ope_context.c index 23f89dd2b0..6507b9156f 100644 --- a/drivers/cam_ope/cam_ope_context.c +++ b/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); } -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 cam_ope_ctx_state_machine[CAM_CTX_STATE_MAX] = { /* Uninit */ @@ -213,7 +207,6 @@ static struct cam_ctx_ops { .ioctl_ops = { .acquire_dev = __cam_ope_acquire_dev_in_available, - .shutdown_dev = __cam_ope_shutdown_dev, }, .crm_ops = {}, .irq_ops = NULL, @@ -226,7 +219,6 @@ static struct cam_ctx_ops .config_dev = __cam_ope_config_dev_in_ready, .flush_dev = __cam_ope_flush_dev_in_ready, .dump_dev = __cam_ope_dump_dev_in_ready, - .shutdown_dev = __cam_ope_shutdown_dev, }, .crm_ops = {}, .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, .flush_dev = __cam_ope_flush_dev_in_ready, .dump_dev = __cam_ope_dump_dev_in_ready, - .shutdown_dev = __cam_ope_shutdown_dev, }, .crm_ops = {}, .irq_ops = __cam_ope_handle_buf_done_in_ready, @@ -248,15 +239,11 @@ static struct cam_ctx_ops }, /* Flushed */ { - .ioctl_ops = { - .shutdown_dev = __cam_ope_shutdown_dev, - }, + .ioctl_ops = {}, }, /* Activated */ { - .ioctl_ops = { - .shutdown_dev = __cam_ope_shutdown_dev, - }, + .ioctl_ops = {}, .crm_ops = {}, .irq_ops = NULL, .pagefault_ops = cam_ope_context_dump_active_request, diff --git a/drivers/cam_ope/cam_ope_context.h b/drivers/cam_ope/cam_ope_context.h index 5e6d28c3ff..e79e0f3322 100644 --- a/drivers/cam_ope/cam_ope_context.h +++ b/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); -/** - * 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_ */ diff --git a/drivers/cam_ope/cam_ope_subdev.c b/drivers/cam_ope/cam_ope_subdev.c index a04abe3bcf..c2cc450d93 100644 --- a/drivers/cam_ope/cam_ope_subdev.c +++ b/drivers/cam_ope/cam_ope_subdev.c @@ -95,7 +95,7 @@ end: 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) { int rc = 0; @@ -137,7 +137,7 @@ end: static int cam_ope_subdev_close(struct v4l2_subdev *sd, 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) { 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; mutex_init(&g_ope_dev.ope_lock); + node->sd_handler = cam_ope_subdev_close_internal; CAM_DBG(CAM_OPE, "Subdev component bound successfully"); return rc; diff --git a/drivers/cam_req_mgr/cam_req_mgr_dev.c b/drivers/cam_req_mgr/cam_req_mgr_dev.c index b878cf8c5b..b8dc37a925 100644 --- a/drivers/cam_req_mgr/cam_req_mgr_dev.c +++ b/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); g_dev.open_cnt++; - g_dev.read_active_dev_id_hdls = 0; rc = cam_mem_mgr_init(); if (rc) { g_dev.open_cnt--; @@ -192,7 +191,6 @@ static int cam_req_mgr_close(struct file *filep) g_dev.open_cnt--; g_dev.shutdown_state = false; - g_dev.read_active_dev_id_hdls = 0; v4l2_fh_release(filep); spin_lock_bh(&g_dev.cam_eventq_lock); @@ -687,21 +685,12 @@ static int cam_req_mgr_ordered_list_cmp(void *priv, 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); 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); return crm_status; diff --git a/drivers/cam_req_mgr/cam_req_mgr_dev.h b/drivers/cam_req_mgr/cam_req_mgr_dev.h index 0a55789b7c..8b8755c835 100644 --- a/drivers/cam_req_mgr/cam_req_mgr_dev.h +++ b/drivers/cam_req_mgr/cam_req_mgr_dev.h @@ -20,8 +20,6 @@ * @cam_eventq: event queue * @cam_eventq_lock: lock for event queue * @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 video_device *video; @@ -34,8 +32,6 @@ struct cam_req_mgr_device { struct v4l2_fh *cam_eventq; spinlock_t cam_eventq_lock; bool shutdown_state; - uint64_t active_dev_id_hdls; - int read_active_dev_id_hdls; }; #define CAM_REQ_MGR_GET_PAYLOAD_PTR(ev, type) \ diff --git a/drivers/cam_req_mgr/cam_req_mgr_util.c b/drivers/cam_req_mgr/cam_req_mgr_util.c index ef79d38f2d..a627a1fb41 100644 --- a/drivers/cam_req_mgr/cam_req_mgr_util.c +++ b/drivers/cam_req_mgr/cam_req_mgr_util.c @@ -14,7 +14,6 @@ #include #include "cam_req_mgr_util.h" #include "cam_debug_util.h" -#include "cam_context.h" static struct cam_req_mgr_util_hdl_tbl *hdl_tbl; 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; } -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) { int idx; diff --git a/drivers/cam_req_mgr/cam_req_mgr_util.h b/drivers/cam_req_mgr/cam_req_mgr_util.h index 6656f1d1da..0d0fec1f8e 100644 --- a/drivers/cam_req_mgr/cam_req_mgr_util.h +++ b/drivers/cam_req_mgr/cam_req_mgr_util.h @@ -1,6 +1,6 @@ /* 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_ @@ -166,11 +166,4 @@ int32_t cam_req_mgr_util_deinit(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_ */ diff --git a/drivers/cam_req_mgr/cam_subdev.h b/drivers/cam_req_mgr/cam_subdev.h index c09203fa13..f4f09b815d 100644 --- a/drivers/cam_req_mgr/cam_subdev.h +++ b/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 * - * @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() diff --git a/drivers/cam_sensor_module/cam_actuator/cam_actuator_dev.c b/drivers/cam_sensor_module/cam_actuator/cam_actuator_dev.c index 17b310eee3..f99b542412 100644 --- a/drivers/cam_sensor_module/cam_actuator/cam_actuator_dev.c +++ b/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, 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) { CAM_DBG(CAM_ACTUATOR, diff --git a/drivers/cam_sensor_module/cam_csiphy/cam_csiphy_dev.c b/drivers/cam_sensor_module/cam_csiphy/cam_csiphy_dev.c index 58c8b32e7b..77be19c097 100644 --- a/drivers/cam_sensor_module/cam_csiphy/cam_csiphy_dev.c +++ b/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, 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) { CAM_DBG(CAM_CSIPHY, "CRM is ACTIVE, close should be from CRM"); diff --git a/drivers/cam_sensor_module/cam_eeprom/cam_eeprom_dev.c b/drivers/cam_sensor_module/cam_eeprom/cam_eeprom_dev.c index 00d695326b..42fca8e89b 100644 --- a/drivers/cam_sensor_module/cam_eeprom/cam_eeprom_dev.c +++ b/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, 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) { CAM_DBG(CAM_EEPROM, "CRM is ACTIVE, close should be from CRM"); diff --git a/drivers/cam_sensor_module/cam_flash/cam_flash_dev.c b/drivers/cam_sensor_module/cam_flash/cam_flash_dev.c index 471b788cc2..c6deab61ef 100644 --- a/drivers/cam_sensor_module/cam_flash/cam_flash_dev.c +++ b/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, 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) { CAM_DBG(CAM_FLASH, "CRM is ACTIVE, close should be from CRM"); diff --git a/drivers/cam_sensor_module/cam_ois/cam_ois_dev.c b/drivers/cam_sensor_module/cam_ois/cam_ois_dev.c index 5e44a91687..7fb5cd3851 100644 --- a/drivers/cam_sensor_module/cam_ois/cam_ois_dev.c +++ b/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, 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) { CAM_DBG(CAM_OIS, "CRM is ACTIVE, close should be from CRM"); diff --git a/drivers/cam_sensor_module/cam_sensor/cam_sensor_dev.c b/drivers/cam_sensor_module/cam_sensor/cam_sensor_dev.c index d4982ab231..7b9330809c 100644 --- a/drivers/cam_sensor_module/cam_sensor/cam_sensor_dev.c +++ b/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, 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) { CAM_DBG(CAM_SENSOR, "CRM is ACTIVE, close should be from CRM");