Loading drivers/cam_cdm/cam_cdm_hw_core.c +7 −8 Original line number Diff line number Diff line Loading @@ -586,13 +586,9 @@ int cam_hw_cdm_wait_for_bl_fifo( pending_bl); break; } if (bl_count < (available_bl_slots - 1)) { CAM_DBG(CAM_CDM, "BL slot available_cnt=%d requested=%d", (available_bl_slots - 1), bl_count); rc = available_bl_slots - 1; break; } else if (0 == (available_bl_slots - 1)) { if (0 == (available_bl_slots - 1)) { reinit_completion(&core->bl_fifo[fifo_idx].bl_complete); rc = cam_hw_cdm_enable_bl_done_irq(cdm_hw, true, fifo_idx); if (rc) { Loading @@ -619,7 +615,10 @@ int cam_hw_cdm_wait_for_bl_fifo( rc = 1; CAM_DBG(CAM_CDM, "CDM HW is ready for data"); } else { rc = (bl_count - (available_bl_slots - 1)); CAM_DBG(CAM_CDM, "BL slot available_cnt=%d requested=%d", (available_bl_slots - 1), bl_count); rc = available_bl_slots - 1; break; } } while (1); Loading drivers/cam_core/cam_context.c +25 −0 Original line number Diff line number Diff line Loading @@ -311,6 +311,31 @@ int cam_context_dump_pf_info(struct cam_context *ctx, return rc; } int cam_context_handle_message(struct cam_context *ctx, uint32_t msg_type, uint32_t *data) { int rc = 0; if (!ctx->state_machine) { CAM_ERR(CAM_CORE, "Context is not ready"); return -EINVAL; } if ((ctx->state > CAM_CTX_AVAILABLE) && (ctx->state < CAM_CTX_STATE_MAX)) { if (ctx->state_machine[ctx->state].msg_cb_ops) { rc = ctx->state_machine[ctx->state].msg_cb_ops( ctx, msg_type, data); } else { CAM_WARN(CAM_CORE, "No message handler for ctx %d, state %d msg_type :%d", ctx->dev_hdl, ctx->state, msg_type); } } return rc; } int cam_context_handle_acquire_dev(struct cam_context *ctx, struct cam_acquire_dev_cmd *cmd) { Loading drivers/cam_core/cam_context.h +21 −5 Original line number Diff line number Diff line Loading @@ -158,6 +158,8 @@ struct cam_ctx_crm_ops { * @pagefault_ops: Function to be called on page fault * @dumpinfo_ops: Function to be invoked for dumping any * context info * @msg_cb_ops: Function to be called on any message from * other subdev notifications * */ struct cam_ctx_ops { Loading @@ -166,6 +168,7 @@ struct cam_ctx_ops { cam_hw_event_cb_func irq_ops; cam_hw_pagefault_cb_func pagefault_ops; cam_ctx_info_dump_cb_func dumpinfo_ops; cam_ctx_message_cb_func msg_cb_ops; }; /** Loading Loading @@ -367,6 +370,19 @@ int cam_context_handle_crm_dump_req(struct cam_context *ctx, int cam_context_dump_pf_info(struct cam_context *ctx, struct cam_smmu_pf_info *pf_info); /** * cam_context_handle_message() * * @brief: Handle message callback command * * @ctx: Object pointer for cam_context * @msg_type: message type sent from other subdev * @data: data from other subdev * */ int cam_context_handle_message(struct cam_context *ctx, uint32_t msg_type, uint32_t *data); /** * cam_context_handle_acquire_dev() * Loading drivers/cam_core/cam_hw_mgr_intf.h +3 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,9 @@ typedef int (*cam_hw_pagefault_cb_func)(void *context, typedef int (*cam_ctx_info_dump_cb_func)(void *context, enum cam_context_dump_id dump_id); /* message callback function type */ typedef int (*cam_ctx_message_cb_func)(void *context, uint32_t message_type, uint32_t *data); /** * struct cam_hw_update_entry - Entry for hardware config * Loading drivers/cam_cpas/cam_cpas_hw.c +26 −0 Original line number Diff line number Diff line Loading @@ -1544,6 +1544,7 @@ static int cam_cpas_hw_stop(void *hw_priv, void *stop_args, struct cam_cpas_private_soc *soc_private = NULL; int rc = 0; long result; int retry_camnoc_idle = 0; if (!hw_priv || !stop_args) { CAM_ERR(CAM_CPAS, "Invalid arguments %pK %pK", Loading Loading @@ -1597,6 +1598,18 @@ static int cam_cpas_hw_stop(void *hw_priv, void *stop_args, } } if (cpas_core->internal_ops.qchannel_handshake) { rc = cpas_core->internal_ops.qchannel_handshake( cpas_hw, false); if (rc) { CAM_ERR(CAM_CPAS, "failed in qchannel_handshake rc=%d", rc); retry_camnoc_idle = 1; /* Do not return error, passthrough */ } } rc = cam_cpas_soc_disable_irq(&cpas_hw->soc_info); if (rc) { CAM_ERR(CAM_CPAS, "disable_irq failed, rc=%d", rc); Loading @@ -1612,6 +1625,19 @@ static int cam_cpas_hw_stop(void *hw_priv, void *stop_args, atomic_read(&cpas_core->irq_count)); } /* try again incase camnoc is still not idle */ if (cpas_core->internal_ops.qchannel_handshake && retry_camnoc_idle) { rc = cpas_core->internal_ops.qchannel_handshake( cpas_hw, false); if (rc) { CAM_ERR(CAM_CPAS, "failed in qchannel_handshake rc=%d", rc); /* Do not return error, passthrough */ } } rc = cam_cpas_soc_disable_resources(&cpas_hw->soc_info, true, false); if (rc) { Loading Loading
drivers/cam_cdm/cam_cdm_hw_core.c +7 −8 Original line number Diff line number Diff line Loading @@ -586,13 +586,9 @@ int cam_hw_cdm_wait_for_bl_fifo( pending_bl); break; } if (bl_count < (available_bl_slots - 1)) { CAM_DBG(CAM_CDM, "BL slot available_cnt=%d requested=%d", (available_bl_slots - 1), bl_count); rc = available_bl_slots - 1; break; } else if (0 == (available_bl_slots - 1)) { if (0 == (available_bl_slots - 1)) { reinit_completion(&core->bl_fifo[fifo_idx].bl_complete); rc = cam_hw_cdm_enable_bl_done_irq(cdm_hw, true, fifo_idx); if (rc) { Loading @@ -619,7 +615,10 @@ int cam_hw_cdm_wait_for_bl_fifo( rc = 1; CAM_DBG(CAM_CDM, "CDM HW is ready for data"); } else { rc = (bl_count - (available_bl_slots - 1)); CAM_DBG(CAM_CDM, "BL slot available_cnt=%d requested=%d", (available_bl_slots - 1), bl_count); rc = available_bl_slots - 1; break; } } while (1); Loading
drivers/cam_core/cam_context.c +25 −0 Original line number Diff line number Diff line Loading @@ -311,6 +311,31 @@ int cam_context_dump_pf_info(struct cam_context *ctx, return rc; } int cam_context_handle_message(struct cam_context *ctx, uint32_t msg_type, uint32_t *data) { int rc = 0; if (!ctx->state_machine) { CAM_ERR(CAM_CORE, "Context is not ready"); return -EINVAL; } if ((ctx->state > CAM_CTX_AVAILABLE) && (ctx->state < CAM_CTX_STATE_MAX)) { if (ctx->state_machine[ctx->state].msg_cb_ops) { rc = ctx->state_machine[ctx->state].msg_cb_ops( ctx, msg_type, data); } else { CAM_WARN(CAM_CORE, "No message handler for ctx %d, state %d msg_type :%d", ctx->dev_hdl, ctx->state, msg_type); } } return rc; } int cam_context_handle_acquire_dev(struct cam_context *ctx, struct cam_acquire_dev_cmd *cmd) { Loading
drivers/cam_core/cam_context.h +21 −5 Original line number Diff line number Diff line Loading @@ -158,6 +158,8 @@ struct cam_ctx_crm_ops { * @pagefault_ops: Function to be called on page fault * @dumpinfo_ops: Function to be invoked for dumping any * context info * @msg_cb_ops: Function to be called on any message from * other subdev notifications * */ struct cam_ctx_ops { Loading @@ -166,6 +168,7 @@ struct cam_ctx_ops { cam_hw_event_cb_func irq_ops; cam_hw_pagefault_cb_func pagefault_ops; cam_ctx_info_dump_cb_func dumpinfo_ops; cam_ctx_message_cb_func msg_cb_ops; }; /** Loading Loading @@ -367,6 +370,19 @@ int cam_context_handle_crm_dump_req(struct cam_context *ctx, int cam_context_dump_pf_info(struct cam_context *ctx, struct cam_smmu_pf_info *pf_info); /** * cam_context_handle_message() * * @brief: Handle message callback command * * @ctx: Object pointer for cam_context * @msg_type: message type sent from other subdev * @data: data from other subdev * */ int cam_context_handle_message(struct cam_context *ctx, uint32_t msg_type, uint32_t *data); /** * cam_context_handle_acquire_dev() * Loading
drivers/cam_core/cam_hw_mgr_intf.h +3 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,9 @@ typedef int (*cam_hw_pagefault_cb_func)(void *context, typedef int (*cam_ctx_info_dump_cb_func)(void *context, enum cam_context_dump_id dump_id); /* message callback function type */ typedef int (*cam_ctx_message_cb_func)(void *context, uint32_t message_type, uint32_t *data); /** * struct cam_hw_update_entry - Entry for hardware config * Loading
drivers/cam_cpas/cam_cpas_hw.c +26 −0 Original line number Diff line number Diff line Loading @@ -1544,6 +1544,7 @@ static int cam_cpas_hw_stop(void *hw_priv, void *stop_args, struct cam_cpas_private_soc *soc_private = NULL; int rc = 0; long result; int retry_camnoc_idle = 0; if (!hw_priv || !stop_args) { CAM_ERR(CAM_CPAS, "Invalid arguments %pK %pK", Loading Loading @@ -1597,6 +1598,18 @@ static int cam_cpas_hw_stop(void *hw_priv, void *stop_args, } } if (cpas_core->internal_ops.qchannel_handshake) { rc = cpas_core->internal_ops.qchannel_handshake( cpas_hw, false); if (rc) { CAM_ERR(CAM_CPAS, "failed in qchannel_handshake rc=%d", rc); retry_camnoc_idle = 1; /* Do not return error, passthrough */ } } rc = cam_cpas_soc_disable_irq(&cpas_hw->soc_info); if (rc) { CAM_ERR(CAM_CPAS, "disable_irq failed, rc=%d", rc); Loading @@ -1612,6 +1625,19 @@ static int cam_cpas_hw_stop(void *hw_priv, void *stop_args, atomic_read(&cpas_core->irq_count)); } /* try again incase camnoc is still not idle */ if (cpas_core->internal_ops.qchannel_handshake && retry_camnoc_idle) { rc = cpas_core->internal_ops.qchannel_handshake( cpas_hw, false); if (rc) { CAM_ERR(CAM_CPAS, "failed in qchannel_handshake rc=%d", rc); /* Do not return error, passthrough */ } } rc = cam_cpas_soc_disable_resources(&cpas_hw->soc_info, true, false); if (rc) { Loading