|
@@ -23,6 +23,7 @@
|
|
#include "cam_req_mgr_debug.h"
|
|
#include "cam_req_mgr_debug.h"
|
|
#include "cam_cpas_api.h"
|
|
#include "cam_cpas_api.h"
|
|
#include "cam_ife_hw_mgr.h"
|
|
#include "cam_ife_hw_mgr.h"
|
|
|
|
+#include "cam_subdev.h"
|
|
|
|
|
|
static const char isp_dev_name[] = "cam-isp";
|
|
static const char isp_dev_name[] = "cam-isp";
|
|
|
|
|
|
@@ -36,6 +37,8 @@ static int cam_isp_context_dump_requests(void *data,
|
|
void *pf_args);
|
|
void *pf_args);
|
|
|
|
|
|
static int cam_isp_context_hw_recovery(void *priv, void *data);
|
|
static int cam_isp_context_hw_recovery(void *priv, void *data);
|
|
|
|
+static int cam_isp_context_handle_message(void *context,
|
|
|
|
+ uint32_t msg_type, void *data);
|
|
|
|
|
|
static int __cam_isp_ctx_start_dev_in_ready(struct cam_context *ctx,
|
|
static int __cam_isp_ctx_start_dev_in_ready(struct cam_context *ctx,
|
|
struct cam_start_stop_dev_cmd *cmd);
|
|
struct cam_start_stop_dev_cmd *cmd);
|
|
@@ -8858,6 +8861,7 @@ static struct cam_ctx_ops
|
|
.pagefault_ops = cam_isp_context_dump_requests,
|
|
.pagefault_ops = cam_isp_context_dump_requests,
|
|
.dumpinfo_ops = cam_isp_context_info_dump,
|
|
.dumpinfo_ops = cam_isp_context_info_dump,
|
|
.evt_inject_ops = cam_isp_context_inject_evt,
|
|
.evt_inject_ops = cam_isp_context_inject_evt,
|
|
|
|
+ .msg_cb_ops = cam_isp_context_handle_message,
|
|
},
|
|
},
|
|
/* Activated */
|
|
/* Activated */
|
|
{
|
|
{
|
|
@@ -8882,6 +8886,7 @@ static struct cam_ctx_ops
|
|
.dumpinfo_ops = cam_isp_context_info_dump,
|
|
.dumpinfo_ops = cam_isp_context_info_dump,
|
|
.recovery_ops = cam_isp_context_hw_recovery,
|
|
.recovery_ops = cam_isp_context_hw_recovery,
|
|
.evt_inject_ops = cam_isp_context_inject_evt,
|
|
.evt_inject_ops = cam_isp_context_inject_evt,
|
|
|
|
+ .msg_cb_ops = cam_isp_context_handle_message,
|
|
},
|
|
},
|
|
};
|
|
};
|
|
|
|
|
|
@@ -9009,6 +9014,34 @@ end:
|
|
return rc;
|
|
return rc;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static int cam_isp_context_handle_message(void *context,
|
|
|
|
+ uint32_t msg_type, void *data)
|
|
|
|
+{
|
|
|
|
+ int rc = -EINVAL;
|
|
|
|
+ struct cam_hw_cmd_args hw_cmd_args = {0};
|
|
|
|
+ struct cam_isp_hw_cmd_args isp_hw_cmd_args = {0};
|
|
|
|
+ struct cam_context *ctx = (struct cam_context *)context;
|
|
|
|
+
|
|
|
|
+ hw_cmd_args.ctxt_to_hw_map = ctx->ctxt_to_hw_map;
|
|
|
|
+
|
|
|
|
+ switch (msg_type) {
|
|
|
|
+ case CAM_SUBDEV_MESSAGE_CLOCK_UPDATE:
|
|
|
|
+ hw_cmd_args.cmd_type = CAM_HW_MGR_CMD_INTERNAL;
|
|
|
|
+ isp_hw_cmd_args.cmd_type = CAM_ISP_HW_MGR_CMD_UPDATE_CLOCK;
|
|
|
|
+ isp_hw_cmd_args.cmd_data = data;
|
|
|
|
+ hw_cmd_args.u.internal_args = (void *)&isp_hw_cmd_args;
|
|
|
|
+ rc = ctx->hw_mgr_intf->hw_cmd(ctx->hw_mgr_intf->hw_mgr_priv,
|
|
|
|
+ &hw_cmd_args);
|
|
|
|
+
|
|
|
|
+ if (rc)
|
|
|
|
+ CAM_ERR(CAM_ISP, "Update clock rate failed rc: %d", rc);
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ CAM_ERR(CAM_ISP, "Invalid message type %d", msg_type);
|
|
|
|
+ }
|
|
|
|
+ return rc;
|
|
|
|
+}
|
|
|
|
+
|
|
static int cam_isp_context_debug_register(void)
|
|
static int cam_isp_context_debug_register(void)
|
|
{
|
|
{
|
|
int rc = 0;
|
|
int rc = 0;
|