aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2019-08-28 05:56:31 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2019-08-28 05:56:34 -0700
commit329d5e0cd9c042234a34f5c92efd2ef1de949ec7 (patch)
treeffb60323edcf07a1240b927f49cb4cf609d1d7ac
parent02dfa45c012329bc91bb13f908d08ca531d2d37f (diff)
parentca27068e2ced881d9f7d28a385d7a5f7ab5133ab (diff)
Merge "Revert "msm: ais: fastforward to PC398"" into LV.AU.0.0.1_rb1.11LV.AU.0.0.1-13110-gen3meta.0LV.AU.0.0.1-13010-gen3meta.0
-rw-r--r--drivers/media/platform/msm/ais/cam_core/cam_context_utils.c21
-rw-r--r--drivers/media/platform/msm/ais/cam_cpas/cam_cpas_hw.c29
-rw-r--r--drivers/media/platform/msm/ais/cam_cpas/cpas_top/cam_cpastop_hw.c7
-rw-r--r--drivers/media/platform/msm/ais/cam_fd/fd_hw_mgr/fd_hw/cam_fd_hw_dev.c6
-rw-r--r--drivers/media/platform/msm/ais/cam_icp/fw_inc/hfi_sys_defs.h23
-rw-r--r--drivers/media/platform/msm/ais/cam_icp/icp_hw/a5_hw/a5_core.c6
-rw-r--r--drivers/media/platform/msm/ais/cam_icp/icp_hw/bps_hw/bps_core.c6
-rw-r--r--drivers/media/platform/msm/ais/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c111
-rw-r--r--drivers/media/platform/msm/ais/cam_icp/icp_hw/ipe_hw/ipe_core.c6
-rw-r--r--drivers/media/platform/msm/ais/cam_isp/cam_isp_context.c372
-rw-r--r--drivers/media/platform/msm/ais/cam_isp/cam_isp_context.h62
-rw-r--r--drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c147
-rw-r--r--drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/hw_utils/cam_isp_packet_parser.c33
-rw-r--r--drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.c297
-rw-r--r--drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.h17
-rw-r--r--drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/isp_hw/include/cam_ife_csid_hw_intf.h3
-rw-r--r--drivers/media/platform/msm/ais/cam_jpeg/jpeg_hw/cam_jpeg_hw_mgr.c7
-rw-r--r--drivers/media/platform/msm/ais/cam_jpeg/jpeg_hw/jpeg_enc_hw/jpeg_enc_core.c33
-rw-r--r--drivers/media/platform/msm/ais/cam_req_mgr/cam_mem_mgr.c66
-rw-r--r--drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_core.c450
-rw-r--r--drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_core.h19
-rw-r--r--drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_dev.c35
-rw-r--r--drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_interface.h4
-rw-r--r--drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_util.c20
-rw-r--r--drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_util.h4
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/Makefile1
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/cam_actuator/cam_actuator_core.c2
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_core.c14
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_dev.c58
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_dev.h71
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_hwreg.h8
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_soc.c16
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/cam_csiphy/cam_csiphy_core.c22
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/cam_csiphy/cam_csiphy_soc.c5
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/cam_csiphy/include/cam_csiphy_1_2_hwreg.h32
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/cam_csiphy/include/cam_csiphy_2_0_hwreg.h44
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/cam_eeprom/cam_eeprom_core.c2
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/cam_eeprom/cam_eeprom_dev.h2
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/cam_flash/cam_flash_dev.c2
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/Makefile10
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/cam_ir_led_core.c54
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/cam_ir_led_core.h20
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/cam_ir_led_dev.c583
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/cam_ir_led_dev.h164
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/cam_ir_led_soc.c57
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/cam_ir_led_soc.h21
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/cam_ois/cam_ois_core.c2
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/cam_sensor/cam_sensor_core.c14
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/cam_sensor/cam_sensor_soc.c17
-rw-r--r--drivers/media/platform/msm/ais/cam_sensor_module/cam_sensor_utils/cam_sensor_cmn_header.h1
-rw-r--r--drivers/media/platform/msm/ais/cam_smmu/cam_smmu_api.c2
-rw-r--r--drivers/media/platform/msm/ais/cam_sync/cam_sync.c32
-rw-r--r--drivers/media/platform/msm/ais/cam_sync/cam_sync_api.h11
-rw-r--r--drivers/media/platform/msm/ais/cam_utils/cam_debug_util.c5
-rw-r--r--drivers/media/platform/msm/ais/cam_utils/cam_debug_util.h1
-rw-r--r--drivers/media/platform/msm/ais/cam_utils/cam_packet_util.c164
-rw-r--r--drivers/media/platform/msm/ais/cam_utils/cam_packet_util.h16
-rw-r--r--drivers/media/platform/msm/ais/cam_utils/cam_soc_util.c12
-rw-r--r--drivers/media/platform/msm/ais/cam_utils/cam_soc_util.h2
59 files changed, 441 insertions, 2810 deletions
diff --git a/drivers/media/platform/msm/ais/cam_core/cam_context_utils.c b/drivers/media/platform/msm/ais/cam_core/cam_context_utils.c
index 50c2d8d84b24..f79af9b0c71f 100644
--- a/drivers/media/platform/msm/ais/cam_core/cam_context_utils.c
+++ b/drivers/media/platform/msm/ais/cam_core/cam_context_utils.c
@@ -460,17 +460,6 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx,
ctx->dev_name, ctx->ctx_id, req->request_id);
for (j = 0; j < req->num_in_map_entries; j++) {
- rc = cam_sync_check_valid(
- req->in_map_entries[j].sync_id);
- if (rc) {
- CAM_ERR(CAM_CTXT,
- "invalid in map sync object %d",
- req->in_map_entries[j].sync_id);
- goto put_ref;
- }
- }
-
- for (j = 0; j < req->num_in_map_entries; j++) {
cam_context_getref(ctx);
rc = cam_sync_register_callback(
cam_context_sync_callback,
@@ -491,9 +480,7 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx,
ctx->dev_name, ctx->ctx_id,
req->request_id);
- cam_context_putref(ctx);
- goto put_ref;
-
+ goto put_ctx_ref;
}
CAM_DBG(CAM_CTXT, "register in fence cb: %d ret = %d",
req->in_map_entries[j].sync_id, rc);
@@ -505,7 +492,9 @@ int32_t cam_context_prepare_dev_to_hw(struct cam_context *ctx,
ctx->dev_name, ctx->ctx_id);
return rc;
-
+put_ctx_ref:
+ for (j; j >= 0; j--)
+ cam_context_putref(ctx);
put_ref:
for (--i; i >= 0; i--) {
if (cam_sync_put_obj_ref(req->out_map_entries[i].sync_id))
@@ -589,7 +578,7 @@ int32_t cam_context_acquire_dev_to_hw(struct cam_context *ctx,
req_hdl_param.media_entity_flag = 0;
req_hdl_param.priv = ctx;
req_hdl_param.ops = ctx->crm_ctx_intf;
- req_hdl_param.dev_id = ctx->dev_id;
+
ctx->dev_hdl = cam_create_device_hdl(&req_hdl_param);
if (ctx->dev_hdl <= 0) {
rc = -EFAULT;
diff --git a/drivers/media/platform/msm/ais/cam_cpas/cam_cpas_hw.c b/drivers/media/platform/msm/ais/cam_cpas/cam_cpas_hw.c
index a68e20745b1a..a05901afba71 100644
--- a/drivers/media/platform/msm/ais/cam_cpas/cam_cpas_hw.c
+++ b/drivers/media/platform/msm/ais/cam_cpas/cam_cpas_hw.c
@@ -568,7 +568,7 @@ static int cam_cpas_util_set_camnoc_axi_clk_rate(
struct cam_cpas_axi_port *curr_axi_port = NULL;
struct cam_cpas_axi_port *temp_axi_port = NULL;
uint64_t required_camnoc_bw = 0;
- int64_t clk_rate = 0;
+ int32_t clk_rate = 0;
list_for_each_entry_safe(curr_axi_port, temp_axi_port,
&cpas_core->axi_ports_list_head, sibling_port) {
@@ -596,13 +596,13 @@ static int cam_cpas_util_set_camnoc_axi_clk_rate(
clk_rate = required_camnoc_bw / soc_private->camnoc_bus_width;
- CAM_DBG(CAM_CPAS, "Setting camnoc axi clk rate : %llu %lld",
+ CAM_DBG(CAM_CPAS, "Setting camnoc axi clk rate : %llu %d",
required_camnoc_bw, clk_rate);
rc = cam_soc_util_set_src_clk_rate(soc_info, clk_rate);
if (rc)
CAM_ERR(CAM_CPAS,
- "Failed in setting camnoc axi clk %llu %lld %d",
+ "Failed in setting camnoc axi clk %llu %d %d",
required_camnoc_bw, clk_rate, rc);
}
@@ -980,10 +980,8 @@ static int cam_cpas_hw_start(void *hw_priv, void *start_args,
return -EINVAL;
}
- if (!CAM_CPAS_CLIENT_VALID(client_indx)) {
- CAM_ERR(CAM_CPAS, "Client index invalid %d", client_indx);
+ if (!CAM_CPAS_CLIENT_VALID(client_indx))
return -EINVAL;
- }
mutex_lock(&cpas_hw->hw_mutex);
mutex_lock(&cpas_core->client_mutex[client_indx]);
@@ -1101,10 +1099,8 @@ static int cam_cpas_hw_stop(void *hw_priv, void *stop_args,
cmd_hw_stop = (struct cam_cpas_hw_cmd_stop *)stop_args;
client_indx = CAM_CPAS_GET_CLIENT_IDX(cmd_hw_stop->client_handle);
- if (!CAM_CPAS_CLIENT_VALID(client_indx)) {
- CAM_ERR(CAM_CPAS, "Client index invalid %d", client_indx);
+ if (!CAM_CPAS_CLIENT_VALID(client_indx))
return -EINVAL;
- }
mutex_lock(&cpas_hw->hw_mutex);
mutex_lock(&cpas_core->client_mutex[client_indx]);
@@ -1166,20 +1162,14 @@ static int cam_cpas_hw_stop(void *hw_priv, void *stop_args,
ahb_vote.vote.level = CAM_SUSPEND_VOTE;
rc = cam_cpas_util_apply_client_ahb_vote(cpas_hw, cpas_client,
&ahb_vote, NULL);
- if (rc) {
- CAM_ERR(CAM_CPAS, "ahb vote failed for %s rc %d",
- cpas_client->data.identifier, rc);
+ if (rc)
goto done;
- }
axi_vote.uncompressed_bw = 0;
axi_vote.compressed_bw = 0;
axi_vote.compressed_bw_ab = 0;
rc = cam_cpas_util_apply_client_axi_vote(cpas_hw,
cpas_client, &axi_vote);
- if (rc)
- CAM_ERR(CAM_CPAS, "axi vote failed for %s rc %d",
- cpas_client->data.identifier, rc);
done:
mutex_unlock(&cpas_core->client_mutex[client_indx]);
@@ -1244,13 +1234,6 @@ static int cam_cpas_hw_register_client(struct cam_hw_info *cpas_hw,
rc = cam_common_util_get_string_index(soc_private->client_name,
soc_private->num_clients, client_name, &client_indx);
- if (rc) {
- CAM_ERR(CAM_CPAS, "No match found for client %s",
- client_name);
- mutex_unlock(&cpas_hw->hw_mutex);
- return rc;
- }
-
mutex_lock(&cpas_core->client_mutex[client_indx]);
if (rc || !CAM_CPAS_CLIENT_VALID(client_indx) ||
diff --git a/drivers/media/platform/msm/ais/cam_cpas/cpas_top/cam_cpastop_hw.c b/drivers/media/platform/msm/ais/cam_cpas/cpas_top/cam_cpastop_hw.c
index 205c0e76a69a..eea4654e4615 100644
--- a/drivers/media/platform/msm/ais/cam_cpas/cpas_top/cam_cpastop_hw.c
+++ b/drivers/media/platform/msm/ais/cam_cpas/cpas_top/cam_cpastop_hw.c
@@ -410,12 +410,6 @@ static void cam_cpastop_work(struct work_struct *work)
return;
}
- mutex_lock(&cpas_hw->hw_mutex);
- if (cpas_hw->hw_state == CAM_HW_STATE_POWER_DOWN) {
- CAM_ERR(CAM_CPAS, "CPAS CORE is off");
- mutex_unlock(&cpas_hw->hw_mutex);
- return;
- }
for (i = 0; i < camnoc_info->irq_err_size; i++) {
if ((payload->irq_status & camnoc_info->irq_err[i].sbm_port) &&
(camnoc_info->irq_err[i].enable)) {
@@ -461,7 +455,6 @@ static void cam_cpastop_work(struct work_struct *work)
~camnoc_info->irq_err[i].sbm_port;
}
}
- mutex_unlock(&cpas_hw->hw_mutex);
atomic_dec(&cpas_core->irq_count);
wake_up(&cpas_core->irq_count_wq);
CAM_DBG(CAM_CPAS, "irq_count=%d\n", atomic_read(&cpas_core->irq_count));
diff --git a/drivers/media/platform/msm/ais/cam_fd/fd_hw_mgr/fd_hw/cam_fd_hw_dev.c b/drivers/media/platform/msm/ais/cam_fd/fd_hw_mgr/fd_hw/cam_fd_hw_dev.c
index 083041c21dff..8a84c0ee7e99 100644
--- a/drivers/media/platform/msm/ais/cam_fd/fd_hw_mgr/fd_hw/cam_fd_hw_dev.c
+++ b/drivers/media/platform/msm/ais/cam_fd/fd_hw_mgr/fd_hw/cam_fd_hw_dev.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -206,6 +206,10 @@ static const struct of_device_id cam_fd_hw_dt_match[] = {
.compatible = "qcom,fd501",
.data = &cam_fd_wrapper200_core501_info,
},
+ {
+ .compatible = "qcom,fd501",
+ .data = &cam_fd_wrapper200_core501_info,
+ },
{}
};
MODULE_DEVICE_TABLE(of, cam_fd_hw_dt_match);
diff --git a/drivers/media/platform/msm/ais/cam_icp/fw_inc/hfi_sys_defs.h b/drivers/media/platform/msm/ais/cam_icp/fw_inc/hfi_sys_defs.h
index d60a25e8b925..311886ffd6da 100644
--- a/drivers/media/platform/msm/ais/cam_icp/fw_inc/hfi_sys_defs.h
+++ b/drivers/media/platform/msm/ais/cam_icp/fw_inc/hfi_sys_defs.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -215,27 +215,6 @@
#define HFI_DEV_VERSION_MAX 0x5
-/* General errors and HFI Specific errors. */
-enum hfi_errors {
- CAMERAICP_SUCCESS,
- CAMERAICP_EFAILED,
- CAMERAICP_ENOMEMORY,
- CAMERAICP_EBADSTATE,
- CAMERAICP_EBADPARM,
- CAMERAICP_EBADITEM,
- CAMERAICP_EINVALIDFORMAT,
- CAMERAICP_EUNSUPPORTED,
- CAMERAICP_EOUTOFBOUND,
- CAMERAICP_ETIMEDOUT,
- CAMERAICP_EABORTED,
- CAMERAICP_EHWVIOLATION,
- CAMERAICP_ECDMERROR,
- CAMERAICP_HFI_ERR_COMMAND_SIZE = 1000,
- CAMERAICP_HFI_ERR_MESSAGE_SIZE,
- CAMERAICP_HFI_QUEUE_EMPTY,
- CAMERAICP_HFI_QUEUE_FULL,
-};
-
/**
* start of sys command packet types
* These commands are used to get system level information
diff --git a/drivers/media/platform/msm/ais/cam_icp/icp_hw/a5_hw/a5_core.c b/drivers/media/platform/msm/ais/cam_icp/icp_hw/a5_hw/a5_core.c
index 4dbc8f1bd991..e13d7f2edcee 100644
--- a/drivers/media/platform/msm/ais/cam_icp/icp_hw/a5_hw/a5_core.c
+++ b/drivers/media/platform/msm/ais/cam_icp/icp_hw/a5_hw/a5_core.c
@@ -464,11 +464,7 @@ int cam_a5_process_cmd(void *device_priv, uint32_t cmd_type,
case CAM_ICP_A5_CMD_CPAS_STOP:
if (core_info->cpas_start) {
- rc = cam_cpas_stop(core_info->cpas_handle);
- if (rc) {
- CAM_ERR(CAM_ICP, "cpas stop failed %d", rc);
- return rc;
- }
+ cam_cpas_stop(core_info->cpas_handle);
core_info->cpas_start = false;
}
break;
diff --git a/drivers/media/platform/msm/ais/cam_icp/icp_hw/bps_hw/bps_core.c b/drivers/media/platform/msm/ais/cam_icp/icp_hw/bps_hw/bps_core.c
index f522f7138765..c94276ce8778 100644
--- a/drivers/media/platform/msm/ais/cam_icp/icp_hw/bps_hw/bps_core.c
+++ b/drivers/media/platform/msm/ais/cam_icp/icp_hw/bps_hw/bps_core.c
@@ -347,11 +347,7 @@ int cam_bps_process_cmd(void *device_priv, uint32_t cmd_type,
case CAM_ICP_BPS_CMD_CPAS_STOP:
if (core_info->cpas_start) {
- rc = cam_cpas_stop(core_info->cpas_handle);
- if (rc) {
- CAM_ERR(CAM_ICP, "cpas stop failed %d", rc);
- return rc;
- }
+ cam_cpas_stop(core_info->cpas_handle);
core_info->cpas_start = false;
}
break;
diff --git a/drivers/media/platform/msm/ais/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c b/drivers/media/platform/msm/ais/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c
index 25d17c957c4c..4ffb3aa052ed 100644
--- a/drivers/media/platform/msm/ais/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c
+++ b/drivers/media/platform/msm/ais/cam_icp/icp_hw/icp_hw_mgr/cam_icp_hw_mgr.c
@@ -1601,69 +1601,7 @@ static int cam_icp_mgr_handle_frame_process(uint32_t *msg_ptr, int flag)
return 0;
}
-static const char *cam_icp_error_handle_id_to_type(
- uint32_t error_handle)
-{
- const char *name = NULL;
- switch (error_handle) {
- case CAMERAICP_SUCCESS:
- name = "SUCCESS";
- break;
- case CAMERAICP_EFAILED:
- name = "EFAILED";
- break;
- case CAMERAICP_ENOMEMORY:
- name = "ENOMEMORY";
- break;
- case CAMERAICP_EBADSTATE:
- name = "EBADSTATE";
- break;
- case CAMERAICP_EBADPARM:
- name = "EBADPARM";
- break;
- case CAMERAICP_EBADITEM:
- name = "EBADITEM";
- break;
- case CAMERAICP_EINVALIDFORMAT:
- name = "EINVALIDFORMAT";
- break;
- case CAMERAICP_EUNSUPPORTED:
- name = "EUNSUPPORTED";
- break;
- case CAMERAICP_EOUTOFBOUND:
- name = "EOUTOFBOUND";
- break;
- case CAMERAICP_ETIMEDOUT:
- name = "ETIMEDOUT";
- break;
- case CAMERAICP_EABORTED:
- name = "EABORTED";
- break;
- case CAMERAICP_EHWVIOLATION:
- name = "EHWVIOLATION";
- break;
- case CAMERAICP_ECDMERROR:
- name = "ECDMERROR";
- break;
- case CAMERAICP_HFI_ERR_COMMAND_SIZE:
- name = "HFI_ERR_COMMAND_SIZE";
- break;
- case CAMERAICP_HFI_ERR_MESSAGE_SIZE:
- name = "HFI_ERR_MESSAGE_SIZE";
- break;
- case CAMERAICP_HFI_QUEUE_EMPTY:
- name = "HFI_QUEUE_EMPTY";
- break;
- case CAMERAICP_HFI_QUEUE_FULL:
- name = "HFI_QUEUE_FULL";
- break;
- default:
- name = NULL;
- break;
- }
- return name;
-}
static int cam_icp_mgr_process_msg_frame_process(uint32_t *msg_ptr)
{
struct hfi_msg_ipebps_async_ack *ioconfig_ack = NULL;
@@ -1676,11 +1614,8 @@ static int cam_icp_mgr_process_msg_frame_process(uint32_t *msg_ptr)
ioconfig_ack = (struct hfi_msg_ipebps_async_ack *)msg_ptr;
if (ioconfig_ack->err_type != HFI_ERR_SYS_NONE) {
- CAM_ERR(CAM_ICP,
- "failed with err_no= [%u] err_type= [%s]",
- ioconfig_ack->err_type,
- cam_icp_error_handle_id_to_type(
- ioconfig_ack->err_type));
+ CAM_ERR(CAM_ICP, "failed with error : %u",
+ ioconfig_ack->err_type);
cam_icp_mgr_handle_frame_process(msg_ptr,
ICP_FRAME_PROCESS_FAILURE);
return -EIO;
@@ -1720,12 +1655,8 @@ static int cam_icp_mgr_process_msg_config_io(uint32_t *msg_ptr)
ipe_config_ack =
(struct hfi_msg_ipe_config *)(ioconfig_ack->msg_data);
if (ipe_config_ack->rc) {
- CAM_ERR(CAM_ICP, "rc = %d failed with\n"
- "err_no = [%u] err_type = [%s]",
- ipe_config_ack->rc,
- ioconfig_ack->err_type,
- cam_icp_error_handle_id_to_type(
- ioconfig_ack->err_type));
+ CAM_ERR(CAM_ICP, "rc = %d err = %u",
+ ipe_config_ack->rc, ioconfig_ack->err_type);
return -EIO;
}
ctx_data = (struct cam_icp_hw_ctx_data *)
@@ -1890,13 +1821,9 @@ static int cam_icp_mgr_process_direct_ack_msg(uint32_t *msg_ptr)
(struct cam_icp_hw_ctx_data *)ioconfig_ack->user_data1;
if (ctx_data->state != CAM_ICP_CTX_STATE_FREE)
complete(&ctx_data->wait_complete);
- CAM_DBG(CAM_ICP, "received IPE/BPS\n"
- "MAP ACK:ctx_state =%d\n"
- "failed with err_no = [%u] err_type = [%s]",
- ctx_data->state,
- ioconfig_ack->err_type,
- cam_icp_error_handle_id_to_type(
- ioconfig_ack->err_type));
+ CAM_DBG(CAM_ICP,
+ "received IPE/BPS MAP ACK:ctx_state =%d err_status =%u",
+ ctx_data->state, ioconfig_ack->err_type);
break;
case HFI_IPEBPS_CMD_OPCODE_MEM_UNMAP:
ioconfig_ack = (struct hfi_msg_ipebps_async_ack *)msg_ptr;
@@ -1904,13 +1831,9 @@ static int cam_icp_mgr_process_direct_ack_msg(uint32_t *msg_ptr)
(struct cam_icp_hw_ctx_data *)ioconfig_ack->user_data1;
if (ctx_data->state != CAM_ICP_CTX_STATE_FREE)
complete(&ctx_data->wait_complete);
- CAM_DBG(CAM_ICP,
- "received IPE/BPS UNMAP ACK:ctx_state =%d\n"
- "failed with err_no = [%u] err_type = [%s]",
- ctx_data->state,
- ioconfig_ack->err_type,
- cam_icp_error_handle_id_to_type(
- ioconfig_ack->err_type));
+ CAM_DBG(CAM_ICP,
+ "received IPE/BPS UNMAP ACK:ctx_state =%d err_status =%u",
+ ctx_data->state, ioconfig_ack->err_type);
break;
default:
CAM_ERR(CAM_ICP, "Invalid opcode : %u",
@@ -4081,13 +4004,8 @@ static void cam_icp_mgr_print_io_bufs(struct cam_packet *packet,
for (i = 0; i < packet->num_io_configs; i++) {
for (j = 0; j < CAM_PACKET_MAX_PLANES; j++) {
- if (!io_cfg[i].mem_handle[j]) {
- CAM_ERR(CAM_ICP,
- "Mem Handle %d is NULL for %d io config",
- j, i);
+ if (!io_cfg[i].mem_handle[j])
break;
- }
-
if (GET_FD_FROM_HANDLE(io_cfg[i].mem_handle[j]) ==
GET_FD_FROM_HANDLE(pf_buf_info)) {
@@ -4695,13 +4613,6 @@ static int cam_icp_get_acquire_info(struct cam_icp_hw_mgr *hw_mgr,
return -EFAULT;
}
- /* To make sure num_out_res is same as allocated */
- if (ctx_data->icp_dev_acquire_info->num_out_res !=
- icp_dev_acquire_info.num_out_res) {
- CAM_ERR(CAM_ICP, "num_out_res got changed");
- return -EFAULT;
- }
-
CAM_DBG(CAM_ICP, "%x %x %x %x %x %x %x",
ctx_data->icp_dev_acquire_info->dev_type,
ctx_data->icp_dev_acquire_info->in_res.format,
diff --git a/drivers/media/platform/msm/ais/cam_icp/icp_hw/ipe_hw/ipe_core.c b/drivers/media/platform/msm/ais/cam_icp/icp_hw/ipe_hw/ipe_core.c
index ae58b34062d6..ae3d1343c1c4 100644
--- a/drivers/media/platform/msm/ais/cam_icp/icp_hw/ipe_hw/ipe_core.c
+++ b/drivers/media/platform/msm/ais/cam_icp/icp_hw/ipe_hw/ipe_core.c
@@ -342,11 +342,7 @@ int cam_ipe_process_cmd(void *device_priv, uint32_t cmd_type,
case CAM_ICP_IPE_CMD_CPAS_STOP:
if (core_info->cpas_start) {
- rc = cam_cpas_stop(core_info->cpas_handle);
- if (rc) {
- CAM_ERR(CAM_ICP, "CPAS stop failed %d", rc);
- return rc;
- }
+ cam_cpas_stop(core_info->cpas_handle);
core_info->cpas_start = false;
}
break;
diff --git a/drivers/media/platform/msm/ais/cam_isp/cam_isp_context.c b/drivers/media/platform/msm/ais/cam_isp/cam_isp_context.c
index dee741785610..9fcae004a891 100644
--- a/drivers/media/platform/msm/ais/cam_isp/cam_isp_context.c
+++ b/drivers/media/platform/msm/ais/cam_isp/cam_isp_context.c
@@ -40,26 +40,18 @@ static int cam_isp_context_dump_active_request(void *data, unsigned long iova,
static void __cam_isp_ctx_update_state_monitor_array(
struct cam_isp_context *ctx_isp,
- enum cam_isp_hw_event_type hw_event,
- enum cam_isp_ctx_activated_substate curr_state,
- enum cam_isp_ctx_activated_substate next_state)
+ enum cam_isp_state_change_trigger trigger_type,
+ uint32_t req_id)
{
int iterator = 0;
iterator = INC_STATE_MONITOR_HEAD(&ctx_isp->state_monitor_head);
ctx_isp->cam_isp_ctx_state_monitor[iterator].curr_state =
- curr_state;
- ctx_isp->cam_isp_ctx_state_monitor[iterator].next_state =
- next_state;
- ctx_isp->cam_isp_ctx_state_monitor[iterator].hw_event =
- hw_event;
- ctx_isp->cam_isp_ctx_state_monitor[iterator].last_reported_id =
- ctx_isp->req_info.reported_req_id;
- ctx_isp->cam_isp_ctx_state_monitor[iterator].last_applied_req_id =
- ctx_isp->req_info.last_applied_req_id;
- ctx_isp->cam_isp_ctx_state_monitor[iterator].frame_id =
- ctx_isp->frame_id;
-
+ ctx_isp->substate_activated;
+ ctx_isp->cam_isp_ctx_state_monitor[iterator].trigger =
+ trigger_type;
+ ctx_isp->cam_isp_ctx_state_monitor[iterator].req_id =
+ req_id;
ctx_isp->cam_isp_ctx_state_monitor[iterator].evt_time_stamp =
jiffies_to_msecs(jiffies);
}
@@ -89,17 +81,17 @@ static const char *__cam_isp_hw_evt_val_to_type(
uint32_t evt_id)
{
switch (evt_id) {
- case CAM_ISP_HW_EVENT_ERROR:
+ case CAM_ISP_STATE_CHANGE_TRIGGER_ERROR:
return "ERROR";
- case CAM_ISP_HW_EVENT_SOF:
+ case CAM_ISP_STATE_CHANGE_TRIGGER_SOF:
return "SOF";
- case CAM_ISP_HW_EVENT_REG_UPDATE:
+ case CAM_ISP_STATE_CHANGE_TRIGGER_REG_UPDATE:
return "REG_UPDATE";
- case CAM_ISP_HW_EVENT_EPOCH:
+ case CAM_ISP_STATE_CHANGE_TRIGGER_EPOCH:
return "EPOCH";
- case CAM_ISP_HW_EVENT_EOF:
+ case CAM_ISP_STATE_CHANGE_TRIGGER_EOF:
return "EOF";
- case CAM_ISP_HW_EVENT_DONE:
+ case CAM_ISP_STATE_CHANGE_TRIGGER_DONE:
return "DONE";
default:
return "CAM_ISP_EVENT_INVALID";
@@ -107,58 +99,29 @@ static const char *__cam_isp_hw_evt_val_to_type(
}
static void __cam_isp_ctx_dump_state_monitor_array(
- struct cam_isp_context *ctx_isp, bool log_rate_limit)
+ struct cam_isp_context *ctx_isp)
{
int i = 0;
uint64_t state_head = 0;
uint64_t index;
- struct cam_isp_context_state_monitor *ctx_monitor;
state_head = atomic64_read(&ctx_isp->state_monitor_head);
-
- ctx_monitor = ctx_isp->cam_isp_ctx_state_monitor;
-
- if (log_rate_limit)
- CAM_INFO_RATE_LIMIT_CUSTOM(CAM_ISP, 5, 20,
- "Dumping state information for preceding requests");
- else
- CAM_INFO(CAM_ISP,
- "Dumping state information for preceding requests");
+ CAM_ERR_RATE_LIMIT(CAM_ISP,
+ "Dumping state information for preceding requests");
for (i = CAM_ISP_CTX_STATE_MONITOR_MAX_ENTRIES - 1; i >= 0;
i--) {
index = (((state_head - i) +
CAM_ISP_CTX_STATE_MONITOR_MAX_ENTRIES) %
CAM_ISP_CTX_STATE_MONITOR_MAX_ENTRIES);
-
- if (log_rate_limit) {
- CAM_INFO_RATE_LIMIT_CUSTOM(CAM_ISP, 5, 20,
- "time[%lld] last reported req_id[%u] frame id[%lld] applied id[%lld] current state[%s] next state[%s] hw_event[%s]",
- ctx_monitor[index].evt_time_stamp,
- ctx_monitor[index].last_reported_id,
- ctx_monitor[index].frame_id,
- ctx_monitor[index].last_applied_req_id,
- __cam_isp_ctx_substate_val_to_type(
- ctx_monitor[index].curr_state),
- __cam_isp_ctx_substate_val_to_type(
- ctx_monitor[index].next_state),
- __cam_isp_hw_evt_val_to_type(
- ctx_monitor[index].hw_event));
-
- } else {
- CAM_INFO(CAM_ISP,
- "time[%lld] last reported req_id[%u] frame id[%lld] applied id[%lld] current state[%s] next state[%s] hw_event[%s]",
- ctx_monitor[index].evt_time_stamp,
- ctx_monitor[index].last_reported_id,
- ctx_monitor[index].frame_id,
- ctx_monitor[index].last_applied_req_id,
- __cam_isp_ctx_substate_val_to_type(
- ctx_monitor[index].curr_state),
- __cam_isp_ctx_substate_val_to_type(
- ctx_monitor[index].next_state),
- __cam_isp_hw_evt_val_to_type(
- ctx_monitor[index].hw_event));
- }
+ CAM_ERR_RATE_LIMIT(CAM_ISP,
+ "time[0x%llx] req_id[%u] state[%s] evt_type[%s]",
+ ctx_isp->cam_isp_ctx_state_monitor[index].evt_time_stamp,
+ ctx_isp->cam_isp_ctx_state_monitor[index].req_id,
+ __cam_isp_ctx_substate_val_to_type(
+ ctx_isp->cam_isp_ctx_state_monitor[index].curr_state),
+ __cam_isp_hw_evt_val_to_type(
+ ctx_isp->cam_isp_ctx_state_monitor[index].trigger));
}
}
@@ -443,7 +406,7 @@ static int __cam_isp_ctx_handle_buf_done_in_activated_state(
struct cam_context *ctx = ctx_isp->base;
if (list_empty(&ctx->active_req_list)) {
- CAM_WARN(CAM_ISP, "Buf done with no active request!");
+ CAM_DBG(CAM_ISP, "Buf done with no active request!");
goto end;
}
@@ -548,10 +511,6 @@ static int __cam_isp_ctx_handle_buf_done_in_activated_state(
CAM_DBG(CAM_REQ,
"Move active request %lld to pending list(cnt = %d) [bubble recovery], ctx %u",
req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id);
- __cam_isp_ctx_update_state_monitor_array(ctx_isp,
- CAM_ISP_HW_EVENT_DONE,
- ctx_isp->substate_activated,
- ctx_isp->substate_activated);
} else {
list_del_init(&req->list);
list_add_tail(&req->list, &ctx->free_req_list);
@@ -559,39 +518,32 @@ static int __cam_isp_ctx_handle_buf_done_in_activated_state(
CAM_DBG(CAM_REQ,
"Move active request %lld to free list(cnt = %d) [all fences done], ctx %u",
req->request_id, ctx_isp->active_req_cnt, ctx->ctx_id);
- ctx_isp->req_info.last_bufdone_req_id = req->request_id;
- ctx_isp->req_info.last_bufdone_time_stamp =
- jiffies_to_msecs(jiffies);
- __cam_isp_ctx_update_state_monitor_array(ctx_isp,
- CAM_ISP_HW_EVENT_DONE,
- ctx_isp->substate_activated,
- ctx_isp->substate_activated);
}
end:
+ __cam_isp_ctx_update_state_monitor_array(ctx_isp,
+ CAM_ISP_STATE_CHANGE_TRIGGER_DONE,
+ ctx_isp->base->req_list->request_id);
return rc;
}
static void __cam_isp_ctx_send_sof_boot_timestamp(
struct cam_isp_context *ctx_isp, uint64_t request_id,
- uint32_t sof_event_status, uint64_t delta_ts)
+ uint32_t sof_event_status)
{
struct cam_req_mgr_message req_msg;
req_msg.session_hdl = ctx_isp->base->session_hdl;
req_msg.u.frame_msg.frame_id = ctx_isp->frame_id;
req_msg.u.frame_msg.request_id = request_id;
+ req_msg.u.frame_msg.timestamp = ctx_isp->boot_timestamp;
req_msg.u.frame_msg.link_hdl = ctx_isp->base->link_hdl;
req_msg.u.frame_msg.sof_status = sof_event_status;
- req_msg.u.frame_msg.timestamp = ctx_isp->prev_boot_timestamp + delta_ts;
-
CAM_DBG(CAM_ISP,
- "req id:%lld frame num:%lld bt_ts:0x%llx pre_bt_ts:0x%llx diff:0x%llx",
- request_id, ctx_isp->frame_id,
- ctx_isp->boot_timestamp, ctx_isp->prev_boot_timestamp,
- delta_ts);
-
+ "request id:%lld frame number:%lld boot time stamp:0x%llx",
+ request_id, ctx_isp->frame_id,
+ ctx_isp->boot_timestamp);
if (cam_req_mgr_notify_message(&req_msg,
V4L_EVENT_CAM_REQ_MGR_SOF_BOOT_TS,
@@ -599,8 +551,6 @@ static void __cam_isp_ctx_send_sof_boot_timestamp(
CAM_ERR(CAM_ISP,
"Error in notifying the boot time for req id:%lld",
request_id);
-
- ctx_isp->prev_boot_timestamp = req_msg.u.frame_msg.timestamp;
}
@@ -609,7 +559,6 @@ static void __cam_isp_ctx_send_sof_timestamp(
uint32_t sof_event_status)
{
struct cam_req_mgr_message req_msg;
- uint64_t delta_ts;
req_msg.session_hdl = ctx_isp->base->session_hdl;
req_msg.u.frame_msg.frame_id = ctx_isp->frame_id;
@@ -619,9 +568,9 @@ static void __cam_isp_ctx_send_sof_timestamp(
req_msg.u.frame_msg.sof_status = sof_event_status;
CAM_DBG(CAM_ISP,
- "request id:%lld frame number:%lld SOF time stamp:0x%llx, Prev SOF time:0x%llx",
+ "request id:%lld frame number:%lld SOF time stamp:0x%llx",
request_id, ctx_isp->frame_id,
- ctx_isp->sof_timestamp_val, ctx_isp->prev_sof_timestamp_val);
+ ctx_isp->sof_timestamp_val);
CAM_DBG(CAM_ISP, "sof status:%d", sof_event_status);
if (cam_req_mgr_notify_message(&req_msg,
@@ -629,17 +578,9 @@ static void __cam_isp_ctx_send_sof_timestamp(
CAM_ERR(CAM_ISP,
"Error in notifying the sof time for req id:%lld",
request_id);
- delta_ts = ctx_isp->sof_timestamp_val -
- ctx_isp->prev_sof_timestamp_val;
__cam_isp_ctx_send_sof_boot_timestamp(ctx_isp,
- request_id, sof_event_status,
- (ctx_isp->prev_sof_timestamp_val == 0) ?
- ctx_isp->boot_timestamp :
- delta_ts);
-
- ctx_isp->prev_sof_timestamp_val =
- ctx_isp->sof_timestamp_val;
+ request_id, sof_event_status);
}
@@ -720,7 +661,6 @@ static int __cam_isp_ctx_notify_sof_in_activated_state(
notify.dev_hdl = ctx->dev_hdl;
notify.frame_id = ctx_isp->frame_id;
notify.trigger = CAM_TRIGGER_POINT_SOF;
- notify.sof_timestamp_val = ctx_isp->sof_timestamp_val;
ctx->ctx_crm_intf->notify_trigger(&notify);
CAM_DBG(CAM_ISP, "Notify CRM SOF frame %lld ctx %u",
@@ -728,12 +668,9 @@ static int __cam_isp_ctx_notify_sof_in_activated_state(
}
list_for_each_entry(req, &ctx->active_req_list, list) {
- if (req->request_id >
- ctx_isp->req_info.reported_req_id) {
+ if (req->request_id > ctx_isp->reported_req_id) {
request_id = req->request_id;
- ctx_isp->req_info.reported_req_id = request_id;
- ctx_isp->req_info.last_reported_id_time_stamp =
- jiffies_to_msecs(jiffies);
+ ctx_isp->reported_req_id = request_id;
break;
}
}
@@ -741,17 +678,6 @@ static int __cam_isp_ctx_notify_sof_in_activated_state(
if (ctx_isp->substate_activated == CAM_ISP_CTX_ACTIVATED_BUBBLE)
request_id = 0;
- if (request_id && ctx_isp->req_info.reported_req_id &&
- ((request_id - ctx_isp->req_info.reported_req_id) >
- 1)){
- CAM_INFO(CAM_ISP,
- "ctx:%d curr req id: %u last reported id:%u",
- ctx->ctx_id, request_id,
- ctx_isp->req_info.reported_req_id);
-
- __cam_isp_ctx_dump_state_monitor_array(ctx_isp, true);
- }
-
__cam_isp_ctx_send_sof_timestamp(ctx_isp, request_id,
CAM_REQ_MGR_SOF_EVENT_SUCCESS);
} else {
@@ -819,7 +745,8 @@ static int __cam_isp_ctx_sof_in_activated_state(
ctx_isp->frame_id++;
ctx_isp->sof_timestamp_val = sof_event_data->timestamp;
ctx_isp->boot_timestamp = sof_event_data->boot_time;
-
+ __cam_isp_ctx_update_state_monitor_array(ctx_isp,
+ CAM_ISP_STATE_CHANGE_TRIGGER_SOF, req->request_id);
CAM_DBG(CAM_ISP, "frame id: %lld time stamp:0x%llx, ctx %u",
ctx_isp->frame_id, ctx_isp->sof_timestamp_val, ctx->ctx_id);
@@ -854,7 +781,11 @@ static int __cam_isp_ctx_reg_upd_in_sof(struct cam_isp_context *ctx_isp,
CAM_ERR(CAM_ISP,
"receive rup in unexpected state");
}
-
+ if (req != NULL) {
+ __cam_isp_ctx_update_state_monitor_array(ctx_isp,
+ CAM_ISP_STATE_CHANGE_TRIGGER_REG_UPDATE,
+ req->request_id);
+ }
end:
return rc;
}
@@ -872,8 +803,7 @@ static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp,
* If no wait req in epoch, this is an error case.
* The recovery is to go back to sof state
*/
- CAM_ERR(CAM_ISP, "Ctx:%d No wait request", ctx->ctx_id);
- __cam_isp_ctx_dump_state_monitor_array(ctx_isp, true);
+ CAM_ERR(CAM_ISP, "No wait request");
ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_SOF;
/* Send SOF event as empty frame*/
@@ -888,9 +818,7 @@ static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp,
req_isp = (struct cam_isp_ctx_req *)req->req_priv;
req_isp->bubble_detected = true;
- CAM_INFO(CAM_ISP, "ctx:%d Report Bubble flag %d req id:%lld",
- ctx->ctx_id, req_isp->bubble_report, req->request_id);
- __cam_isp_ctx_dump_state_monitor_array(ctx_isp, true);
+ CAM_DBG(CAM_ISP, "Report Bubble flag %d", req_isp->bubble_report);
if (req_isp->bubble_report && ctx->ctx_crm_intf &&
ctx->ctx_crm_intf->notify_err) {
struct cam_req_mgr_error_notify notify;
@@ -917,11 +845,9 @@ static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp,
list_del_init(&req->list);
list_add_tail(&req->list, &ctx->active_req_list);
- if (req->request_id > ctx_isp->req_info.reported_req_id) {
+ if (req->request_id > ctx_isp->reported_req_id) {
request_id = req->request_id;
- ctx_isp->req_info.reported_req_id = request_id;
- ctx_isp->req_info.last_reported_id_time_stamp =
- jiffies_to_msecs(jiffies);
+ ctx_isp->reported_req_id = request_id;
}
__cam_isp_ctx_send_sof_timestamp(ctx_isp, request_id,
CAM_REQ_MGR_SOF_EVENT_ERROR);
@@ -930,7 +856,15 @@ static int __cam_isp_ctx_epoch_in_applied(struct cam_isp_context *ctx_isp,
CAM_DBG(CAM_ISP, "next substate %d",
ctx_isp->substate_activated);
end:
-
+ if (request_id == 0) {
+ req = list_last_entry(&ctx->active_req_list,
+ struct cam_ctx_request, list);
+ __cam_isp_ctx_update_state_monitor_array(ctx_isp,
+ CAM_ISP_STATE_CHANGE_TRIGGER_EPOCH, req->request_id);
+ } else {
+ __cam_isp_ctx_update_state_monitor_array(ctx_isp,
+ CAM_ISP_STATE_CHANGE_TRIGGER_EPOCH, request_id);
+ }
return 0;
}
@@ -953,6 +887,7 @@ static int __cam_isp_ctx_sof_in_epoch(struct cam_isp_context *ctx_isp,
int rc = 0;
struct cam_context *ctx = ctx_isp->base;
struct cam_isp_hw_sof_event_data *sof_event_data = evt_data;
+ struct cam_ctx_request *req;
if (!evt_data) {
CAM_ERR(CAM_ISP, "in valid sof event data");
@@ -968,6 +903,12 @@ static int __cam_isp_ctx_sof_in_epoch(struct cam_isp_context *ctx_isp,
else
CAM_DBG(CAM_ISP, "Still need to wait for the buf done");
+ req = list_last_entry(&ctx->active_req_list,
+ struct cam_ctx_request, list);
+ if (req)
+ __cam_isp_ctx_update_state_monitor_array(ctx_isp,
+ CAM_ISP_STATE_CHANGE_TRIGGER_SOF,
+ ctx->req_list->request_id);
CAM_DBG(CAM_ISP, "next substate %d",
ctx_isp->substate_activated);
@@ -1014,8 +955,7 @@ static int __cam_isp_ctx_epoch_in_bubble_applied(
* If no pending req in epoch, this is an error case.
* Just go back to the bubble state.
*/
- CAM_ERR(CAM_ISP, "ctx:%d No pending request.", ctx->ctx_id);
- __cam_isp_ctx_dump_state_monitor_array(ctx_isp, true);
+ CAM_ERR(CAM_ISP, "No pending request.");
__cam_isp_ctx_send_sof_timestamp(ctx_isp, request_id,
CAM_REQ_MGR_SOF_EVENT_SUCCESS);
@@ -1027,9 +967,6 @@ static int __cam_isp_ctx_epoch_in_bubble_applied(
list);
req_isp = (struct cam_isp_ctx_req *)req->req_priv;
req_isp->bubble_detected = true;
- CAM_INFO(CAM_ISP, "Ctx:%d Report Bubble flag %d req id:%lld",
- ctx->ctx_id, req_isp->bubble_report, req->request_id);
- __cam_isp_ctx_dump_state_monitor_array(ctx_isp, true);
if (req_isp->bubble_report && ctx->ctx_crm_intf &&
ctx->ctx_crm_intf->notify_err) {
@@ -1058,11 +995,9 @@ static int __cam_isp_ctx_epoch_in_bubble_applied(
list_add_tail(&req->list, &ctx->active_req_list);
if (!req_isp->bubble_report) {
- if (req->request_id > ctx_isp->req_info.reported_req_id) {
+ if (req->request_id > ctx_isp->reported_req_id) {
request_id = req->request_id;
- ctx_isp->req_info.reported_req_id = request_id;
- ctx_isp->req_info.last_reported_id_time_stamp =
- jiffies_to_msecs(jiffies);
+ ctx_isp->reported_req_id = request_id;
__cam_isp_ctx_send_sof_timestamp(ctx_isp, request_id,
CAM_REQ_MGR_SOF_EVENT_ERROR);
} else
@@ -1075,7 +1010,11 @@ static int __cam_isp_ctx_epoch_in_bubble_applied(
ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_BUBBLE;
CAM_DBG(CAM_ISP, "next substate %d", ctx_isp->substate_activated);
end:
-
+ req = list_last_entry(&ctx->active_req_list, struct cam_ctx_request,
+ list);
+ if (req)
+ __cam_isp_ctx_update_state_monitor_array(ctx_isp,
+ CAM_ISP_STATE_CHANGE_TRIGGER_EPOCH, req->request_id);
return 0;
}
@@ -1087,7 +1026,9 @@ static int __cam_isp_ctx_buf_done_in_bubble_applied(
(struct cam_isp_hw_done_event_data *) evt_data;
rc = __cam_isp_ctx_handle_buf_done_in_activated_state(ctx_isp, done, 1);
-
+ __cam_isp_ctx_update_state_monitor_array(ctx_isp,
+ CAM_ISP_STATE_CHANGE_TRIGGER_DONE,
+ ctx_isp->base->req_list->request_id);
return rc;
}
@@ -1145,6 +1086,9 @@ static int __cam_isp_ctx_handle_error(struct cam_isp_context *ctx_isp,
if (error_event_data->enable_reg_dump)
cam_isp_ctx_dump_req(req_isp);
+ __cam_isp_ctx_update_state_monitor_array(ctx_isp,
+ CAM_ISP_STATE_CHANGE_TRIGGER_ERROR, req_to_dump->request_id);
+
list_for_each_entry_safe(req, req_temp,
&ctx->active_req_list, list) {
req_isp = (struct cam_isp_ctx_req *) req->req_priv;
@@ -1235,15 +1179,14 @@ move_to_pending:
end:
do {
if (list_empty(&ctx->pending_req_list)) {
- error_request_id =
- ctx_isp->req_info.last_applied_req_id + 1;
+ error_request_id = ctx_isp->last_applied_req_id + 1;
req_isp = NULL;
break;
}
req = list_first_entry(&ctx->pending_req_list,
struct cam_ctx_request, list);
req_isp = (struct cam_isp_ctx_req *) req->req_priv;
- error_request_id = ctx_isp->req_info.last_applied_req_id;
+ error_request_id = ctx_isp->last_applied_req_id;
if (req_isp->bubble_report) {
req_to_report = req;
@@ -1261,8 +1204,7 @@ end:
list_del_init(&req->list);
list_add_tail(&req->list, &ctx->free_req_list);
- } while (req->request_id <
- ctx_isp->req_info.last_applied_req_id);
+ } while (req->request_id < ctx_isp->last_applied_req_id);
if (ctx->ctx_crm_intf && ctx->ctx_crm_intf->notify_err) {
notify.link_hdl = ctx->link_hdl;
@@ -1301,8 +1243,8 @@ end:
V4L_EVENT_CAM_REQ_MGR_EVENT))
CAM_ERR(CAM_ISP,
"Error in notifying the error time for req id:%lld ctx %u",
- ctx_isp->req_info.last_applied_req_id,
- ctx->ctx_id);
+ ctx_isp->last_applied_req_id,
+ ctx->ctx_id);
}
ctx_isp->substate_activated = CAM_ISP_CTX_ACTIVATED_HW_ERROR;
} else {
@@ -1339,7 +1281,8 @@ static int __cam_isp_ctx_fs2_sof_in_sof_state(
ctx_isp->frame_id++;
ctx_isp->sof_timestamp_val = sof_event_data->timestamp;
ctx_isp->boot_timestamp = sof_event_data->boot_time;
-
+ __cam_isp_ctx_update_state_monitor_array(ctx_isp,
+ CAM_ISP_STATE_CHANGE_TRIGGER_SOF, req->request_id);
CAM_DBG(CAM_ISP, "frame id: %lld time stamp:0x%llx",
ctx_isp->frame_id, ctx_isp->sof_timestamp_val);
@@ -1353,7 +1296,6 @@ static int __cam_isp_ctx_fs2_sof_in_sof_state(
notify.dev_hdl = ctx->dev_hdl;
notify.frame_id = ctx_isp->frame_id;
notify.trigger = CAM_TRIGGER_POINT_SOF;
- notify.sof_timestamp_val = ctx_isp->sof_timestamp_val;
ctx->ctx_crm_intf->notify_trigger(&notify);
CAM_DBG(CAM_ISP, "Notify CRM SOF frame %lld",
@@ -1361,12 +1303,9 @@ static int __cam_isp_ctx_fs2_sof_in_sof_state(
}
list_for_each_entry(req, &ctx->active_req_list, list) {
- if (req->request_id >
- ctx_isp->req_info.reported_req_id) {
+ if (req->request_id > ctx_isp->reported_req_id) {
request_id = req->request_id;
- ctx_isp->req_info.reported_req_id = request_id;
- ctx_isp->req_info.last_reported_id_time_stamp =
- jiffies_to_msecs(jiffies);
+ ctx_isp->reported_req_id = request_id;
break;
}
}
@@ -1407,10 +1346,8 @@ static int __cam_isp_ctx_fs2_buf_done(struct cam_isp_context *ctx_isp,
CAM_DBG(CAM_ISP, "No request, move to SOF");
ctx_isp->substate_activated =
CAM_ISP_CTX_ACTIVATED_SOF;
- if (ctx_isp->req_info.reported_req_id < curr_req_id) {
- ctx_isp->req_info.reported_req_id = curr_req_id;
- ctx_isp->req_info.last_reported_id_time_stamp =
- jiffies_to_msecs(jiffies);
+ if (ctx_isp->reported_req_id < curr_req_id) {
+ ctx_isp->reported_req_id = curr_req_id;
__cam_isp_ctx_send_sof_timestamp(ctx_isp,
curr_req_id,
CAM_REQ_MGR_SOF_EVENT_SUCCESS);
@@ -1468,7 +1405,11 @@ static int __cam_isp_ctx_fs2_reg_upd_in_sof(struct cam_isp_context *ctx_isp,
CAM_ERR(CAM_ISP,
"receive rup in unexpected state");
}
-
+ if (req != NULL) {
+ __cam_isp_ctx_update_state_monitor_array(ctx_isp,
+ CAM_ISP_STATE_CHANGE_TRIGGER_REG_UPDATE,
+ req->request_id);
+ }
end:
return rc;
}
@@ -1513,12 +1454,9 @@ static int __cam_isp_ctx_fs2_reg_upd_in_applied_state(
if (ctx->ctx_crm_intf && ctx->ctx_crm_intf->notify_trigger &&
ctx_isp->active_req_cnt <= 2) {
list_for_each_entry(req, &ctx->active_req_list, list) {
- if (req->request_id >
- ctx_isp->req_info.reported_req_id) {
+ if (req->request_id > ctx_isp->reported_req_id) {
request_id = req->request_id;
- ctx_isp->req_info.reported_req_id = request_id;
- ctx_isp->req_info.last_reported_id_time_stamp =
- jiffies_to_msecs(jiffies);
+ ctx_isp->reported_req_id = request_id;
break;
}
}
@@ -1531,7 +1469,6 @@ static int __cam_isp_ctx_fs2_reg_upd_in_applied_state(
notify.dev_hdl = ctx->dev_hdl;
notify.frame_id = ctx_isp->frame_id;
notify.trigger = CAM_TRIGGER_POINT_SOF;
- notify.sof_timestamp_val = ctx_isp->sof_timestamp_val;
ctx->ctx_crm_intf->notify_trigger(&notify);
CAM_DBG(CAM_ISP, "Notify CRM SOF frame %lld",
@@ -1544,7 +1481,11 @@ static int __cam_isp_ctx_fs2_reg_upd_in_applied_state(
CAM_DBG(CAM_ISP, "next substate %d", ctx_isp->substate_activated);
end:
-
+ if (req != NULL && !rc) {
+ __cam_isp_ctx_update_state_monitor_array(ctx_isp,
+ CAM_ISP_STATE_CHANGE_TRIGGER_EPOCH,
+ req->request_id);
+ }
return rc;
}
@@ -1740,11 +1681,9 @@ static int __cam_isp_ctx_apply_req_in_activated_state(
CAM_ERR_RATE_LIMIT(CAM_ISP,
"Invalid Request Id asking %llu existing %llu",
apply->request_id, req->request_id);
- if (ctx_isp->req_info.last_applied_req_id + 1
- != req->request_id) {
+ if (ctx_isp->last_applied_req_id + 1 != req->request_id) {
/*ignore remain mismatching apply req_id for pause*/
- ctx_isp->req_info.last_applied_req_id =
- apply->request_id;
+ ctx_isp->last_applied_req_id = apply->request_id;
return rc;
}
rc = -EFAULT;
@@ -1775,19 +1714,19 @@ static int __cam_isp_ctx_apply_req_in_activated_state(
} else {
spin_lock_bh(&ctx->lock);
ctx_isp->substate_activated = next_state;
- ctx_isp->req_info.last_applied_req_id =
- apply->request_id;
- ctx_isp->req_info.last_applied_time_stamp =
- jiffies_to_msecs(jiffies);
+ ctx_isp->last_applied_req_id = apply->request_id;
list_del_init(&req->list);
list_add_tail(&req->list, &ctx->wait_req_list);
CAM_DBG(CAM_ISP, "new substate state %d, applied req %lld",
- next_state,
- ctx_isp->req_info.last_applied_req_id);
+ next_state, ctx_isp->last_applied_req_id);
spin_unlock_bh(&ctx->lock);
}
end:
-
+ if (ctx_isp != NULL) {
+ __cam_isp_ctx_update_state_monitor_array(ctx_isp,
+ CAM_ISP_STATE_CHANGE_TRIGGER_SOF,
+ ctx->req_list->request_id);
+ }
return rc;
}
@@ -1921,23 +1860,6 @@ static int __cam_isp_ctx_flush_req_in_top_state(
CAM_DBG(CAM_ISP, "try to flush pending list");
spin_lock_bh(&ctx->lock);
rc = __cam_isp_ctx_flush_req(ctx, &ctx->pending_req_list, flush_req);
-
- if (!list_empty(&ctx->active_req_list)) {
- CAM_INFO_RATE_LIMIT_CUSTOM(CAM_ISP, 5, 20,
- "ctx:%d last applied id:%lld, reported req id:%lld, buf done id:%lld",
- ctx->ctx_id,
- ctx_isp->req_info.last_applied_req_id,
- ctx_isp->req_info.reported_req_id,
- ctx_isp->req_info.last_bufdone_req_id);
- CAM_INFO_RATE_LIMIT_CUSTOM(CAM_ISP, 5, 20,
- "current time:%lld last apply time:%lld, reported req time:%lld, buf done time:%lld",
- jiffies_to_msecs(jiffies),
- ctx_isp->req_info.last_applied_time_stamp,
- ctx_isp->req_info.last_reported_id_time_stamp,
- ctx_isp->req_info.last_bufdone_time_stamp);
-
- __cam_isp_ctx_dump_state_monitor_array(ctx_isp, true);
- }
spin_unlock_bh(&ctx->lock);
atomic_set(&ctx_isp->process_bubble, 0);
@@ -2103,7 +2025,6 @@ static int __cam_isp_ctx_rdi_only_sof_in_top_state(
notify.dev_hdl = ctx->dev_hdl;
notify.frame_id = ctx_isp->frame_id;
notify.trigger = CAM_TRIGGER_POINT_SOF;
- notify.sof_timestamp_val = ctx_isp->sof_timestamp_val;
ctx->ctx_crm_intf->notify_trigger(&notify);
CAM_DBG(CAM_ISP, "Notify CRM SOF frame %lld",
@@ -2196,10 +2117,8 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_applied(
list);
req_isp = (struct cam_isp_ctx_req *)req->req_priv;
req_isp->bubble_detected = true;
- CAM_INFO(CAM_ISP, "Ctx:%d Report Bubble flag %d req id:%lld",
- ctx->ctx_id, req_isp->bubble_report, req->request_id);
- __cam_isp_ctx_dump_state_monitor_array(ctx_isp, true);
+ CAM_DBG(CAM_ISP, "Report Bubble flag %d", req_isp->bubble_report);
if (req_isp->bubble_report && ctx->ctx_crm_intf &&
ctx->ctx_crm_intf->notify_err) {
struct cam_req_mgr_error_notify notify;
@@ -2226,11 +2145,9 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_applied(
req->request_id, ctx_isp->active_req_cnt);
if (!req_isp->bubble_report) {
- if (req->request_id > ctx_isp->req_info.reported_req_id) {
+ if (req->request_id > ctx_isp->reported_req_id) {
request_id = req->request_id;
- ctx_isp->req_info.reported_req_id = request_id;
- ctx_isp->req_info.last_reported_id_time_stamp =
- jiffies_to_msecs(jiffies);
+ ctx_isp->reported_req_id = request_id;
__cam_isp_ctx_send_sof_timestamp(ctx_isp, request_id,
CAM_REQ_MGR_SOF_EVENT_ERROR);
} else
@@ -2295,7 +2212,6 @@ static int __cam_isp_ctx_rdi_only_sof_in_bubble_state(
notify.dev_hdl = ctx->dev_hdl;
notify.frame_id = ctx_isp->frame_id;
notify.trigger = CAM_TRIGGER_POINT_SOF;
- notify.sof_timestamp_val = ctx_isp->sof_timestamp_val;
ctx->ctx_crm_intf->notify_trigger(&notify);
CAM_DBG(CAM_ISP, "Notify CRM SOF frame %lld",
@@ -2366,7 +2282,6 @@ static int __cam_isp_ctx_rdi_only_reg_upd_in_bubble_applied_state(
notify.dev_hdl = ctx->dev_hdl;
notify.frame_id = ctx_isp->frame_id;
notify.trigger = CAM_TRIGGER_POINT_SOF;
- notify.sof_timestamp_val = ctx_isp->sof_timestamp_val;
ctx->ctx_crm_intf->notify_trigger(&notify);
CAM_DBG(CAM_ISP, "Notify CRM SOF frame %lld",
@@ -2374,11 +2289,8 @@ static int __cam_isp_ctx_rdi_only_reg_upd_in_bubble_applied_state(
} else {
CAM_ERR(CAM_ISP, "Can not notify SOF to CRM");
}
- if (request_id) {
- ctx_isp->req_info.reported_req_id = request_id;
- ctx_isp->req_info.last_reported_id_time_stamp =
- jiffies_to_msecs(jiffies);
- }
+ if (request_id)
+ ctx_isp->reported_req_id = request_id;
__cam_isp_ctx_send_sof_timestamp(ctx_isp, request_id,
CAM_REQ_MGR_SOF_EVENT_SUCCESS);
@@ -2553,14 +2465,9 @@ static int __cam_isp_ctx_release_hw_in_top_state(struct cam_context *ctx,
ctx->last_flush_req = 0;
ctx_isp->frame_id = 0;
ctx_isp->active_req_cnt = 0;
+ ctx_isp->reported_req_id = 0;
ctx_isp->hw_acquired = false;
ctx_isp->init_received = false;
- ctx_isp->req_info.reported_req_id = 0;
- ctx_isp->req_info.last_applied_req_id = 0;
- ctx_isp->req_info.last_bufdone_req_id = 0;
- ctx_isp->req_info.last_applied_time_stamp = 0;
- ctx_isp->req_info.last_bufdone_time_stamp = 0;
- ctx_isp->req_info.last_reported_id_time_stamp = 0;
/*
* Ideally, we should never have any active request here.
@@ -2615,16 +2522,11 @@ static int __cam_isp_ctx_release_dev_in_top_state(struct cam_context *ctx,
ctx->last_flush_req = 0;
ctx_isp->frame_id = 0;
ctx_isp->active_req_cnt = 0;
+ ctx_isp->reported_req_id = 0;
ctx_isp->hw_acquired = false;
ctx_isp->init_received = false;
ctx_isp->rdi_only_context = false;
ctx_isp->split_acquire = false;
- ctx_isp->req_info.reported_req_id = 0;
- ctx_isp->req_info.last_applied_req_id = 0;
- ctx_isp->req_info.last_bufdone_req_id = 0;
- ctx_isp->req_info.last_applied_time_stamp = 0;
- ctx_isp->req_info.last_bufdone_time_stamp = 0;
- ctx_isp->req_info.last_reported_id_time_stamp = 0;
/*
* Ideally, we should never have any active request here.
@@ -2957,7 +2859,7 @@ get_dev_handle:
req_hdl_param.media_entity_flag = 0;
req_hdl_param.ops = ctx->crm_ctx_intf;
req_hdl_param.priv = ctx;
- req_hdl_param.dev_id = CAM_ISP;
+
CAM_DBG(CAM_ISP, "get device handle form bridge");
ctx->dev_hdl = cam_create_device_hdl(&req_hdl_param);
if (ctx->dev_hdl <= 0) {
@@ -3251,7 +3153,7 @@ static int __cam_isp_ctx_start_dev_in_ready(struct cam_context *ctx,
atomic_set(&ctx_isp->process_bubble, 0);
ctx_isp->frame_id = 0;
ctx_isp->active_req_cnt = 0;
- ctx_isp->req_info.reported_req_id = 0;
+ ctx_isp->reported_req_id = 0;
ctx_isp->substate_activated = ctx_isp->rdi_only_context ?
CAM_ISP_CTX_ACTIVATED_APPLIED :
(req_isp->num_fence_map_out) ? CAM_ISP_CTX_ACTIVATED_EPOCH :
@@ -3383,15 +3285,7 @@ static int __cam_isp_ctx_stop_dev_in_activated_unlock(
}
ctx_isp->frame_id = 0;
ctx_isp->active_req_cnt = 0;
- ctx_isp->req_info.reported_req_id = 0;
- ctx_isp->req_info.last_applied_req_id = 0;
- ctx_isp->req_info.last_bufdone_req_id = 0;
- ctx_isp->req_info.last_applied_time_stamp = 0;
- ctx_isp->req_info.last_bufdone_time_stamp = 0;
- ctx_isp->req_info.last_reported_id_time_stamp = 0;
- ctx_isp->prev_sof_timestamp_val = 0;
- ctx_isp->prev_boot_timestamp = 0;
-
+ ctx_isp->reported_req_id = 0;
atomic_set(&ctx_isp->process_bubble, 0);
CAM_DBG(CAM_ISP, "Stop device success next state %d on ctx %u",
@@ -3568,9 +3462,8 @@ static int __cam_isp_ctx_apply_req(struct cam_context *ctx,
rc = ctx_ops->crm_ops.apply_req(ctx, apply);
} else {
CAM_ERR_RATE_LIMIT(CAM_ISP,
- "Ctx:%d No handle function in activated substate %d",
- ctx->ctx_id, ctx_isp->substate_activated);
- __cam_isp_ctx_dump_state_monitor_array(ctx_isp, true);
+ "No handle function in activated substate %d",
+ ctx_isp->substate_activated);
rc = -EFAULT;
}
@@ -3591,27 +3484,22 @@ static int __cam_isp_ctx_handle_irq_in_activated(void *context,
struct cam_context *ctx = (struct cam_context *)context;
struct cam_isp_context *ctx_isp =
(struct cam_isp_context *)ctx->ctx_priv;
- enum cam_isp_ctx_activated_substate curr_state;
spin_lock(&ctx->lock);
trace_cam_isp_activated_irq(ctx, ctx_isp->substate_activated, evt_id,
__cam_isp_ctx_get_event_ts(evt_id, evt_data));
- curr_state = ctx_isp->substate_activated;
CAM_DBG(CAM_ISP, "Enter: State %d, Substate %d, evt id %d",
ctx->state, ctx_isp->substate_activated, evt_id);
irq_ops = &ctx_isp->substate_machine_irq[ctx_isp->substate_activated];
if (irq_ops->irq_ops[evt_id]) {
rc = irq_ops->irq_ops[evt_id](ctx_isp, evt_data);
} else {
- CAM_INFO(CAM_ISP, "Ctx:%d No handle function for substate %d",
- ctx->ctx_id, ctx_isp->substate_activated);
- __cam_isp_ctx_dump_state_monitor_array(ctx_isp, true);
+ CAM_DBG(CAM_ISP, "No handle function for substate %d",
+ ctx_isp->substate_activated);
+ __cam_isp_ctx_dump_state_monitor_array(ctx_isp);
}
- if (evt_id != CAM_ISP_HW_EVENT_DONE)
- __cam_isp_ctx_update_state_monitor_array(ctx_isp, evt_id,
- curr_state, ctx_isp->substate_activated);
CAM_DBG(CAM_ISP, "Exit: State %d Substate %d",
ctx->state, ctx_isp->substate_activated);
@@ -3773,13 +3661,7 @@ int cam_isp_context_init(struct cam_isp_context *ctx,
ctx->base = ctx_base;
ctx->frame_id = 0;
ctx->active_req_cnt = 0;
- ctx->req_info.reported_req_id = 0;
- ctx->req_info.last_applied_req_id = 0;
- ctx->req_info.last_bufdone_req_id = 0;
- ctx->req_info.last_applied_time_stamp = 0;
- ctx->req_info.last_bufdone_time_stamp = 0;
- ctx->req_info.last_reported_id_time_stamp = 0;
-
+ ctx->reported_req_id = 0;
ctx->hw_ctx = NULL;
ctx->substate_activated = CAM_ISP_CTX_ACTIVATED_SOF;
ctx->substate_machine = cam_isp_ctx_activated_state_machine;
diff --git a/drivers/media/platform/msm/ais/cam_isp/cam_isp_context.h b/drivers/media/platform/msm/ais/cam_isp/cam_isp_context.h
index a4f4e5ae0ee9..4954f2034144 100644
--- a/drivers/media/platform/msm/ais/cam_isp/cam_isp_context.h
+++ b/drivers/media/platform/msm/ais/cam_isp/cam_isp_context.h
@@ -62,6 +62,20 @@ enum cam_isp_ctx_activated_substate {
};
/**
+ * enum cam_isp_state_change_trigger - Different types of ISP events
+ *
+ */
+enum cam_isp_state_change_trigger {
+ CAM_ISP_STATE_CHANGE_TRIGGER_ERROR,
+ CAM_ISP_STATE_CHANGE_TRIGGER_SOF,
+ CAM_ISP_STATE_CHANGE_TRIGGER_REG_UPDATE,
+ CAM_ISP_STATE_CHANGE_TRIGGER_EPOCH,
+ CAM_ISP_STATE_CHANGE_TRIGGER_EOF,
+ CAM_ISP_STATE_CHANGE_TRIGGER_DONE,
+ CAM_ISP_STATE_CHANGE_TRIGGER_MAX
+};
+
+/**
* struct cam_isp_ctx_irq_ops - Function table for handling IRQ callbacks
*
* @irq_ops: Array of handle function pointers.
@@ -111,47 +125,20 @@ struct cam_isp_ctx_req {
* debug purposes
*
*@curr_state: Current sub state that received req
- *@next_state: Next sub state that received req
- *@hw_event: Hw Event type of incoming req
- *@last_reported_id: Last_reported_id to userspace
- *@last_applied_req_id Last applied request id to hardware
- *@frame_id: Current Frame id
- *@evt_time_stamp Current time stamp of this event logged
+ *@req_type: Event type of incoming req
+ *@req_id: Request id
+ *@evt_time_stamp Current time stamp
*
*/
struct cam_isp_context_state_monitor {
enum cam_isp_ctx_activated_substate curr_state;
- enum cam_isp_ctx_activated_substate next_state;
- enum cam_isp_hw_event_type hw_event;
- int64_t last_reported_id;
- int64_t last_applied_req_id;
+ enum cam_isp_state_change_trigger trigger;
+ uint32_t req_id;
int64_t frame_id;
uint64_t evt_time_stamp;
};
/**
- * struct cam_isp_context_req_id_info - ISP context request id
- * information for last applied, reported and bufdone.
- *
- *@last_applied_req_id: Last applied request id
- *@last_bufdone_req_id: Last bufdone request id
- *@reported_req_id: Last reported request id to userspace
- *@last_applied_time_stamp: Last applied request time stamp information
- *@last_bufdone_time_stamp Last bufdone request time stamp information
- *@last_reported_id_time_stamp: Last reported request time stamp information
- *
- */
-
-struct cam_isp_context_req_id_info {
- int64_t last_applied_req_id;
- int64_t last_bufdone_req_id;
- int64_t reported_req_id;
- int64_t last_applied_time_stamp;
- int64_t last_bufdone_time_stamp;
- int64_t last_reported_id_time_stamp;
-
-};
-/**
* struct cam_isp_context - ISP context object
*
* @base: Common context object pointer
@@ -165,15 +152,13 @@ struct cam_isp_context_req_id_info {
* @req_isp: ISP private request object storage
* @hw_ctx: HW object returned by the acquire device command
* @sof_timestamp_val: Captured time stamp value at sof hw event
- * @prev_sof_timestamp_val Holds last notified sof time stamp
* @boot_timestamp: Boot time stamp for a given req_id
- * @prev_boot_timestamp Holds last notified boot time stamp
* @active_req_cnt: Counter for the active request
+ * @reported_req_id: Last reported request id
* @subscribe_event: The irq event mask that CRM subscribes to, IFE
* will invoke CRM cb at those event.
+ * @last_applied_req_id: Last applied request id
* @state_monitor_head: Write index to the state monitoring array
- * @req_info Request id information about last applied,
- * reported and buf done
* @cam_isp_ctx_state_monitor: State monitoring array
* @rdi_only_context: Get context type information.
* true, if context is rdi only context
@@ -196,15 +181,14 @@ struct cam_isp_context {
void *hw_ctx;
uint64_t sof_timestamp_val;
- uint64_t prev_sof_timestamp_val;
uint64_t boot_timestamp;
- uint64_t prev_boot_timestamp;
int32_t active_req_cnt;
+ int64_t reported_req_id;
uint32_t subscribe_event;
+ int64_t last_applied_req_id;
atomic64_t state_monitor_head;
struct cam_isp_context_state_monitor cam_isp_ctx_state_monitor[
CAM_ISP_CTX_STATE_MONITOR_MAX_ENTRIES];
- struct cam_isp_context_req_id_info req_info;
bool rdi_only_context;
bool hw_acquired;
bool init_received;
diff --git a/drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c b/drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c
index 10b2cf4736e9..779f5f5264a5 100644
--- a/drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c
+++ b/drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c
@@ -2621,7 +2621,7 @@ static int cam_ife_mgr_stop_hw(void *hw_mgr_priv, void *stop_hw_args)
/* Stop the master CSID path first */
cam_ife_mgr_csid_stop_hw(ctx, &ctx->res_list_ife_csid,
- master_base_idx, csid_halt_type);
+ master_base_idx, CAM_CSID_HALT_AT_FRAME_BOUNDARY);
/* stop rest of the CSID paths */
for (i = 0; i < ctx->num_base; i++) {
@@ -2631,7 +2631,7 @@ static int cam_ife_mgr_stop_hw(void *hw_mgr_priv, void *stop_hw_args)
ctx->base[i].idx, i, master_base_idx);
cam_ife_mgr_csid_stop_hw(ctx, &ctx->res_list_ife_csid,
- ctx->base[i].idx, csid_halt_type);
+ ctx->base[i].idx, CAM_CSID_HALT_AT_FRAME_BOUNDARY);
}
CAM_DBG(CAM_ISP, "Stopping master CID idx %d", master_base_idx);
@@ -3559,38 +3559,6 @@ static void fill_res_bitmap(uint32_t resource_type, unsigned long *res_bitmap)
}
}
-static int cam_isp_blob_init_frame_drop(
- struct cam_isp_init_frame_drop_config *frame_drop_cfg,
- struct cam_hw_prepare_update_args *prepare)
-{
- struct cam_ife_hw_mgr_ctx *ctx = NULL;
- struct cam_ife_hw_mgr_res *hw_mgr_res;
- struct cam_hw_intf *hw_intf;
- uint32_t hw_idx = UINT_MAX;
- uint32_t i;
- int rc = 0;
-
- ctx = prepare->ctxt_to_hw_map;
- list_for_each_entry(hw_mgr_res, &ctx->res_list_ife_csid, list) {
- for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) {
- if (!hw_mgr_res->hw_res[i])
- continue;
-
- hw_intf = hw_mgr_res->hw_res[i]->hw_intf;
- if (hw_intf->hw_idx == hw_idx)
- continue;
-
- rc = hw_intf->hw_ops.process_cmd(hw_intf->hw_priv,
- CAM_IFE_CSID_SET_INIT_FRAME_DROP,
- frame_drop_cfg,
- sizeof(
- struct cam_isp_init_frame_drop_config *));
- hw_idx = hw_intf->hw_idx;
- }
- }
- return rc;
-}
-
static int cam_isp_packet_generic_blob_handler(void *user_data,
uint32_t blob_type, uint32_t blob_size, uint8_t *blob_data)
{
@@ -3725,33 +3693,10 @@ static int cam_isp_packet_generic_blob_handler(void *user_data,
}
break;
case CAM_ISP_GENERIC_BLOB_TYPE_BW_CONFIG_V2: {
- struct cam_isp_bw_config_ab *bw_config_ab;
-
+ struct cam_isp_bw_config_ab *bw_config_ab =
+ (struct cam_isp_bw_config_ab *)blob_data;
struct cam_isp_prepare_hw_update_data *prepare_hw_data;
- if (blob_size < sizeof(struct cam_isp_bw_config_ab)) {
- CAM_ERR(CAM_ISP, "Invalid blob size %u", blob_size);
- return -EINVAL;
- }
-
- bw_config_ab = (struct cam_isp_bw_config_ab *)blob_data;
-
- if (bw_config_ab->num_rdi > CAM_IFE_RDI_NUM_MAX) {
- CAM_ERR(CAM_ISP, "Invalid num_rdi %u in bw config ab",
- bw_config_ab->num_rdi);
- return -EINVAL;
- }
-
- if (blob_size < (sizeof(uint32_t) * 2
- + (bw_config_ab->num_rdi + 2)
- * sizeof(struct cam_isp_bw_vote))) {
- CAM_ERR(CAM_ISP, "Invalid blob size %u expected %u",
- blob_size,
- sizeof(uint32_t) * 2
- + (bw_config_ab->num_rdi + 2)
- * sizeof(struct cam_isp_bw_vote));
- return -EINVAL;
- }
CAM_DBG(CAM_ISP, "AB L:%lld R:%lld usage_type %d",
bw_config_ab->left_pix_vote_ab,
bw_config_ab->right_pix_vote_ab,
@@ -3836,22 +3781,7 @@ static int cam_isp_packet_generic_blob_handler(void *user_data,
CAM_ERR(CAM_ISP, "FS Update Failed rc: %d", rc);
}
break;
- case CAM_ISP_GENERIC_BLOB_TYPE_INIT_FRAME_DROP: {
- struct cam_isp_init_frame_drop_config *frame_drop_cfg =
- (struct cam_isp_init_frame_drop_config *)blob_data;
-
- if (blob_size < sizeof(struct cam_isp_init_frame_drop_config)) {
- CAM_ERR(CAM_ISP, "Invalid blob size %u expected %u",
- blob_size,
- sizeof(struct cam_isp_init_frame_drop_config));
- return -EINVAL;
- }
- rc = cam_isp_blob_init_frame_drop(frame_drop_cfg, prepare);
- if (rc)
- CAM_ERR(CAM_ISP, "Init Frame drop Update Failed");
- }
- break;
default:
CAM_WARN(CAM_ISP, "Invalid blob type %d", blob_type);
break;
@@ -4081,12 +4011,8 @@ static void cam_ife_mgr_print_io_bufs(struct cam_packet *packet,
for (i = 0; i < packet->num_io_configs; i++) {
for (j = 0; j < CAM_PACKET_MAX_PLANES; j++) {
- if (!io_cfg[i].mem_handle[j]) {
- CAM_ERR(CAM_ISP,
- "Mem Handle %d is NULL for %d io config",
- j, i);
+ if (!io_cfg[i].mem_handle[j])
break;
- }
if (pf_buf_info &&
GET_FD_FROM_HANDLE(io_cfg[i].mem_handle[j]) ==
@@ -4249,44 +4175,45 @@ static int cam_ife_mgr_cmd_get_sof_timestamp(
struct cam_hw_intf *hw_intf;
struct cam_csid_get_time_stamp_args csid_get_time;
- hw_mgr_res = list_first_entry(&ife_ctx->res_list_ife_csid,
- struct cam_ife_hw_mgr_res, list);
- for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) {
- if (!hw_mgr_res->hw_res[i])
- continue;
-
- /*
- * Get the SOF time stamp from left resource only.
- * Left resource is master for dual vfe case and
- * Rdi only context case left resource only hold
- * the RDI resource
- */
+ list_for_each_entry(hw_mgr_res, &ife_ctx->res_list_ife_csid, list) {
+ for (i = 0; i < CAM_ISP_HW_SPLIT_MAX; i++) {
+ if (!hw_mgr_res->hw_res[i])
+ continue;
- hw_intf = hw_mgr_res->hw_res[i]->hw_intf;
- if (hw_intf->hw_ops.process_cmd) {
/*
- * Single VFE case, Get the time stamp from
- * available one csid hw in the context
- * Dual VFE case, get the time stamp from
- * master(left) would be sufficient
+ * Get the SOF time stamp from left resource only.
+ * Left resource is master for dual vfe case and
+ * Rdi only context case left resource only hold
+ * the RDI resource
*/
- csid_get_time.node_res =
- hw_mgr_res->hw_res[i];
- rc = hw_intf->hw_ops.process_cmd(
- hw_intf->hw_priv,
- CAM_IFE_CSID_CMD_GET_TIME_STAMP,
- &csid_get_time,
- sizeof(
- struct cam_csid_get_time_stamp_args));
- if (!rc && (i == CAM_ISP_HW_SPLIT_LEFT)) {
- *time_stamp =
- csid_get_time.time_stamp_val;
- *boot_time_stamp =
- csid_get_time.boot_timestamp;
+ hw_intf = hw_mgr_res->hw_res[i]->hw_intf;
+ if (hw_intf->hw_ops.process_cmd) {
+ /*
+ * Single VFE case, Get the time stamp from
+ * available one csid hw in the context
+ * Dual VFE case, get the time stamp from
+ * master(left) would be sufficient
+ */
+
+ csid_get_time.node_res =
+ hw_mgr_res->hw_res[i];
+ rc = hw_intf->hw_ops.process_cmd(
+ hw_intf->hw_priv,
+ CAM_IFE_CSID_CMD_GET_TIME_STAMP,
+ &csid_get_time,
+ sizeof(
+ struct cam_csid_get_time_stamp_args));
+ if (!rc && (i == CAM_ISP_HW_SPLIT_LEFT)) {
+ *time_stamp =
+ csid_get_time.time_stamp_val;
+ *boot_time_stamp =
+ csid_get_time.boot_timestamp;
+ }
}
}
}
+
if (rc)
CAM_ERR(CAM_ISP, "Getting sof time stamp failed");
diff --git a/drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/hw_utils/cam_isp_packet_parser.c b/drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/hw_utils/cam_isp_packet_parser.c
index 8c38a3071608..1b64913f0919 100644
--- a/drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/hw_utils/cam_isp_packet_parser.c
+++ b/drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/hw_utils/cam_isp_packet_parser.c
@@ -473,7 +473,6 @@ int cam_isp_add_io_buffers(
int32_t hdl;
int mmu_hdl;
bool mode, is_buf_secure;
- uint64_t req_id;
io_cfg = (struct cam_buf_io_cfg *) ((uint8_t *)
&prepare->packet->payload +
@@ -482,7 +481,6 @@ int cam_isp_add_io_buffers(
num_in_buf = 0;
io_cfg_used_bytes = 0;
prepare->pf_data->packet = prepare->packet;
- req_id = prepare->packet->header.request_id;
/* Max one hw entries required for each base */
if (prepare->num_hw_update_entries + 1 >=
@@ -497,7 +495,7 @@ int cam_isp_add_io_buffers(
CAM_DBG(CAM_ISP, "======= io config idx %d ============", i);
CAM_DBG(CAM_REQ,
"i %d req_id %llu resource_type:%d fence:%d direction %d",
- i, req_id,
+ i, prepare->packet->header.request_id,
io_cfg[i].resource_type, io_cfg[i].fence,
io_cfg[i].direction);
CAM_DBG(CAM_ISP, "format: %d", io_cfg[i].format);
@@ -624,37 +622,12 @@ int cam_isp_add_io_buffers(
mmu_hdl, &io_addr[plane_id], &size);
if (rc) {
CAM_ERR(CAM_ISP,
- "no io addr for plane%d Bufhdl:%d, Size =%d",
- plane_id,
- io_cfg[i].mem_handle[plane_id],
- (int)size);
- CAM_ERR(CAM_ISP,
- "Port i %d Reqid %llu res_type:%d fence:%d dir %d",
- i, req_id,
- io_cfg[i].resource_type,
- io_cfg[i].fence,
- io_cfg[i].direction);
+ "no io addr for plane%d",
+ plane_id);
rc = -ENOMEM;
return rc;
}
- if (j == 0) {
- rc = cam_packet_validate_plane_size(
- &io_cfg[i],
- plane_id,
- size);
- if (rc) {
- CAM_ERR(CAM_ISP,
- "Invalid buffer size, port 0x%x plane %d req_id %llu format %d memh 0x%x",
- io_cfg[i].resource_type,
- plane_id,
- req_id,
- io_cfg[i].format,
- io_cfg[i].mem_handle[plane_id]);
- return -EINVAL;
- }
- }
-
/* need to update with offset */
io_addr[plane_id] +=
io_cfg[i].offsets[plane_id];
diff --git a/drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.c b/drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.c
index a15879f9d0d9..ecf699bc7a61 100644
--- a/drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.c
+++ b/drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.c
@@ -467,10 +467,6 @@ static int cam_ife_csid_global_reset(struct cam_ife_csid_hw *csid_hw)
CAM_ERR(CAM_ISP, "CSID:%d IRQ value after reset rc = %d",
csid_hw->hw_intf->hw_idx, val);
csid_hw->error_irq_count = 0;
- csid_hw->first_sof_ts = 0;
-
- for (i = 0 ; i < CAM_IFE_PIX_PATH_RES_MAX; i++)
- csid_hw->res_sof_cnt[i] = 0;
return rc;
}
@@ -842,6 +838,7 @@ end:
return rc;
}
+
static int cam_ife_csid_path_reserve(struct cam_ife_csid_hw *csid_hw,
struct cam_csid_hw_reserve_resource_args *reserve)
{
@@ -956,7 +953,7 @@ static int cam_ife_csid_path_reserve(struct cam_ife_csid_hw *csid_hw,
path_data->height = reserve->in_port->height;
path_data->start_line = reserve->in_port->line_start;
path_data->end_line = reserve->in_port->line_stop;
- path_data->usage_type = reserve->in_port->usage_type;
+
/* Enable RDI crop for single ife use case only */
switch (reserve->res_id) {
case CAM_IFE_PIX_PATH_RES_RDI_0:
@@ -1122,7 +1119,6 @@ err:
static int cam_ife_csid_disable_hw(struct cam_ife_csid_hw *csid_hw)
{
int rc = -EINVAL;
- uint32_t i;
struct cam_hw_soc_info *soc_info;
const struct cam_ife_csid_reg_offset *csid_reg;
unsigned long flags;
@@ -1163,96 +1159,12 @@ static int cam_ife_csid_disable_hw(struct cam_ife_csid_hw *csid_hw)
spin_lock_irqsave(&csid_hw->lock_state, flags);
csid_hw->device_enabled = 0;
spin_unlock_irqrestore(&csid_hw->lock_state, flags);
- for (i = 0; i < CAM_IFE_PIX_PATH_RES_MAX; i++)
- csid_hw->res_sof_cnt[i] = 0;
-
csid_hw->hw_info->hw_state = CAM_HW_STATE_POWER_DOWN;
csid_hw->error_irq_count = 0;
- csid_hw->first_sof_ts = 0;
return rc;
}
-static int cam_ife_csid_check_path_active(struct cam_ife_csid_hw *csid_hw)
-{
- struct cam_hw_soc_info *soc_info;
- const struct cam_ife_csid_reg_offset *csid_reg;
- uint32_t i, path_status = 1;
-
- csid_reg = csid_hw->csid_info->csid_reg;
- soc_info = &csid_hw->hw_info->soc_info;
-
- /* check the IPP path status */
- if (csid_reg->cmn_reg->num_pix) {
- path_status = cam_io_r_mb(soc_info->reg_map[0].mem_base +
- csid_reg->ipp_reg->csid_pxl_status_addr);
- CAM_DBG(CAM_ISP, "CSID:%d IPP path status:%d",
- csid_hw->hw_intf->hw_idx, path_status);
- /* if status is 0 then it is active */
- if (!path_status)
- goto end;
- }
-
- if (csid_reg->cmn_reg->num_ppp) {
- path_status = cam_io_r_mb(soc_info->reg_map[0].mem_base +
- csid_reg->ppp_reg->csid_pxl_status_addr);
- CAM_DBG(CAM_ISP, "CSID:%d PPP path status:%d",
- csid_hw->hw_intf->hw_idx, path_status);
- /* if status is 0 then it is active */
- if (!path_status)
- goto end;
- }
-
- /* Check the RDI path status */
- for (i = 0; i < csid_reg->cmn_reg->num_rdis; i++) {
- path_status = cam_io_r_mb(soc_info->reg_map[0].mem_base +
- csid_reg->rdi_reg[i]->csid_rdi_status_addr);
- CAM_DBG(CAM_ISP, "CSID:%d RDI:%d path status:%d",
- csid_hw->hw_intf->hw_idx, i, path_status);
- /* if status is 0 then it is active */
- if (!path_status)
- goto end;
- }
-
-end:
- return path_status;
-}
-
-static void cam_ife_csid_reset_init_frame_drop(
- struct cam_ife_csid_hw *csid_hw)
-{
- const struct cam_ife_csid_reg_offset *csid_reg;
- uint32_t i = 0;
-
- /*
- * Reset CSID init frame drop value only if all resources are
- * released
- */
- csid_reg = csid_hw->csid_info->csid_reg;
- if (csid_reg->cmn_reg->num_pix) {
- if (csid_hw->ipp_res.res_state !=
- CAM_ISP_RESOURCE_STATE_AVAILABLE)
- goto end;
- }
-
- if (csid_reg->cmn_reg->num_ppp) {
- if (csid_hw->ppp_res.res_state !=
- CAM_ISP_RESOURCE_STATE_AVAILABLE)
- goto end;
- }
-
- for (i = 0; i < csid_reg->cmn_reg->num_rdis; i++) {
- if (csid_hw->rdi_res[i].res_state !=
- CAM_ISP_RESOURCE_STATE_AVAILABLE)
- goto end;
- }
-
- /* All CSID resources are available reset the init frame drop */
- csid_hw->init_frame_drop = 0;
-end:
- return;
-
-}
static int cam_ife_csid_tpg_start(struct cam_ife_csid_hw *csid_hw,
struct cam_isp_resource_node *res)
@@ -1811,7 +1723,7 @@ static int cam_ife_csid_enable_pxl_path(
struct cam_ife_csid_path_cfg *path_data;
const struct cam_ife_csid_pxl_reg_offset *pxl_reg = NULL;
bool is_ipp;
- uint32_t val = 0, path_status;
+ uint32_t val = 0;
path_data = (struct cam_ife_csid_path_cfg *) res->res_priv;
csid_reg = csid_hw->csid_info->csid_reg;
@@ -1854,15 +1766,14 @@ static int cam_ife_csid_enable_pxl_path(
/* Default is internal halt mode */
val = 0;
- /* Resume at frame boundary */
- path_status = cam_ife_csid_check_path_active(csid_hw);
- if (!csid_hw->init_frame_drop ||
- (csid_hw->init_frame_drop && !path_status)) {
- CAM_DBG(CAM_ISP, "start pixel path");
- if (path_data->sync_mode == CAM_ISP_HW_SYNC_MASTER ||
- path_data->sync_mode == CAM_ISP_HW_SYNC_NONE)
- val |= CAM_CSID_RESUME_AT_FRAME_BOUNDARY;
- }
+ /*
+ * Resume at frame boundary if Master or No Sync.
+ * Slave will get resume command from Master.
+ */
+ if (path_data->sync_mode == CAM_ISP_HW_SYNC_MASTER ||
+ path_data->sync_mode == CAM_ISP_HW_SYNC_NONE)
+ val |= CAM_CSID_RESUME_AT_FRAME_BOUNDARY;
+
cam_io_w_mb(val, soc_info->reg_map[0].mem_base +
pxl_reg->csid_pxl_ctrl_addr);
@@ -1876,10 +1787,8 @@ static int cam_ife_csid_enable_pxl_path(
if (pxl_reg->ccif_violation_en)
val |= CSID_PATH_ERROR_CCIF_VIOLATION;
- if ((csid_hw->csid_debug & CSID_DEBUG_ENABLE_SOF_IRQ) ||
- (csid_hw->init_frame_drop && path_status))
+ if (csid_hw->csid_debug & CSID_DEBUG_ENABLE_SOF_IRQ)
val |= CSID_PATH_INFO_INPUT_SOF;
-
if (csid_hw->csid_debug & CSID_DEBUG_ENABLE_EOF_IRQ)
val |= CSID_PATH_INFO_INPUT_EOF;
@@ -2176,10 +2085,8 @@ static int cam_ife_csid_enable_rdi_path(
{
const struct cam_ife_csid_reg_offset *csid_reg;
struct cam_hw_soc_info *soc_info;
- struct cam_ife_csid_path_cfg *path_data;
- uint32_t id, val, path_status;
+ uint32_t id, val;
- path_data = (struct cam_ife_csid_path_cfg *) res->res_priv;
csid_reg = csid_hw->csid_info->csid_reg;
soc_info = &csid_hw->hw_info->soc_info;
id = res->res_id;
@@ -2194,28 +2101,19 @@ static int cam_ife_csid_enable_rdi_path(
return -EINVAL;
}
- if (path_data->usage_type)
- path_data->init_frame_drop = csid_hw->init_frame_drop + 1;
-
/*resume at frame boundary */
- path_status = cam_ife_csid_check_path_active(csid_hw);
- if (!path_data->init_frame_drop ||
- (path_data->init_frame_drop && !path_status)) {
- CAM_DBG(CAM_ISP, "Start RDI:%d path", id);
- cam_io_w_mb(CAM_CSID_RESUME_AT_FRAME_BOUNDARY,
- soc_info->reg_map[0].mem_base +
- csid_reg->rdi_reg[id]->csid_rdi_ctrl_addr);
- }
+ cam_io_w_mb(CAM_CSID_RESUME_AT_FRAME_BOUNDARY,
+ soc_info->reg_map[0].mem_base +
+ csid_reg->rdi_reg[id]->csid_rdi_ctrl_addr);
+
/* Enable the required RDI interrupts */
val = CSID_PATH_INFO_RST_DONE | CSID_PATH_ERROR_FIFO_OVERFLOW;
if (csid_reg->rdi_reg[id]->ccif_violation_en)
val |= CSID_PATH_ERROR_CCIF_VIOLATION;
- if ((csid_hw->csid_debug & CSID_DEBUG_ENABLE_SOF_IRQ) ||
- (path_data->init_frame_drop && path_status))
+ if (csid_hw->csid_debug & CSID_DEBUG_ENABLE_SOF_IRQ)
val |= CSID_PATH_INFO_INPUT_SOF;
-
if (csid_hw->csid_debug & CSID_DEBUG_ENABLE_EOF_IRQ)
val |= CSID_PATH_INFO_INPUT_EOF;
@@ -2455,16 +2353,9 @@ static int cam_ife_csid_get_time_stamp(
CAM_IFE_CSID_QTIMER_MUL_FACTOR,
CAM_IFE_CSID_QTIMER_DIV_FACTOR);
- if (!csid_hw->first_sof_ts) {
- get_monotonic_boottime64(&ts);
- time_stamp->boot_timestamp =
- (uint64_t)((ts.tv_sec * 1000000000) +
- ts.tv_nsec);
- CAM_DBG(CAM_ISP, "timestamp:%lld",
- time_stamp->boot_timestamp);
- csid_hw->first_sof_ts = 1;
- } else
- time_stamp->boot_timestamp = 0;
+ get_monotonic_boottime64(&ts);
+ time_stamp->boot_timestamp = (uint64_t)((ts.tv_sec * 1000000000) +
+ ts.tv_nsec);
return 0;
}
@@ -2482,19 +2373,6 @@ static int cam_ife_csid_set_csid_debug(struct cam_ife_csid_hw *csid_hw,
return 0;
}
-static int cam_ife_csid_set_init_frame_drop(struct cam_ife_csid_hw *csid_hw,
- void *cmd_args)
-{
- struct cam_isp_init_frame_drop_config *frame_drop_cfg;
-
- frame_drop_cfg = (struct cam_isp_init_frame_drop_config *) cmd_args;
- csid_hw->init_frame_drop = frame_drop_cfg->init_frame_drop;
- CAM_DBG(CAM_ISP, "CSID:%d set init frame drop:%d",
- csid_hw->hw_intf->hw_idx, csid_hw->init_frame_drop);
-
- return 0;
-}
-
static int cam_ife_csid_get_hw_caps(void *hw_priv,
void *get_hw_cap_args, uint32_t arg_size)
{
@@ -2671,7 +2549,6 @@ static int cam_ife_csid_release(void *hw_priv,
break;
case CAM_ISP_RESOURCE_PIX_PATH:
res->res_state = CAM_ISP_RESOURCE_STATE_AVAILABLE;
- cam_ife_csid_reset_init_frame_drop(csid_hw);
break;
default:
CAM_ERR(CAM_ISP, "CSID:%d Invalid res type:%d res id%d",
@@ -3141,9 +3018,6 @@ static int cam_ife_csid_process_cmd(void *hw_priv,
case CAM_ISP_HW_CMD_CSID_CLOCK_UPDATE:
rc = cam_ife_csid_set_csid_clock(csid_hw, cmd_args);
break;
- case CAM_IFE_CSID_SET_INIT_FRAME_DROP:
- rc = cam_ife_csid_set_init_frame_drop(csid_hw, cmd_args);
- break;
default:
CAM_ERR(CAM_ISP, "CSID:%d unsupported cmd:%d",
csid_hw->hw_intf->hw_idx, cmd_type);
@@ -3161,9 +3035,6 @@ irqreturn_t cam_ife_csid_irq(int irq_num, void *data)
struct cam_hw_soc_info *soc_info;
const struct cam_ife_csid_reg_offset *csid_reg;
const struct cam_ife_csid_csi2_rx_reg_offset *csi2_reg;
- struct cam_ife_csid_path_cfg *path_data;
- const struct cam_ife_csid_pxl_reg_offset *pxl_reg;
- const struct cam_ife_csid_rdi_reg_offset *rdi_reg;
uint32_t i, irq_status_top, irq_status_rx, irq_status_ipp = 0;
uint32_t irq_status_rdi[4] = {0, 0, 0, 0};
uint32_t val, irq_status_ppp = 0;
@@ -3395,53 +3266,6 @@ handle_fatal_error:
csid_hw->irq_debug_cnt++;
}
- if ((irq_status_ipp & CSID_PATH_INFO_INPUT_SOF) &&
- (csid_hw->init_frame_drop) &&
- (csid_hw->ipp_res.res_state ==
- CAM_ISP_RESOURCE_STATE_STREAMING)) {
- csid_hw->res_sof_cnt[CAM_IFE_PIX_PATH_RES_IPP]++;
- CAM_DBG(CAM_ISP,
- "CSID:%d IPP SOF cnt:%d init_frame_drop:%d",
- csid_hw->hw_intf->hw_idx,
- csid_hw->res_sof_cnt[CAM_IFE_PIX_PATH_RES_IPP],
- csid_hw->init_frame_drop);
- if (csid_hw->res_sof_cnt[CAM_IFE_PIX_PATH_RES_IPP] ==
- csid_hw->init_frame_drop) {
- pxl_reg = csid_reg->ipp_reg;
- path_data = csid_hw->ipp_res.res_priv;
- if (path_data->sync_mode ==
- CAM_ISP_HW_SYNC_MASTER) {
- val = cam_io_r_mb(
- soc_info->reg_map[0].mem_base +
- pxl_reg->csid_pxl_ctrl_addr);
-
- val |=
- CAM_CSID_RESUME_AT_FRAME_BOUNDARY;
- cam_io_w_mb(val,
- soc_info->reg_map[0].mem_base +
- pxl_reg->csid_pxl_ctrl_addr);
-
- } else if (path_data->sync_mode ==
- CAM_ISP_HW_SYNC_NONE) {
- cam_io_w_mb(
- CAM_CSID_RESUME_AT_FRAME_BOUNDARY,
- soc_info->reg_map[0].mem_base +
- pxl_reg->csid_pxl_ctrl_addr);
- }
-
- if (!(csid_hw->csid_debug &
- CSID_DEBUG_ENABLE_SOF_IRQ)) {
- val = cam_io_r_mb(
- soc_info->reg_map[0].mem_base +
- pxl_reg->csid_pxl_irq_mask_addr);
- val &= ~(CSID_PATH_INFO_INPUT_SOF);
- cam_io_w_mb(val,
- soc_info->reg_map[0].mem_base +
- pxl_reg->csid_pxl_irq_mask_addr);
- }
- }
- }
-
if ((irq_status_ipp & CSID_PATH_INFO_INPUT_EOF) &&
(csid_hw->csid_debug & CSID_DEBUG_ENABLE_EOF_IRQ))
CAM_INFO_RATE_LIMIT(CAM_ISP, "CSID:%d IPP EOF received",
@@ -3477,52 +3301,6 @@ handle_fatal_error:
csid_hw->irq_debug_cnt++;
}
- if ((irq_status_ppp & CSID_PATH_INFO_INPUT_SOF) &&
- (csid_hw->init_frame_drop) &&
- (csid_hw->ppp_res.res_state ==
- CAM_ISP_RESOURCE_STATE_STREAMING)) {
- csid_hw->res_sof_cnt[CAM_IFE_PIX_PATH_RES_PPP]++;
- CAM_DBG(CAM_ISP,
- "CSID:%d PPP SOF cnt:%d init_frame_drop:%d",
- csid_hw->hw_intf->hw_idx,
- csid_hw->res_sof_cnt[CAM_IFE_PIX_PATH_RES_PPP],
- csid_hw->init_frame_drop);
- if (csid_hw->res_sof_cnt[CAM_IFE_PIX_PATH_RES_PPP] ==
- csid_hw->init_frame_drop) {
- path_data = csid_hw->ppp_res.res_priv;
- pxl_reg = csid_reg->ppp_reg;
- if (path_data->sync_mode ==
- CAM_ISP_HW_SYNC_MASTER) {
- val = cam_io_r_mb(
- soc_info->reg_map[0].mem_base +
- pxl_reg->csid_pxl_ctrl_addr);
-
- val |=
- CAM_CSID_RESUME_AT_FRAME_BOUNDARY;
- cam_io_w_mb(val,
- soc_info->reg_map[0].mem_base +
- pxl_reg->csid_pxl_ctrl_addr);
- } else if (path_data->sync_mode ==
- CAM_ISP_HW_SYNC_NONE) {
- cam_io_w_mb(
- CAM_CSID_RESUME_AT_FRAME_BOUNDARY,
- soc_info->reg_map[0].mem_base +
- pxl_reg->csid_pxl_ctrl_addr);
- }
-
- if (!(csid_hw->csid_debug &
- CSID_DEBUG_ENABLE_SOF_IRQ)) {
- val = cam_io_r_mb(
- soc_info->reg_map[0].mem_base +
- pxl_reg->csid_pxl_irq_mask_addr);
- val &= ~(CSID_PATH_INFO_INPUT_SOF);
- cam_io_w_mb(val,
- soc_info->reg_map[0].mem_base +
- pxl_reg->csid_pxl_irq_mask_addr);
- }
- }
- }
-
if ((irq_status_ppp & CSID_PATH_INFO_INPUT_EOF) &&
(csid_hw->csid_debug & CSID_DEBUG_ENABLE_EOF_IRQ))
CAM_INFO_RATE_LIMIT(CAM_ISP, "CSID:%d PPP EOF received",
@@ -3543,9 +3321,6 @@ handle_fatal_error:
}
for (i = 0; i < csid_reg->cmn_reg->num_rdis; i++) {
- path_data = (struct cam_ife_csid_path_cfg *)
- csid_hw->rdi_res[i].res_priv;
- rdi_reg = csid_reg->rdi_reg[i];
if (irq_status_rdi[i] &
BIT(csid_reg->cmn_reg->path_rst_done_shift_val)) {
complete(&csid_hw->csid_rdin_complete[i]);
@@ -3559,35 +3334,6 @@ handle_fatal_error:
csid_hw->irq_debug_cnt++;
}
- if ((irq_status_rdi[i] & CSID_PATH_INFO_INPUT_SOF) &&
- (path_data->init_frame_drop) &&
- (csid_hw->rdi_res[i].res_state ==
- CAM_ISP_RESOURCE_STATE_STREAMING)) {
- csid_hw->res_sof_cnt[i]++;
- CAM_DBG(CAM_ISP,
- "CSID:%d RDI:%d SOF cnt:%d init_frame_drop:%d",
- csid_hw->hw_intf->hw_idx, i,
- csid_hw->res_sof_cnt[i],
- path_data->init_frame_drop);
- if (csid_hw->res_sof_cnt[i] ==
- path_data->init_frame_drop) {
- cam_io_w_mb(CAM_CSID_RESUME_AT_FRAME_BOUNDARY,
- soc_info->reg_map[0].mem_base +
- rdi_reg->csid_rdi_ctrl_addr);
-
- if (!(csid_hw->csid_debug &
- CSID_DEBUG_ENABLE_SOF_IRQ)) {
- val = cam_io_r_mb(
- soc_info->reg_map[0].mem_base +
- rdi_reg->csid_rdi_irq_mask_addr);
- val &= ~(CSID_PATH_INFO_INPUT_SOF);
- cam_io_w_mb(val,
- soc_info->reg_map[0].mem_base +
- rdi_reg->csid_rdi_irq_mask_addr);
- }
- }
- }
-
if ((irq_status_rdi[i] & CSID_PATH_INFO_INPUT_EOF) &&
(csid_hw->csid_debug & CSID_DEBUG_ENABLE_EOF_IRQ))
CAM_INFO_RATE_LIMIT(CAM_ISP,
@@ -3750,7 +3496,6 @@ int cam_ife_csid_hw_probe_init(struct cam_hw_intf *csid_hw_intf,
ife_csid_hw->csid_debug = 0;
ife_csid_hw->error_irq_count = 0;
- ife_csid_hw->first_sof_ts = 0;
return 0;
err:
diff --git a/drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.h b/drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.h
index 9b4d5c3d6add..3a093d205f59 100644
--- a/drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.h
+++ b/drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.h
@@ -419,9 +419,6 @@ struct cam_ife_csid_cid_data {
* @master_idx: For Slave reservation, Give master IFE instance Index.
* Slave will synchronize with master Start and stop operations
* @clk_rate Clock rate
- * @usage_type Usage type ie dual or single ife usecase
- * @init_frame_drop init frame drop value. In dual ife case rdi need to drop one
- * more frame than pix.
*
*/
struct cam_ife_csid_path_cfg {
@@ -440,8 +437,6 @@ struct cam_ife_csid_path_cfg {
enum cam_isp_hw_sync_mode sync_mode;
uint32_t master_idx;
uint64_t clk_rate;
- uint32_t usage_type;
- uint32_t init_frame_drop;
};
/**
@@ -473,14 +468,6 @@ struct cam_ife_csid_path_cfg {
* @irq_debug_cnt: Counter to track sof irq's when above flag is set.
* @error_irq_count Error IRQ count, if continuous error irq comes
* need to stop the CSID and mask interrupts.
- * @device_enabled Device enabled will set once CSID powered on and
- * initial configuration are done.
- * @lock_state csid spin lock
- * @dual_usage usage type, dual ife or single ife
- * @init_frame_drop Initial frame drop number
- * @res_sof_cnt path resource sof count value. it used for initial
- * frame drop
- * @first_sof_ts flag to mark the first sof has been registered
*
*/
struct cam_ife_csid_hw {
@@ -509,10 +496,6 @@ struct cam_ife_csid_hw {
uint32_t error_irq_count;
uint32_t device_enabled;
spinlock_t lock_state;
- uint32_t dual_usage;
- uint32_t init_frame_drop;
- uint32_t res_sof_cnt[CAM_IFE_PIX_PATH_RES_MAX];
- uint32_t first_sof_ts;
};
int cam_ife_csid_hw_probe_init(struct cam_hw_intf *csid_hw_intf,
diff --git a/drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/isp_hw/include/cam_ife_csid_hw_intf.h b/drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/isp_hw/include/cam_ife_csid_hw_intf.h
index 0c45bd1268b9..58818fbecf67 100644
--- a/drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/isp_hw/include/cam_ife_csid_hw_intf.h
+++ b/drivers/media/platform/msm/ais/cam_isp/isp_hw_mgr/isp_hw/include/cam_ife_csid_hw_intf.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -157,7 +157,6 @@ enum cam_ife_csid_cmd_type {
CAM_IFE_CSID_CMD_GET_TIME_STAMP,
CAM_IFE_CSID_SET_CSID_DEBUG,
CAM_IFE_CSID_SOF_IRQ_DEBUG,
- CAM_IFE_CSID_SET_INIT_FRAME_DROP,
CAM_IFE_CSID_CMD_MAX,
};
diff --git a/drivers/media/platform/msm/ais/cam_jpeg/jpeg_hw/cam_jpeg_hw_mgr.c b/drivers/media/platform/msm/ais/cam_jpeg/jpeg_hw/cam_jpeg_hw_mgr.c
index 696566d6a37a..9ea8e3f5b7d1 100644
--- a/drivers/media/platform/msm/ais/cam_jpeg/jpeg_hw/cam_jpeg_hw_mgr.c
+++ b/drivers/media/platform/msm/ais/cam_jpeg/jpeg_hw/cam_jpeg_hw_mgr.c
@@ -647,13 +647,8 @@ static void cam_jpeg_mgr_print_io_bufs(struct cam_packet *packet,
for (i = 0; i < packet->num_io_configs; i++) {
for (j = 0; j < CAM_PACKET_MAX_PLANES; j++) {
- if (!io_cfg[i].mem_handle[j]) {
- CAM_ERR(CAM_JPEG,
- "Mem Handle %d is NULL for %d io config",
- j, i);
+ if (!io_cfg[i].mem_handle[j])
break;
- }
-
if (GET_FD_FROM_HANDLE(io_cfg[i].mem_handle[j]) ==
GET_FD_FROM_HANDLE(pf_buf_info)) {
diff --git a/drivers/media/platform/msm/ais/cam_jpeg/jpeg_hw/jpeg_enc_hw/jpeg_enc_core.c b/drivers/media/platform/msm/ais/cam_jpeg/jpeg_hw/jpeg_enc_hw/jpeg_enc_core.c
index 225f859674f1..52907cd6803e 100644
--- a/drivers/media/platform/msm/ais/cam_jpeg/jpeg_hw/jpeg_enc_hw/jpeg_enc_core.c
+++ b/drivers/media/platform/msm/ais/cam_jpeg/jpeg_hw/jpeg_enc_hw/jpeg_enc_core.c
@@ -91,9 +91,6 @@ int cam_jpeg_enc_init_hw(void *device_priv,
CAM_ERR(CAM_JPEG, "soc enable is failed %d", rc);
goto soc_failed;
}
- spin_lock(&jpeg_enc_dev->hw_lock);
- jpeg_enc_dev->hw_state = CAM_HW_STATE_POWER_UP;
- spin_unlock(&jpeg_enc_dev->hw_lock);
mutex_unlock(&core_info->core_mutex);
@@ -143,9 +140,6 @@ int cam_jpeg_enc_deinit_hw(void *device_priv,
return -EFAULT;
}
- spin_lock(&jpeg_enc_dev->hw_lock);
- jpeg_enc_dev->hw_state = CAM_HW_STATE_POWER_DOWN;
- spin_unlock(&jpeg_enc_dev->hw_lock);
rc = cam_jpeg_enc_disable_soc_resources(soc_info);
if (rc)
CAM_ERR(CAM_JPEG, "soc disable failed %d", rc);
@@ -179,19 +173,12 @@ irqreturn_t cam_jpeg_enc_irq(int irq_num, void *data)
hw_info = core_info->jpeg_enc_hw_info;
mem_base = soc_info->reg_map[0].mem_base;
- spin_lock(&jpeg_enc_dev->hw_lock);
- if (jpeg_enc_dev->hw_state == CAM_HW_STATE_POWER_DOWN) {
- CAM_ERR(CAM_JPEG, "JPEG HW is in off state");
- spin_unlock(&jpeg_enc_dev->hw_lock);
- return -EINVAL;
- }
irq_status = cam_io_r_mb(mem_base +
core_info->jpeg_enc_hw_info->reg_offset.int_status);
cam_io_w_mb(irq_status,
soc_info->reg_map[0].mem_base +
core_info->jpeg_enc_hw_info->reg_offset.int_clr);
- spin_unlock(&jpeg_enc_dev->hw_lock);
CAM_DBG(CAM_JPEG, "irq_num %d irq_status = %x , core_state %d",
irq_num, irq_status, core_info->core_state);
@@ -281,12 +268,6 @@ int cam_jpeg_enc_reset_hw(void *data,
mutex_lock(&core_info->core_mutex);
spin_lock(&jpeg_enc_dev->hw_lock);
- if (jpeg_enc_dev->hw_state == CAM_HW_STATE_POWER_DOWN) {
- CAM_ERR(CAM_JPEG, "JPEG HW is in off state");
- spin_unlock(&jpeg_enc_dev->hw_lock);
- mutex_unlock(&core_info->core_mutex);
- return -EINVAL;
- }
if (core_info->core_state == CAM_JPEG_ENC_CORE_RESETTING) {
CAM_ERR(CAM_JPEG, "alrady resetting");
spin_unlock(&jpeg_enc_dev->hw_lock);
@@ -338,18 +319,10 @@ int cam_jpeg_enc_start_hw(void *data,
hw_info = core_info->jpeg_enc_hw_info;
mem_base = soc_info->reg_map[0].mem_base;
- spin_lock(&jpeg_enc_dev->hw_lock);
- if (jpeg_enc_dev->hw_state == CAM_HW_STATE_POWER_DOWN) {
- CAM_ERR(CAM_JPEG, "JPEG HW is in off state");
- spin_unlock(&jpeg_enc_dev->hw_lock);
- return -EINVAL;
- }
if (core_info->core_state != CAM_JPEG_ENC_CORE_READY) {
CAM_ERR(CAM_JPEG, "Error not ready");
- spin_unlock(&jpeg_enc_dev->hw_lock);
return -EINVAL;
}
- spin_unlock(&jpeg_enc_dev->hw_lock);
cam_io_w_mb(hw_info->reg_val.hw_cmd_start,
mem_base + hw_info->reg_offset.hw_cmd);
@@ -379,12 +352,6 @@ int cam_jpeg_enc_stop_hw(void *data,
mutex_lock(&core_info->core_mutex);
spin_lock(&jpeg_enc_dev->hw_lock);
- if (jpeg_enc_dev->hw_state == CAM_HW_STATE_POWER_DOWN) {
- CAM_ERR(CAM_JPEG, "JPEG HW is in off state");
- spin_unlock(&jpeg_enc_dev->hw_lock);
- mutex_unlock(&core_info->core_mutex);
- return -EINVAL;
- }
if (core_info->core_state == CAM_JPEG_ENC_CORE_ABORTING) {
CAM_ERR(CAM_JPEG, "alrady stopping");
spin_unlock(&jpeg_enc_dev->hw_lock);
diff --git a/drivers/media/platform/msm/ais/cam_req_mgr/cam_mem_mgr.c b/drivers/media/platform/msm/ais/cam_req_mgr/cam_mem_mgr.c
index f86f63ef86c9..aa8ed7d70398 100644
--- a/drivers/media/platform/msm/ais/cam_req_mgr/cam_mem_mgr.c
+++ b/drivers/media/platform/msm/ais/cam_req_mgr/cam_mem_mgr.c
@@ -251,50 +251,33 @@ int cam_mem_get_cpu_buf(int32_t buf_handle, uintptr_t *vaddr_ptr, size_t *len)
if (idx >= CAM_MEM_BUFQ_MAX || idx <= 0)
return -EINVAL;
- mutex_lock(&tbl.bufq[idx].q_lock);
- if (!tbl.bufq[idx].active) {
- CAM_ERR(CAM_MEM, "idx: %d not active", idx);
- rc = -EPERM;
- goto end;
- }
+ if (!tbl.bufq[idx].active)
+ return -EPERM;
- if (buf_handle != tbl.bufq[idx].buf_handle) {
- CAM_ERR(CAM_MEM, "idx: %d Invalid buf handle %d",
- idx, buf_handle);
- rc = -EINVAL;
- goto end;
- }
+ if (buf_handle != tbl.bufq[idx].buf_handle)
+ return -EINVAL;
- if (!(tbl.bufq[idx].flags & CAM_MEM_FLAG_KMD_ACCESS)) {
- CAM_ERR(CAM_MEM, "idx: %d Invalid flag 0x%x",
- idx, tbl.bufq[idx].flags);
- rc = -EINVAL;
- goto end;
- }
+ if (!(tbl.bufq[idx].flags & CAM_MEM_FLAG_KMD_ACCESS))
+ return -EINVAL;
if (tbl.bufq[idx].kmdvaddr) {
dmabuf = tbl.bufq[idx].dma_buf;
if (!dmabuf) {
CAM_ERR(CAM_MEM, "Invalid DMA buffer pointer");
- rc = -EINVAL;
- goto end;
+ return -EINVAL;
}
rc = dma_buf_begin_cpu_access(dmabuf, DMA_BIDIRECTIONAL);
if (rc) {
CAM_ERR(CAM_MEM, "dma begin access failed rc=%d", rc);
- goto end;
+ return rc;
}
} else {
- CAM_ERR(CAM_MEM, "Invalid kmdvaddr");
- rc = -EINVAL;
- goto end;
+ return -EINVAL;
}
*vaddr_ptr = tbl.bufq[idx].kmdvaddr;
*len = tbl.bufq[idx].len;
-end:
- mutex_unlock(&tbl.bufq[idx].q_lock);
return rc;
}
EXPORT_SYMBOL(cam_mem_get_cpu_buf);
@@ -317,38 +300,30 @@ int cam_mem_put_cpu_buf(int32_t buf_handle)
if (idx >= CAM_MEM_BUFQ_MAX || idx <= 0)
return -EINVAL;
- mutex_lock(&tbl.bufq[idx].q_lock);
- if (!tbl.bufq[idx].active) {
- CAM_ERR(CAM_MEM, "idx: %d not active", idx);
- rc = -EPERM;
- goto end;
- }
+ if (!tbl.bufq[idx].active)
+ return -EPERM;
- if (buf_handle != tbl.bufq[idx].buf_handle) {
- CAM_ERR(CAM_MEM, "idx: %d Invalid buf handle %d",
- idx, buf_handle);
- rc = -EINVAL;
- goto end;
- }
+ if (buf_handle != tbl.bufq[idx].buf_handle)
+ return -EINVAL;
dmabuf = tbl.bufq[idx].dma_buf;
if (!dmabuf) {
CAM_ERR(CAM_CRM, "Invalid DMA buffer pointer");
- rc = -EINVAL;
- goto end;
+ return -EINVAL;
}
if ((tbl.bufq[idx].flags & CAM_MEM_FLAG_KMD_ACCESS) &&
(tbl.bufq[idx].kmdvaddr)) {
rc = dma_buf_end_cpu_access(dmabuf, DMA_BIDIRECTIONAL);
- if (rc)
+ if (rc) {
CAM_ERR(CAM_MEM, "dma begin access failed rc=%d", rc);
+ return rc;
+ }
} else {
CAM_ERR(CAM_MEM, "Invalid buf flag");
rc = -EINVAL;
}
-end:
- mutex_unlock(&tbl.bufq[idx].q_lock);
+
return rc;
}
EXPORT_SYMBOL(cam_mem_put_cpu_buf);
@@ -804,8 +779,7 @@ int cam_mem_mgr_map(struct cam_mem_mgr_map_cmd *cmd)
dmabuf = dma_buf_get(cmd->fd);
if (IS_ERR_OR_NULL((void *)(dmabuf))) {
- CAM_ERR(CAM_MEM, "Failed to import dma_buf fd %d, rc %d",
- cmd->fd, (IS_ERR(dmabuf) ? PTR_ERR(dmabuf) : 0));
+ CAM_ERR(CAM_MEM, "Failed to import dma_buf fd");
return -EINVAL;
}
@@ -979,7 +953,6 @@ static int cam_mem_mgr_cleanup_table(void)
tbl.bufq[i].num_hdl = 0;
tbl.bufq[i].dma_buf = NULL;
tbl.bufq[i].active = false;
- tbl.bufq[i].kmdvaddr = 0;
mutex_unlock(&tbl.bufq[i].q_lock);
mutex_destroy(&tbl.bufq[i].q_lock);
}
@@ -1078,7 +1051,6 @@ static int cam_mem_util_unmap(int32_t idx,
tbl.bufq[idx].len = 0;
tbl.bufq[idx].num_hdl = 0;
tbl.bufq[idx].active = false;
- tbl.bufq[idx].kmdvaddr = 0;
mutex_unlock(&tbl.bufq[idx].q_lock);
mutex_destroy(&tbl.bufq[idx].q_lock);
clear_bit(idx, tbl.bitmap);
diff --git a/drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_core.c b/drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_core.c
index eaceecaf07f0..01f73cbc4f41 100644
--- a/drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_core.c
+++ b/drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_core.c
@@ -47,9 +47,6 @@ void cam_req_mgr_core_link_reset(struct cam_req_mgr_core_link *link)
link->last_flush_id = 0;
link->initial_sync_req = -1;
link->in_msync_mode = false;
- link->initial_skip = true;
- link->sof_timestamp = 0;
- link->prev_sof_timestamp = 0;
}
void cam_req_mgr_handle_core_shutdown(void)
@@ -350,12 +347,10 @@ static void __cam_req_mgr_reset_req_slot(struct cam_req_mgr_core_link *link,
struct cam_req_mgr_req_queue *in_q = link->req.in_q;
slot = &in_q->slot[idx];
- CAM_DBG(CAM_CRM, "RESET: last applied idx %d: idx %d: slot->status %d",
- in_q->last_applied_idx, idx, slot->status);
+ CAM_DBG(CAM_CRM, "RESET: idx: %d: slot->status %d", idx, slot->status);
/* Check if CSL has already pushed new request*/
- if (slot->status == CRM_SLOT_STATUS_REQ_ADDED ||
- in_q->last_applied_idx == idx)
+ if (slot->status == CRM_SLOT_STATUS_REQ_ADDED)
return;
/* Reset input queue slot */
@@ -516,11 +511,9 @@ static int __cam_req_mgr_send_req(struct cam_req_mgr_core_link *link,
}
if (link->req.apply_data[pd].skip_idx ||
link->req.apply_data[pd].req_id < 0) {
- CAM_DBG(CAM_CRM,
- "skip %d req_id %lld pd %d dev_name %s",
+ CAM_DBG(CAM_CRM, "skip %d req_id %lld",
link->req.apply_data[pd].skip_idx,
- link->req.apply_data[pd].req_id,
- pd, dev->dev_info.name);
+ link->req.apply_data[pd].req_id);
continue;
}
if (!(dev->dev_info.trigger & trigger))
@@ -612,19 +605,6 @@ static int __cam_req_mgr_check_link_is_ready(struct cam_req_mgr_core_link *link,
traverse_data.open_req_cnt = link->open_req_cnt;
/*
- * Some no-sync mode requests are processed after link config,
- * then process the sync mode requests after no-sync mode requests
- * are handled, the initial_skip should be false when processing
- * the sync mode requests.
- */
- if (link->initial_skip) {
- CAM_DBG(CAM_CRM,
- "Set initial_skip to false for link %x",
- link->link_hdl);
- link->initial_skip = false;
- }
-
- /*
* Traverse through all pd tables, if result is success,
* apply the settings
*/
@@ -909,12 +889,9 @@ static int __cam_req_mgr_check_sync_req_is_ready(
struct cam_req_mgr_slot *slot)
{
struct cam_req_mgr_core_link *sync_link = NULL;
- struct cam_req_mgr_slot *sync_rd_slot = NULL;
- int64_t req_id = 0, sync_req_id = 0;
+ int64_t req_id = 0;
int sync_slot_idx = 0, sync_rd_idx = 0, rc = 0;
int32_t sync_num_slots = 0;
- uint64_t sync_frame_duration = 0;
- bool ready = true, sync_ready = true;
if (!link->sync_link) {
CAM_ERR(CAM_CRM, "Sync link null");
@@ -924,65 +901,11 @@ static int __cam_req_mgr_check_sync_req_is_ready(
sync_link = link->sync_link;
req_id = slot->req_id;
sync_num_slots = sync_link->req.in_q->num_slots;
- sync_rd_idx = sync_link->req.in_q->rd_idx;
- sync_rd_slot = &sync_link->req.in_q->slot[sync_rd_idx];
- sync_req_id = sync_rd_slot->req_id;
CAM_DBG(CAM_REQ,
"link_hdl %x req %lld frame_skip_flag %d ",
link->link_hdl, req_id, link->sync_link_sof_skip);
- if (sync_link->initial_skip) {
- link->initial_skip = false;
- __cam_req_mgr_inject_delay(link->req.l_tbl, slot->idx);
- CAM_DBG(CAM_CRM,
- "sync link %x not streamed on",
- sync_link->link_hdl);
- return -EAGAIN;
- }
-
- if (sync_link->prev_sof_timestamp)
- sync_frame_duration = sync_link->sof_timestamp
- - sync_link->prev_sof_timestamp;
- else
- sync_frame_duration = DEFAULT_FRAME_DURATION;
-
- CAM_DBG(CAM_CRM,
- "sync link %x last frame duration is %d ns",
- sync_link->link_hdl, sync_frame_duration);
-
- if (link->initial_skip) {
- link->initial_skip = false;
-
- if (link->sof_timestamp > sync_link->sof_timestamp &&
- sync_link->sof_timestamp > 0 &&
- link->sof_timestamp - sync_link->sof_timestamp <
- sync_frame_duration / 2) {
- /*
- * If this frame sync with the previous frame of sync
- * link, then we need to skip this frame, since the
- * previous frame of sync link is also skipped.
- */
- __cam_req_mgr_inject_delay(link->req.l_tbl, slot->idx);
- CAM_DBG(CAM_CRM,
- "This frame sync with previous sync_link %x frame",
- sync_link->link_hdl);
- return -EAGAIN;
- } else if (link->sof_timestamp <= sync_link->sof_timestamp) {
- /*
- * Sometimes, link receives the SOF event is eariler
- * than sync link in IFE CSID side, but link's SOF
- * event is processed later than sync link's, then
- * we need to skip this SOF event since the sync
- * link's SOF event is also skipped.
- */
- __cam_req_mgr_inject_delay(link->req.l_tbl, slot->idx);
- CAM_DBG(CAM_CRM,
- "The previous frame of sync link is skipped");
- return -EAGAIN;
- }
- }
-
if (sync_link->sync_link_sof_skip) {
CAM_DBG(CAM_REQ,
"No req applied on corresponding SOF on sync link: %x",
@@ -997,7 +920,17 @@ static int __cam_req_mgr_check_sync_req_is_ready(
CAM_DBG(CAM_CRM,
"Skip Process Req: %lld on link: %x",
req_id, link->link_hdl);
- ready = false;
+ link->sync_link_sof_skip = true;
+ return rc;
+ }
+
+ rc = __cam_req_mgr_check_link_is_ready(link, slot->idx, true);
+ if (rc) {
+ CAM_DBG(CAM_CRM,
+ "Req: %lld [My link] not ready on link: %x, rc=%d",
+ req_id, link->link_hdl, rc);
+ link->sync_link_sof_skip = true;
+ return rc;
}
sync_slot_idx = __cam_req_mgr_find_slot_for_req(
@@ -1005,14 +938,16 @@ static int __cam_req_mgr_check_sync_req_is_ready(
if (sync_slot_idx == -1) {
CAM_DBG(CAM_CRM, "Req: %lld not found on link: %x [other link]",
req_id, sync_link->link_hdl);
- sync_ready = false;
+ link->sync_link_sof_skip = true;
+ return -EINVAL;
}
+ sync_rd_idx = sync_link->req.in_q->rd_idx;
if ((sync_link->req.in_q->slot[sync_slot_idx].status !=
CRM_SLOT_STATUS_REQ_APPLIED) &&
(((sync_slot_idx - sync_rd_idx + sync_num_slots) %
sync_num_slots) >= 1) &&
- (sync_rd_slot->status !=
+ (sync_link->req.in_q->slot[sync_rd_idx].status !=
CRM_SLOT_STATUS_REQ_APPLIED)) {
CAM_DBG(CAM_CRM,
"Req: %lld [other link] not next req to be applied on link: %x",
@@ -1020,101 +955,14 @@ static int __cam_req_mgr_check_sync_req_is_ready(
return -EAGAIN;
}
- rc = __cam_req_mgr_check_link_is_ready(link, slot->idx, true);
- if (rc) {
- CAM_DBG(CAM_CRM,
- "Req: %lld [My link] not ready on link: %x, rc=%d",
- req_id, link->link_hdl, rc);
- ready = false;
- }
-
rc = __cam_req_mgr_check_link_is_ready(sync_link, sync_slot_idx, true);
if (rc && (sync_link->req.in_q->slot[sync_slot_idx].status !=
CRM_SLOT_STATUS_REQ_APPLIED)) {
CAM_DBG(CAM_CRM,
"Req: %lld not ready on [other link] link: %x, rc=%d",
req_id, sync_link->link_hdl, rc);
- sync_ready = false;
- }
-
- /*
- * If both of them are ready or not ready, then just
- * skip this sof and don't skip sync link next SOF.
- */
- if (sync_ready != ready) {
- CAM_DBG(CAM_CRM,
- "Req: %lld ready %d sync_ready %d, ignore sync link next SOF",
- req_id, ready, sync_ready);
-
- /*
- * Only skip the frames if current frame sync with
- * next frame of sync link.
- */
- if (link->sof_timestamp - sync_link->sof_timestamp >
- sync_frame_duration / 2)
- link->sync_link_sof_skip = true;
-
- return -EINVAL;
- } else if (ready == false) {
- CAM_DBG(CAM_CRM,
- "Req: %lld not ready on link: %x",
- req_id, link->link_hdl);
- return -EINVAL;
- }
-
- /*
- * Do the self-correction when the frames are sync,
- * we consider that the frames are synced if the
- * difference of two SOF timestamp less than
- * (sync_frame_duration / 5).
- */
- if ((link->sof_timestamp > sync_link->sof_timestamp) &&
- (sync_link->sof_timestamp > 0) &&
- (link->sof_timestamp - sync_link->sof_timestamp <
- sync_frame_duration / 5) &&
- (sync_rd_slot->sync_mode == CAM_REQ_MGR_SYNC_MODE_SYNC)) {
-
- /*
- * This means current frame should sync with next
- * frame of sync link, then the request id of in
- * rd slot of two links should be same.
- */
- CAM_DBG(CAM_CRM,
- "link %x req_id %lld, sync_link %x req_id %lld",
- link->link_hdl, req_id,
- sync_link->link_hdl, sync_req_id);
-
- if (req_id > sync_req_id) {
- CAM_DBG(CAM_CRM,
- "link %x too quickly, skip this frame",
- link->link_hdl);
- return -EAGAIN;
- } else if (req_id < sync_req_id) {
- CAM_DBG(CAM_CRM,
- "sync link %x too quickly, skip next frame of sync link",
- sync_link->link_hdl);
- link->sync_link_sof_skip = true;
- }
- } else if ((sync_link->sof_timestamp > 0) &&
- (link->sof_timestamp < sync_link->sof_timestamp) &&
- (sync_link->sof_timestamp - link->sof_timestamp <
- sync_frame_duration / 5) &&
- (sync_rd_slot->sync_mode == CAM_REQ_MGR_SYNC_MODE_SYNC)) {
-
- /*
- * There is a timing issue once enter this condition,
- * it means link receives the SOF event earlier than
- * sync link in IFE CSID side, but the process in CRM
- * is sync_link earlier than link, then previous SOF
- * event of sync link is skipped, so we also need to
- * skip this SOF event.
- */
- if (req_id >= sync_req_id) {
- CAM_DBG(CAM_CRM,
- "Timing issue, the sof event of link %x is delayed",
- link->link_hdl);
- return -EAGAIN;
- }
+ link->sync_link_sof_skip = true;
+ return rc;
}
CAM_DBG(CAM_REQ,
@@ -1144,11 +992,10 @@ static int __cam_req_mgr_check_sync_req_is_ready(
*
*/
static int __cam_req_mgr_process_req(struct cam_req_mgr_core_link *link,
- struct cam_req_mgr_trigger_notify *trigger_data)
+ uint32_t trigger)
{
- int rc = 0, idx, last_app_idx;
+ int rc = 0, idx;
int reset_step = 0;
- uint32_t trigger = trigger_data->trigger;
struct cam_req_mgr_slot *slot = NULL;
struct cam_req_mgr_req_queue *in_q;
struct cam_req_mgr_core_session *session;
@@ -1186,13 +1033,6 @@ static int __cam_req_mgr_process_req(struct cam_req_mgr_core_link *link,
}
if (trigger == CAM_TRIGGER_POINT_SOF) {
- /*
- * Update the timestamp in session lock protection
- * to avoid timing issue.
- */
- link->prev_sof_timestamp = link->sof_timestamp;
- link->sof_timestamp = trigger_data->sof_timestamp_val;
-
if (link->trigger_mask) {
CAM_ERR_RATE_LIMIT(CAM_CRM,
"Applying for last EOF fails");
@@ -1288,7 +1128,6 @@ static int __cam_req_mgr_process_req(struct cam_req_mgr_core_link *link,
slot->req_id,
link->link_hdl);
idx = in_q->rd_idx;
-
reset_step = link->max_delay;
if (link->sync_link) {
if ((link->in_msync_mode) &&
@@ -1296,25 +1135,6 @@ static int __cam_req_mgr_process_req(struct cam_req_mgr_core_link *link,
reset_step =
link->sync_link->max_delay;
}
-
- /* This is to handle a rare scenario of scheduling
- * issue. If ISP sends multiple sofs due to scheduling
- * issue, it is required to retain last applied index
- * to help recover.
- * In this case, ISP goes into Bubble, asking to reapply
- * the bubbled request which has already been reset by
- * CRM. Below code retains the last applied request.
- */
-
- if (slot->req_id > 0) {
- last_app_idx = in_q->last_applied_idx;
- in_q->last_applied_idx = idx;
- if (abs(last_app_idx - idx) >=
- reset_step + 1)
- __cam_req_mgr_reset_req_slot(link,
- last_app_idx);
- }
-
__cam_req_mgr_dec_idx(
&idx, reset_step + 1,
in_q->num_slots);
@@ -2280,7 +2100,7 @@ static int cam_req_mgr_process_trigger(void *priv, void *data)
__cam_req_mgr_inc_idx(&in_q->rd_idx, 1, in_q->num_slots);
}
- rc = __cam_req_mgr_process_req(link, trigger_data);
+ rc = __cam_req_mgr_process_req(link, trigger_data->trigger);
release_lock:
mutex_unlock(&link->req.lock);
@@ -2511,7 +2331,6 @@ static int cam_req_mgr_cb_notify_trigger(
notify_trigger->link_hdl = trigger_data->link_hdl;
notify_trigger->dev_hdl = trigger_data->dev_hdl;
notify_trigger->trigger = trigger_data->trigger;
- notify_trigger->sof_timestamp_val = trigger_data->sof_timestamp_val;
task->process_cb = &cam_req_mgr_process_trigger;
rc = cam_req_mgr_workq_enqueue_task(task, link, CRM_TASK_PRIORITY_0);
@@ -2537,24 +2356,18 @@ static struct cam_req_mgr_crm_cb cam_req_mgr_ops = {
*
*/
static int __cam_req_mgr_setup_link_info(struct cam_req_mgr_core_link *link,
- struct cam_req_mgr_ver_info *link_info)
+ struct cam_req_mgr_link_info *link_info)
{
- int rc = 0, i = 0, num_devices = 0;
+ int rc = 0, i = 0;
struct cam_req_mgr_core_dev_link_setup link_data;
struct cam_req_mgr_connected_device *dev;
struct cam_req_mgr_req_tbl *pd_tbl;
enum cam_pipeline_delay max_delay;
uint32_t subscribe_event = 0;
- if (link_info->version == VERSION_1) {
- if (link_info->u.link_info_v1.num_devices >
- CAM_REQ_MGR_MAX_HANDLES)
- return -EPERM;
- }
- else if (link_info->version == VERSION_2) {
- if (link_info->u.link_info_v2.num_devices >
- CAM_REQ_MGR_MAX_HANDLES_V2)
- return -EPERM;
- }
+
+ if (link_info->num_devices > CAM_REQ_MGR_MAX_HANDLES)
+ return -EPERM;
+
mutex_init(&link->req.lock);
CAM_DBG(CAM_CRM, "LOCK_DBG in_q lock %pK", &link->req.lock);
link->req.num_tbl = 0;
@@ -2564,21 +2377,11 @@ static int __cam_req_mgr_setup_link_info(struct cam_req_mgr_core_link *link,
return rc;
max_delay = CAM_PIPELINE_DELAY_0;
- if (link_info->version == VERSION_1)
- num_devices = link_info->u.link_info_v1.num_devices;
- else if (link_info->version == VERSION_2)
- num_devices = link_info->u.link_info_v2.num_devices;
- for (i = 0; i < num_devices; i++) {
+ for (i = 0; i < link_info->num_devices; i++) {
dev = &link->l_dev[i];
/* Using dev hdl, get ops ptr to communicate with device */
- if (link_info->version == VERSION_1)
- dev->ops = (struct cam_req_mgr_kmd_ops *)
- cam_get_device_ops(
- link_info->u.link_info_v1.dev_hdls[i]);
- else if (link_info->version == VERSION_2)
- dev->ops = (struct cam_req_mgr_kmd_ops *)
- cam_get_device_ops(
- link_info->u.link_info_v2.dev_hdls[i]);
+ dev->ops = (struct cam_req_mgr_kmd_ops *)
+ cam_get_device_ops(link_info->dev_hdls[i]);
if (!dev->ops ||
!dev->ops->get_dev_info ||
!dev->ops->link_setup) {
@@ -2586,29 +2389,18 @@ static int __cam_req_mgr_setup_link_info(struct cam_req_mgr_core_link *link,
rc = -ENXIO;
goto error;
}
- if (link_info->version == VERSION_1)
- dev->dev_hdl = link_info->u.link_info_v1.dev_hdls[i];
- else if (link_info->version == VERSION_2)
- dev->dev_hdl = link_info->u.link_info_v2.dev_hdls[i];
+ dev->dev_hdl = link_info->dev_hdls[i];
dev->parent = (void *)link;
dev->dev_info.dev_hdl = dev->dev_hdl;
rc = dev->ops->get_dev_info(&dev->dev_info);
trace_cam_req_mgr_connect_device(link, &dev->dev_info);
- if (link_info->version == VERSION_1)
- CAM_DBG(CAM_CRM,
- "%x: connected: %s, id %d, delay %d, trigger %x",
- link_info->u.link_info_v1.session_hdl,
- dev->dev_info.name,
- dev->dev_info.dev_id, dev->dev_info.p_delay,
- dev->dev_info.trigger);
- else if (link_info->version == VERSION_2)
- CAM_DBG(CAM_CRM,
- "%x: connected: %s, id %d, delay %d, trigger %x",
- link_info->u.link_info_v2.session_hdl,
- dev->dev_info.name,
- dev->dev_info.dev_id, dev->dev_info.p_delay,
- dev->dev_info.trigger);
+
+ CAM_DBG(CAM_CRM,
+ "%x: connected: %s, id %d, delay %d, trigger %x",
+ link_info->session_hdl, dev->dev_info.name,
+ dev->dev_info.dev_id, dev->dev_info.p_delay,
+ dev->dev_info.trigger);
if (rc < 0 ||
dev->dev_info.p_delay >=
CAM_PIPELINE_DELAY_MAX ||
@@ -2617,18 +2409,10 @@ static int __cam_req_mgr_setup_link_info(struct cam_req_mgr_core_link *link,
CAM_ERR(CAM_CRM, "get device info failed");
goto error;
} else {
- if (link_info->version == VERSION_1) {
- CAM_DBG(CAM_CRM, "%x: connected: %s, delay %d",
- link_info->u.link_info_v1.session_hdl,
- dev->dev_info.name,
- dev->dev_info.p_delay);
- }
- else if (link_info->version == VERSION_2) {
- CAM_DBG(CAM_CRM, "%x: connected: %s, delay %d",
- link_info->u.link_info_v2.session_hdl,
- dev->dev_info.name,
- dev->dev_info.p_delay);
- }
+ CAM_DBG(CAM_CRM, "%x: connected: %s, delay %d",
+ link_info->session_hdl,
+ dev->dev_info.name,
+ dev->dev_info.p_delay);
if (dev->dev_info.p_delay > max_delay)
max_delay = dev->dev_info.p_delay;
@@ -2643,7 +2427,7 @@ static int __cam_req_mgr_setup_link_info(struct cam_req_mgr_core_link *link,
link_data.max_delay = max_delay;
link_data.subscribe_event = subscribe_event;
- for (i = 0; i < num_devices; i++) {
+ for (i = 0; i < link_info->num_devices; i++) {
dev = &link->l_dev[i];
link_data.dev_hdl = dev->dev_hdl;
@@ -2686,7 +2470,7 @@ static int __cam_req_mgr_setup_link_info(struct cam_req_mgr_core_link *link,
if (link->max_delay < dev->dev_info.p_delay)
link->max_delay = dev->dev_info.p_delay;
}
- link->num_devs = num_devices;
+ link->num_devs = link_info->num_devices;
/* Assign id for pd tables */
__cam_req_mgr_tbl_set_id(link->req.l_tbl, &link->req);
@@ -2854,7 +2638,7 @@ end:
return rc;
}
-int cam_req_mgr_link(struct cam_req_mgr_ver_info *link_info)
+int cam_req_mgr_link(struct cam_req_mgr_link_info *link_info)
{
int rc = 0;
int wq_flag = 0;
@@ -2867,9 +2651,9 @@ int cam_req_mgr_link(struct cam_req_mgr_ver_info *link_info)
CAM_DBG(CAM_CRM, "NULL pointer");
return -EINVAL;
}
- if (link_info->u.link_info_v1.num_devices > CAM_REQ_MGR_MAX_HANDLES) {
+ if (link_info->num_devices > CAM_REQ_MGR_MAX_HANDLES) {
CAM_ERR(CAM_CRM, "Invalid num devices %d",
- link_info->u.link_info_v1.num_devices);
+ link_info->num_devices);
return -EINVAL;
}
@@ -2877,7 +2661,7 @@ int cam_req_mgr_link(struct cam_req_mgr_ver_info *link_info)
/* session hdl's priv data is cam session struct */
cam_session = (struct cam_req_mgr_core_session *)
- cam_get_device_priv(link_info->u.link_info_v1.session_hdl);
+ cam_get_device_priv(link_info->session_hdl);
if (!cam_session) {
CAM_DBG(CAM_CRM, "NULL pointer");
mutex_unlock(&g_crm_core_dev->crm_lock);
@@ -2894,116 +2678,7 @@ int cam_req_mgr_link(struct cam_req_mgr_ver_info *link_info)
CAM_DBG(CAM_CRM, "link reserved %pK %x", link, link->link_hdl);
memset(&root_dev, 0, sizeof(struct cam_create_dev_hdl));
- root_dev.session_hdl = link_info->u.link_info_v1.session_hdl;
- root_dev.priv = (void *)link;
- root_dev.dev_id = CAM_CRM;
- mutex_lock(&link->lock);
- /* Create unique dev handle for link */
- link->link_hdl = cam_create_device_hdl(&root_dev);
- if (link->link_hdl < 0) {
- CAM_ERR(CAM_CRM,
- "Insufficient memory to create new device handle");
- rc = link->link_hdl;
- goto link_hdl_fail;
- }
- link_info->u.link_info_v1.link_hdl = link->link_hdl;
- link->last_flush_id = 0;
-
- /* Allocate memory to hold data of all linked devs */
- rc = __cam_req_mgr_create_subdevs(&link->l_dev,
- link_info->u.link_info_v1.num_devices);
- if (rc < 0) {
- CAM_ERR(CAM_CRM,
- "Insufficient memory to create new crm subdevs");
- goto create_subdev_failed;
- }
-
- /* Using device ops query connected devs, prepare request tables */
- rc = __cam_req_mgr_setup_link_info(link, link_info);
- if (rc < 0)
- goto setup_failed;
-
- spin_lock_bh(&link->link_state_spin_lock);
- link->state = CAM_CRM_LINK_STATE_READY;
- spin_unlock_bh(&link->link_state_spin_lock);
-
- /* Create worker for current link */
- snprintf(buf, sizeof(buf), "%x-%x",
- link_info->u.link_info_v1.session_hdl, link->link_hdl);
- wq_flag = CAM_WORKQ_FLAG_HIGH_PRIORITY | CAM_WORKQ_FLAG_SERIAL;
- rc = cam_req_mgr_workq_create(buf, CRM_WORKQ_NUM_TASKS,
- &link->workq, CRM_WORKQ_USAGE_NON_IRQ, wq_flag);
- if (rc < 0) {
- CAM_ERR(CAM_CRM, "FATAL: unable to create worker");
- __cam_req_mgr_destroy_link_info(link);
- goto setup_failed;
- }
-
- /* Assign payload to workqueue tasks */
- rc = __cam_req_mgr_setup_payload(link->workq);
- if (rc < 0) {
- __cam_req_mgr_destroy_link_info(link);
- cam_req_mgr_workq_destroy(&link->workq);
- goto setup_failed;
- }
-
- mutex_unlock(&link->lock);
- mutex_unlock(&g_crm_core_dev->crm_lock);
- return rc;
-setup_failed:
- __cam_req_mgr_destroy_subdev(link->l_dev);
-create_subdev_failed:
- cam_destroy_device_hdl(link->link_hdl);
- link_info->u.link_info_v1.link_hdl = -1;
-link_hdl_fail:
- mutex_unlock(&link->lock);
- __cam_req_mgr_unreserve_link(cam_session, link);
- mutex_unlock(&g_crm_core_dev->crm_lock);
- return rc;
-}
-
-int cam_req_mgr_link_v2(struct cam_req_mgr_ver_info *link_info)
-{
- int rc = 0;
- int wq_flag = 0;
- char buf[128];
- struct cam_create_dev_hdl root_dev;
- struct cam_req_mgr_core_session *cam_session;
- struct cam_req_mgr_core_link *link;
-
- if (!link_info) {
- CAM_DBG(CAM_CRM, "NULL pointer");
- return -EINVAL;
- }
- if (link_info->u.link_info_v2.num_devices >
- CAM_REQ_MGR_MAX_HANDLES_V2) {
- CAM_ERR(CAM_CRM, "Invalid num devices %d",
- link_info->u.link_info_v2.num_devices);
- return -EINVAL;
- }
-
- mutex_lock(&g_crm_core_dev->crm_lock);
-
- /* session hdl's priv data is cam session struct */
- cam_session = (struct cam_req_mgr_core_session *)
- cam_get_device_priv(link_info->u.link_info_v2.session_hdl);
- if (!cam_session) {
- CAM_DBG(CAM_CRM, "NULL pointer");
- mutex_unlock(&g_crm_core_dev->crm_lock);
- return -EINVAL;
- }
-
- /* Allocate link struct and map it with session's request queue */
- link = __cam_req_mgr_reserve_link(cam_session);
- if (!link) {
- CAM_ERR(CAM_CRM, "failed to reserve new link");
- mutex_unlock(&g_crm_core_dev->crm_lock);
- return -EINVAL;
- }
- CAM_DBG(CAM_CRM, "link reserved %pK %x", link, link->link_hdl);
-
- memset(&root_dev, 0, sizeof(struct cam_create_dev_hdl));
- root_dev.session_hdl = link_info->u.link_info_v2.session_hdl;
+ root_dev.session_hdl = link_info->session_hdl;
root_dev.priv = (void *)link;
mutex_lock(&link->lock);
@@ -3015,12 +2690,12 @@ int cam_req_mgr_link_v2(struct cam_req_mgr_ver_info *link_info)
rc = link->link_hdl;
goto link_hdl_fail;
}
- link_info->u.link_info_v2.link_hdl = link->link_hdl;
+ link_info->link_hdl = link->link_hdl;
link->last_flush_id = 0;
/* Allocate memory to hold data of all linked devs */
rc = __cam_req_mgr_create_subdevs(&link->l_dev,
- link_info->u.link_info_v2.num_devices);
+ link_info->num_devices);
if (rc < 0) {
CAM_ERR(CAM_CRM,
"Insufficient memory to create new crm subdevs");
@@ -3038,7 +2713,7 @@ int cam_req_mgr_link_v2(struct cam_req_mgr_ver_info *link_info)
/* Create worker for current link */
snprintf(buf, sizeof(buf), "%x-%x",
- link_info->u.link_info_v2.session_hdl, link->link_hdl);
+ link_info->session_hdl, link->link_hdl);
wq_flag = CAM_WORKQ_FLAG_HIGH_PRIORITY | CAM_WORKQ_FLAG_SERIAL;
rc = cam_req_mgr_workq_create(buf, CRM_WORKQ_NUM_TASKS,
&link->workq, CRM_WORKQ_USAGE_NON_IRQ, wq_flag);
@@ -3063,7 +2738,7 @@ setup_failed:
__cam_req_mgr_destroy_subdev(link->l_dev);
create_subdev_failed:
cam_destroy_device_hdl(link->link_hdl);
- link_info->u.link_info_v2.link_hdl = -1;
+ link_info->link_hdl = -1;
link_hdl_fail:
mutex_unlock(&link->lock);
__cam_req_mgr_unreserve_link(cam_session, link);
@@ -3071,7 +2746,6 @@ link_hdl_fail:
return rc;
}
-
int cam_req_mgr_unlink(struct cam_req_mgr_unlink_info *unlink_info)
{
int rc = 0;
@@ -3275,6 +2949,8 @@ int cam_req_mgr_sync_config(
link1->is_master = false;
link2->is_master = false;
+ link1->initial_skip = false;
+ link2->initial_skip = false;
link1->in_msync_mode = false;
link2->in_msync_mode = false;
@@ -3285,16 +2961,6 @@ int cam_req_mgr_sync_config(
link1->sync_link = link2;
link2->sync_link = link1;
__cam_req_mgr_set_master_link(link1, link2);
- } else {
- /*
- * Reset below info after the mode is configured
- * to NO-SYNC mode since they may be overridden
- * if the sync config is invoked after SOF comes.
- */
- link1->initial_skip = true;
- link2->initial_skip = true;
- link1->sof_timestamp = 0;
- link2->sof_timestamp = 0;
}
cam_session->sync_mode = sync_info->sync_mode;
diff --git a/drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_core.h b/drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_core.h
index 1c7fb24dc15f..bb3a05938886 100644
--- a/drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_core.h
+++ b/drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_core.h
@@ -32,16 +32,10 @@
#define MAX_SYNC_COUNT 65535
-/* Default frame rate is 30 */
-#define DEFAULT_FRAME_DURATION 33333333
-
#define SYNC_LINK_SOF_CNT_MAX_LMT 1
#define MAXIMUM_LINKS_PER_SESSION 4
-#define VERSION_1 1
-#define VERSION_2 2
-
/**
* enum crm_workq_task_type
* @codes: to identify which type of task is present
@@ -239,14 +233,12 @@ struct cam_req_mgr_slot {
* @slot : request slot holding incoming request id and bubble info.
* @rd_idx : indicates slot index currently in process.
* @wr_idx : indicates slot index to hold new upcoming req.
- * @last_applied_idx : indicates slot index last applied successfully.
*/
struct cam_req_mgr_req_queue {
int32_t num_slots;
struct cam_req_mgr_slot slot[MAX_REQ_SLOTS];
int32_t rd_idx;
int32_t wr_idx;
- int32_t last_applied_idx;
};
/**
@@ -324,10 +316,7 @@ struct cam_req_mgr_connected_device {
* master-slave sync
* @in_msync_mode : Flag to determine if a link is in master-slave mode
* @initial_sync_req : The initial req which is required to sync with the
- * other link, it means current hasn't receive any
- * stream after streamon if it is true
- * @sof_timestamp_value : SOF timestamp value
- * @prev_sof_timestamp : Previous SOF timestamp value
+ * other link
*/
struct cam_req_mgr_core_link {
int32_t link_hdl;
@@ -354,8 +343,6 @@ struct cam_req_mgr_core_link {
bool initial_skip;
bool in_msync_mode;
int64_t initial_sync_req;
- uint64_t sof_timestamp;
- uint64_t prev_sof_timestamp;
};
/**
@@ -424,9 +411,7 @@ int cam_req_mgr_destroy_session(struct cam_req_mgr_session_info *ses_info);
* a unique link handle for the link and is specific to a
* session. Returns link handle
*/
-int cam_req_mgr_link(struct cam_req_mgr_ver_info *link_info);
-int cam_req_mgr_link_v2(struct cam_req_mgr_ver_info *link_info);
-
+int cam_req_mgr_link(struct cam_req_mgr_link_info *link_info);
/**
* cam_req_mgr_unlink()
diff --git a/drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_dev.c b/drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_dev.c
index 768037b0e34f..5e800ae8c5aa 100644
--- a/drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_dev.c
+++ b/drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_dev.c
@@ -278,50 +278,27 @@ static long cam_private_ioctl(struct file *file, void *fh,
break;
case CAM_REQ_MGR_LINK: {
- struct cam_req_mgr_ver_info ver_info;
+ struct cam_req_mgr_link_info link_info;
- if (k_ioctl->size != sizeof(ver_info.u.link_info_v1))
+ if (k_ioctl->size != sizeof(link_info))
return -EINVAL;
- if (copy_from_user(&ver_info.u.link_info_v1,
+ if (copy_from_user(&link_info,
u64_to_user_ptr(k_ioctl->handle),
sizeof(struct cam_req_mgr_link_info))) {
return -EFAULT;
}
- ver_info.version = VERSION_1;
- rc = cam_req_mgr_link(&ver_info);
+
+ rc = cam_req_mgr_link(&link_info);
if (!rc)
if (copy_to_user(
u64_to_user_ptr(k_ioctl->handle),
- &ver_info.u.link_info_v1,
+ &link_info,
sizeof(struct cam_req_mgr_link_info)))
rc = -EFAULT;
}
break;
- case CAM_REQ_MGR_LINK_V2: {
- struct cam_req_mgr_ver_info ver_info;
-
- if (k_ioctl->size != sizeof(ver_info.u.link_info_v2))
- return -EINVAL;
-
- if (copy_from_user(&ver_info.u.link_info_v2,
- u64_to_user_ptr(k_ioctl->handle),
- sizeof(struct cam_req_mgr_link_info_v2))) {
- return -EFAULT;
- }
- ver_info.version = VERSION_2;
- rc = cam_req_mgr_link_v2(&ver_info);
- if (!rc)
- if (copy_to_user(
- u64_to_user_ptr(k_ioctl->handle),
- &ver_info.u.link_info_v2,
- sizeof(struct
- cam_req_mgr_link_info_v2)))
- rc = -EFAULT;
- }
- break;
-
case CAM_REQ_MGR_UNLINK: {
struct cam_req_mgr_unlink_info unlink_info;
diff --git a/drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_interface.h b/drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_interface.h
index 934bc76014a5..409e74961b45 100644
--- a/drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_interface.h
+++ b/drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_interface.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -201,14 +201,12 @@ enum cam_req_mgr_link_evt_type {
* @frame_id : frame id for internal tracking
* @trigger : trigger point of this notification, CRM will send apply
* only to the devices which subscribe to this point.
- * @sof_timestamp_val: Captured time stamp value at sof hw event
*/
struct cam_req_mgr_trigger_notify {
int32_t link_hdl;
int32_t dev_hdl;
int64_t frame_id;
uint32_t trigger;
- uint64_t sof_timestamp_val;
};
/**
diff --git a/drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_util.c b/drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_util.c
index ab7c3b61393d..dda04f8e5164 100644
--- a/drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_util.c
+++ b/drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_util.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -128,21 +128,6 @@ static int32_t cam_get_free_handle_index(void)
return idx;
}
-static void cam_dump_tbl_info(void)
-{
- int i;
-
- for (i = 0; i < CAM_REQ_MGR_MAX_HANDLES; i++)
- CAM_INFO(CAM_CRM, "session_hdl=%x hdl_value=%x\n"
- "type=%d state=%d dev_id=%lld",
- hdl_tbl->hdl[i].session_hdl,
- hdl_tbl->hdl[i].hdl_value,
- hdl_tbl->hdl[i].type,
- hdl_tbl->hdl[i].state,
- hdl_tbl->hdl[i].dev_id);
-
-}
-
int32_t cam_create_session_hdl(void *priv)
{
int idx;
@@ -159,7 +144,6 @@ int32_t cam_create_session_hdl(void *priv)
idx = cam_get_free_handle_index();
if (idx < 0) {
CAM_ERR(CAM_CRM, "Unable to create session handle");
- cam_dump_tbl_info();
spin_unlock_bh(&hdl_tbl_lock);
return idx;
}
@@ -193,7 +177,6 @@ int32_t cam_create_device_hdl(struct cam_create_dev_hdl *hdl_data)
idx = cam_get_free_handle_index();
if (idx < 0) {
CAM_ERR(CAM_CRM, "Unable to create device handle");
- cam_dump_tbl_info();
spin_unlock_bh(&hdl_tbl_lock);
return idx;
}
@@ -206,7 +189,6 @@ int32_t cam_create_device_hdl(struct cam_create_dev_hdl *hdl_data)
hdl_tbl->hdl[idx].state = HDL_ACTIVE;
hdl_tbl->hdl[idx].priv = hdl_data->priv;
hdl_tbl->hdl[idx].ops = hdl_data->ops;
- hdl_tbl->hdl[idx].dev_id = hdl_data->dev_id;
spin_unlock_bh(&hdl_tbl_lock);
pr_debug("%s: handle = %x", __func__, handle);
diff --git a/drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_util.h b/drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_util.h
index 50d6f309da15..7b8e3e601ed8 100644
--- a/drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_util.h
+++ b/drivers/media/platform/msm/ais/cam_req_mgr/cam_req_mgr_util.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -50,7 +50,6 @@ struct handle {
uint32_t hdl_value;
enum hdl_type type;
enum hdl_state state;
- uint64_t dev_id;
void *ops;
void *priv;
};
@@ -81,7 +80,6 @@ struct cam_create_dev_hdl {
int32_t v4l2_sub_dev_flag;
int32_t media_entity_flag;
int32_t reserved;
- uint64_t dev_id;
void *ops;
void *priv;
};
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/Makefile b/drivers/media/platform/msm/ais/cam_sensor_module/Makefile
index 5fab72e33cf3..478cf187cb7d 100644
--- a/drivers/media/platform/msm/ais/cam_sensor_module/Makefile
+++ b/drivers/media/platform/msm/ais/cam_sensor_module/Makefile
@@ -8,4 +8,3 @@ obj-$(CONFIG_MSM_AIS) += cam_sensor/
obj-$(CONFIG_MSM_AIS) += cam_flash/
obj-$(CONFIG_MSM_AIS) += cam_eeprom/
obj-$(CONFIG_MSM_AIS) += cam_ois/
-obj-$(CONFIG_MSM_AIS) += cam_ir_led/
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/cam_actuator/cam_actuator_core.c b/drivers/media/platform/msm/ais/cam_sensor_module/cam_actuator/cam_actuator_core.c
index 3bdc0f5e0b9f..edf7d23078ae 100644
--- a/drivers/media/platform/msm/ais/cam_sensor_module/cam_actuator/cam_actuator_core.c
+++ b/drivers/media/platform/msm/ais/cam_sensor_module/cam_actuator/cam_actuator_core.c
@@ -786,7 +786,7 @@ int32_t cam_actuator_driver_cmd(struct cam_actuator_ctrl_t *a_ctrl,
bridge_params.v4l2_sub_dev_flag = 0;
bridge_params.media_entity_flag = 0;
bridge_params.priv = a_ctrl;
- bridge_params.dev_id = CAM_ACTUATOR;
+
actuator_acq_dev.device_handle =
cam_create_device_hdl(&bridge_params);
a_ctrl->bridge_intf.device_hdl = actuator_acq_dev.device_handle;
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_core.c b/drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_core.c
index a06a4c6c6339..f41cb4753f39 100644
--- a/drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_core.c
+++ b/drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_core.c
@@ -1094,7 +1094,7 @@ static int32_t cam_cci_burst_read(struct v4l2_subdev *sd,
* RD_DONE exclusively.
*/
rem_jiffies = wait_for_completion_timeout(
- &cci_dev->cci_master_info[master].rd_done,
+ &cci_dev->cci_master_info[master].reset_complete,
CCI_TIMEOUT);
if (!rem_jiffies) {
rc = -ETIMEDOUT;
@@ -1275,11 +1275,10 @@ static int32_t cam_cci_read(struct v4l2_subdev *sd,
val = 1 << ((master * 2) + queue);
cam_io_w_mb(val, base + CCI_QUEUE_START_ADDR);
CAM_DBG(CAM_CCI,
- "waiting_for_rd_done [exp_words: %d]",
- ((read_cfg->num_byte / 4) + 1));
+ "waiting_for_rd_done [exp_words: %d]", exp_words);
rc = wait_for_completion_timeout(
- &cci_dev->cci_master_info[master].rd_done, CCI_TIMEOUT);
+ &cci_dev->cci_master_info[master].reset_complete, CCI_TIMEOUT);
if (rc <= 0) {
#ifdef DUMP_CCI_REGISTERS
cam_cci_dump_registers(cci_dev, master, queue);
@@ -1693,19 +1692,14 @@ int32_t cam_cci_core_cfg(struct v4l2_subdev *sd,
struct cam_cci_ctrl *cci_ctrl)
{
int32_t rc = 0;
- struct cci_device *cci_dev = v4l2_get_subdevdata(sd);
- CAM_DBG(CAM_CCI, "cmd %d", cci_ctrl->cmd);
+ CAM_DBG(CAM_CCI, "cmd %d", cci_ctrl->cmd);
switch (cci_ctrl->cmd) {
case MSM_CCI_INIT:
- mutex_lock(&cci_dev->init_mutex);
rc = cam_cci_init(sd, cci_ctrl);
- mutex_unlock(&cci_dev->init_mutex);
break;
case MSM_CCI_RELEASE:
- mutex_lock(&cci_dev->init_mutex);
rc = cam_cci_release(sd);
- mutex_unlock(&cci_dev->init_mutex);
break;
case MSM_CCI_I2C_READ:
rc = cam_cci_read_bytes(sd, cci_ctrl);
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_dev.c b/drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_dev.c
index 928625c182e1..7934aa50767c 100644
--- a/drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_dev.c
+++ b/drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_dev.c
@@ -71,26 +71,20 @@ irqreturn_t cam_cci_irq(int irq_num, void *data)
irq_status0 = cam_io_r_mb(base + CCI_IRQ_STATUS_0_ADDR);
irq_status1 = cam_io_r_mb(base + CCI_IRQ_STATUS_1_ADDR);
- CAM_DBG(CAM_CCI, "BASE: %pK", base);
CAM_DBG(CAM_CCI, "irq0:%x irq1:%x", irq_status0, irq_status1);
if (irq_status0 & CCI_IRQ_STATUS_0_RST_DONE_ACK_BMSK) {
- struct cam_cci_master_info *cci_master_info;
if (cci_dev->cci_master_info[MASTER_0].reset_pending == TRUE) {
- cci_master_info = &cci_dev->cci_master_info[MASTER_0];
cci_dev->cci_master_info[MASTER_0].reset_pending =
FALSE;
- if (!cci_master_info->status)
- complete(&cci_master_info->reset_complete);
- cci_master_info->status = 0;
+ complete(
+ &cci_dev->cci_master_info[MASTER_0].reset_complete);
}
if (cci_dev->cci_master_info[MASTER_1].reset_pending == TRUE) {
- cci_master_info = &cci_dev->cci_master_info[MASTER_1];
cci_dev->cci_master_info[MASTER_1].reset_pending =
FALSE;
- if (!cci_master_info->status)
- complete(&cci_master_info->reset_complete);
- cci_master_info->status = 0;
+ complete(
+ &cci_dev->cci_master_info[MASTER_1].reset_complete);
}
}
@@ -99,7 +93,7 @@ irqreturn_t cam_cci_irq(int irq_num, void *data)
cci_dev->cci_master_info[MASTER_0].status = 0;
rd_done_th_assert = true;
complete(&cci_dev->cci_master_info[MASTER_0].th_complete);
- complete(&cci_dev->cci_master_info[MASTER_0].rd_done);
+ complete(&cci_dev->cci_master_info[MASTER_0].reset_complete);
}
if ((irq_status0 & CCI_IRQ_STATUS_0_I2C_M0_RD_DONE_BMSK) &&
(!rd_done_th_assert)) {
@@ -108,7 +102,7 @@ irqreturn_t cam_cci_irq(int irq_num, void *data)
if (cci_dev->is_burst_read)
complete(
&cci_dev->cci_master_info[MASTER_0].th_complete);
- complete(&cci_dev->cci_master_info[MASTER_0].rd_done);
+ complete(&cci_dev->cci_master_info[MASTER_0].reset_complete);
}
if ((irq_status1 & CCI_IRQ_STATUS_1_I2C_M0_RD_THRESHOLD) &&
(!rd_done_th_assert)) {
@@ -155,7 +149,7 @@ irqreturn_t cam_cci_irq(int irq_num, void *data)
cci_dev->cci_master_info[MASTER_1].status = 0;
rd_done_th_assert = true;
complete(&cci_dev->cci_master_info[MASTER_1].th_complete);
- complete(&cci_dev->cci_master_info[MASTER_1].rd_done);
+ complete(&cci_dev->cci_master_info[MASTER_1].reset_complete);
}
if ((irq_status0 & CCI_IRQ_STATUS_0_I2C_M1_RD_DONE_BMSK) &&
(!rd_done_th_assert)) {
@@ -164,7 +158,7 @@ irqreturn_t cam_cci_irq(int irq_num, void *data)
if (cci_dev->is_burst_read)
complete(
&cci_dev->cci_master_info[MASTER_1].th_complete);
- complete(&cci_dev->cci_master_info[MASTER_1].rd_done);
+ complete(&cci_dev->cci_master_info[MASTER_1].reset_complete);
}
if ((irq_status1 & CCI_IRQ_STATUS_1_I2C_M1_RD_THRESHOLD) &&
(!rd_done_th_assert)) {
@@ -223,35 +217,16 @@ irqreturn_t cam_cci_irq(int irq_num, void *data)
}
if (irq_status0 & CCI_IRQ_STATUS_0_I2C_M0_ERROR_BMSK) {
cci_dev->cci_master_info[MASTER_0].status = -EINVAL;
- if (irq_status0 & CCI_IRQ_STATUS_0_I2C_M0_NACK_ERROR_BMSK)
- CAM_ERR(CAM_CCI, "Base:%pK, M0 NACK ERROR: 0x%x",
- base, irq_status0);
- if (irq_status0 & CCI_IRQ_STATUS_0_I2C_M0_Q0Q1_ERROR_BMSK)
- CAM_ERR(CAM_CCI,
- "Base:%pK, M0 QUEUE_OVER/UNDER_FLOW OR CMD ERR: 0x%x",
- base, irq_status0);
- if (irq_status0 & CCI_IRQ_STATUS_0_I2C_M0_RD_ERROR_BMSK)
- CAM_ERR(CAM_CCI,
- "Base: %pK, M0 RD_OVER/UNDER_FLOW ERROR: 0x%x",
- base, irq_status0);
- cam_io_w_mb(CCI_M0_HALT_REQ_RMSK, base + CCI_HALT_REQ_ADDR);
- complete(&cci_dev->cci_master_info[MASTER_0].rd_done);
+ cam_io_w_mb(CCI_M0_HALT_REQ_RMSK,
+ base + CCI_HALT_REQ_ADDR);
+ CAM_DBG(CAM_CCI, "MASTER_0 error 0x%x", irq_status0);
}
if (irq_status0 & CCI_IRQ_STATUS_0_I2C_M1_ERROR_BMSK) {
cci_dev->cci_master_info[MASTER_1].status = -EINVAL;
- if (irq_status0 & CCI_IRQ_STATUS_0_I2C_M0_NACK_ERROR_BMSK)
- CAM_ERR(CAM_CCI, "Base:%pK, M1 NACK ERROR: 0x%x",
- base, irq_status0);
- if (irq_status0 & CCI_IRQ_STATUS_0_I2C_M0_Q0Q1_ERROR_BMSK)
- CAM_ERR(CAM_CCI,
- "Base:%pK, M1 QUEUE_OVER_UNDER_FLOW OR CMD ERROR:0x%x",
- base, irq_status0);
- if (irq_status0 & CCI_IRQ_STATUS_0_I2C_M0_RD_ERROR_BMSK)
- CAM_ERR(CAM_CCI,
- "Base:%pK, M1 RD_OVER/UNDER_FLOW ERROR: 0x%x",
- base, irq_status0);
- cam_io_w_mb(CCI_M1_HALT_REQ_RMSK, base + CCI_HALT_REQ_ADDR);
- complete(&cci_dev->cci_master_info[MASTER_1].rd_done);
+ cam_io_w_mb(CCI_M1_HALT_REQ_RMSK,
+ base + CCI_HALT_REQ_ADDR);
+ CAM_DBG(CAM_CCI, "MASTER_1 error 0x%x", irq_status0);
+
}
cam_io_w_mb(irq_status0, base + CCI_IRQ_CLEAR_0_ADDR);
@@ -427,8 +402,7 @@ static int cam_cci_platform_probe(struct platform_device *pdev)
}
g_cci_subdev[soc_info->index] = &new_cci_dev->v4l2_dev_str.sd;
- mutex_init(&(new_cci_dev->init_mutex));
- CAM_INFO(CAM_CCI, "Device Type :%d", soc_info->index);
+ CAM_ERR(CAM_CCI, "Device Type :%d", soc_info->index);
cam_register_subdev_fops(&cci_v4l2_subdev_fops);
cci_v4l2_subdev_fops.unlocked_ioctl = cam_cci_subdev_fops_ioctl;
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_dev.h b/drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_dev.h
index 6a07b4d98e63..bbf3b0b145af 100644
--- a/drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_dev.h
+++ b/drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_dev.h
@@ -140,7 +140,6 @@ struct cam_cci_master_info {
uint8_t reset_pending;
struct mutex mutex;
struct completion reset_complete;
- struct completion rd_done;
struct completion th_complete;
struct mutex mutex_q[NUM_QUEUES];
struct completion report_q[NUM_QUEUES];
@@ -173,41 +172,40 @@ enum cam_cci_state_t {
/**
* struct cci_device
- * @pdev: Platform device
- * @subdev: V4L2 sub device
- * @base: Base address of CCI device
- * @hw_version: Hardware version
- * @ref_count: Reference Count
- * @cci_state: CCI state machine
- * @num_clk: Number of CCI clock
- * @cci_clk: CCI clock structure
- * @cci_clk_info: CCI clock information
- * @cam_cci_i2c_queue_info: CCI queue information
- * @i2c_freq_mode: I2C frequency of operations
- * @cci_clk_params: CCI hw clk params
- * @cci_gpio_tbl: CCI GPIO table
- * @cci_gpio_tbl_size: GPIO table size
- * @cci_pinctrl: Pinctrl structure
- * @cci_pinctrl_status: CCI pinctrl status
- * @cci_clk_src: CCI clk src rate
- * @cci_vreg: CCI regulator structure
- * @cci_reg_ptr: CCI individual regulator structure
- * @regulator_count: Regulator count
- * @support_seq_write: Set this flag when sequential write is enabled
- * @write_wq: Work queue structure
- * @valid_sync: Is it a valid sync with CSID
- * @v4l2_dev_str: V4L2 device structure
- * @cci_wait_sync_cfg: CCI sync config
- * @cycles_per_us: Cycles per micro sec
- * @payload_size: CCI packet payload size
- * @irq_status1: Store irq_status1 to be cleared after
- * draining FIFO buffer for burst read
- * @lock_status: to protect changes to irq_status1
- * @is_burst_read: Flag to determine if we are performing
- * a burst read operation or not
- * @irqs_disabled: Mask for IRQs that are disabled
- * @init_mutex: Mutex for maintaining refcount for attached
- * devices to cci during init/deinit.
+ * @pdev: Platform device
+ * @subdev: V4L2 sub device
+ * @base: Base address of CCI device
+ * @hw_version: Hardware version
+ * @ref_count: Reference Count
+ * @cci_state: CCI state machine
+ * @num_clk: Number of CCI clock
+ * @cci_clk: CCI clock structure
+ * @cci_clk_info: CCI clock information
+ * @cam_cci_i2c_queue_info: CCI queue information
+ * @i2c_freq_mode: I2C frequency of operations
+ * @cci_clk_params: CCI hw clk params
+ * @cci_gpio_tbl: CCI GPIO table
+ * @cci_gpio_tbl_size: GPIO table size
+ * @cci_pinctrl: Pinctrl structure
+ * @cci_pinctrl_status: CCI pinctrl status
+ * @cci_clk_src: CCI clk src rate
+ * @cci_vreg: CCI regulator structure
+ * @cci_reg_ptr: CCI individual regulator structure
+ * @regulator_count: Regulator count
+ * @support_seq_write:
+ * Set this flag when sequential write is enabled
+ * @write_wq: Work queue structure
+ * @valid_sync: Is it a valid sync with CSID
+ * @v4l2_dev_str: V4L2 device structure
+ * @cci_wait_sync_cfg: CCI sync config
+ * @cycles_per_us: Cycles per micro sec
+ * @payload_size: CCI packet payload size
+ * @irq_status1: Store irq_status1 to be cleared after
+ * draining FIFO buffer for burst read
+ * @lock_status: to protect changes to irq_status1
+ * @is_burst_read: Flag to determine if we are performing
+ * a burst read operation or not
+ * @irqs_disabled: Mask for IRQs that are disabled
*/
struct cci_device {
struct v4l2_subdev subdev;
@@ -236,7 +234,6 @@ struct cci_device {
spinlock_t lock_status;
bool is_burst_read;
uint32_t irqs_disabled;
- struct mutex init_mutex;
};
enum cam_cci_i2c_cmd_type {
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_hwreg.h b/drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_hwreg.h
index ead18afc77ad..027a0501dcae 100644
--- a/drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_hwreg.h
+++ b/drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_hwreg.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2015, 2017-2019, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2015, 2017-2018, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -61,12 +61,6 @@
#define CCI_IRQ_STATUS_0_I2C_M0_Q0_REPORT_BMSK 0x10
#define CCI_IRQ_STATUS_0_I2C_M0_ERROR_BMSK 0x18000EE6
#define CCI_IRQ_STATUS_0_I2C_M1_ERROR_BMSK 0x60EE6000
-#define CCI_IRQ_STATUS_0_I2C_M0_NACK_ERROR_BMSK 0x18000000
-#define CCI_IRQ_STATUS_0_I2C_M1_NACK_ERROR_BMSK 0x60000000
-#define CCI_IRQ_STATUS_0_I2C_M0_Q0Q1_ERROR_BMSK 0xEE0
-#define CCI_IRQ_STATUS_0_I2C_M1_Q0Q1_ERROR_BMSK 0xEE0000
-#define CCI_IRQ_STATUS_0_I2C_M0_RD_ERROR_BMSK 0x6
-#define CCI_IRQ_STATUS_0_I2C_M1_RD_ERROR_BMSK 0x6000
#define CCI_IRQ_STATUS_0_I2C_M0_RD_DONE_BMSK 0x1
#define CCI_IRQ_STATUS_1_I2C_M0_RD_THRESHOLD 0x10000
#define CCI_IRQ_STATUS_1_I2C_M0_RD_PAUSE 0x20000
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_soc.c b/drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_soc.c
index f66d86ce091e..fa290c0b982c 100644
--- a/drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_soc.c
+++ b/drivers/media/platform/msm/ais/cam_sensor_module/cam_cci/cam_cci_soc.c
@@ -19,7 +19,7 @@ int cam_cci_init(struct v4l2_subdev *sd,
uint8_t i = 0, j = 0;
int32_t rc = 0;
struct cci_device *cci_dev;
- enum cci_i2c_master_t master = c_ctrl->cci_info->cci_i2c_master;
+ enum cci_i2c_master_t master = MASTER_0;
struct cam_ahb_vote ahb_vote;
struct cam_axi_vote axi_vote;
struct cam_hw_soc_info *soc_info = NULL;
@@ -47,6 +47,7 @@ int cam_cci_init(struct v4l2_subdev *sd,
if (cci_dev->ref_count++) {
CAM_DBG(CAM_CCI, "ref_count %d", cci_dev->ref_count);
+ master = c_ctrl->cci_info->cci_i2c_master;
CAM_DBG(CAM_CCI, "master %d", master);
if (master < MASTER_MAX && master >= 0) {
mutex_lock(&cci_dev->cci_master_info[master].mutex);
@@ -54,8 +55,6 @@ int cam_cci_init(struct v4l2_subdev *sd,
/* Re-initialize the completion */
reinit_completion(
&cci_dev->cci_master_info[master].reset_complete);
- reinit_completion(
- &cci_dev->cci_master_info[master].rd_done);
for (i = 0; i < NUM_QUEUES; i++)
reinit_completion(
&cci_dev->cci_master_info[master].report_q[i]);
@@ -94,7 +93,6 @@ int cam_cci_init(struct v4l2_subdev *sd,
/* Re-initialize the completion */
reinit_completion(&cci_dev->cci_master_info[master].reset_complete);
- reinit_completion(&cci_dev->cci_master_info[master].rd_done);
for (i = 0; i < NUM_QUEUES; i++)
reinit_completion(
&cci_dev->cci_master_info[master].report_q[i]);
@@ -130,12 +128,12 @@ int cam_cci_init(struct v4l2_subdev *sd,
}
}
- cci_dev->cci_master_info[master].reset_pending = TRUE;
+ cci_dev->cci_master_info[MASTER_0].reset_pending = TRUE;
cam_io_w_mb(CCI_RESET_CMD_RMSK, base +
CCI_RESET_CMD_ADDR);
cam_io_w_mb(0x1, base + CCI_RESET_CMD_ADDR);
rc = wait_for_completion_timeout(
- &cci_dev->cci_master_info[master].reset_complete,
+ &cci_dev->cci_master_info[MASTER_0].reset_complete,
CCI_TIMEOUT);
if (rc <= 0) {
CAM_ERR(CAM_CCI, "wait_for_completion_timeout");
@@ -207,8 +205,6 @@ static void cam_cci_init_cci_params(struct cci_device *new_cci_dev)
&new_cci_dev->cci_master_info[i].reset_complete);
init_completion(
&new_cci_dev->cci_master_info[i].th_complete);
- init_completion(
- &new_cci_dev->cci_master_info[i].rd_done);
for (j = 0; j < NUM_QUEUES; j++) {
mutex_init(&new_cci_dev->cci_master_info[i].mutex_q[j]);
@@ -410,9 +406,7 @@ int cam_cci_soc_release(struct cci_device *cci_dev)
cci_dev->cci_state = CCI_STATE_DISABLED;
cci_dev->cycles_per_us = 0;
- rc = cam_cpas_stop(cci_dev->cpas_handle);
- if (rc)
- CAM_ERR(CAM_CCI, "cpas stop failed %d", rc);
+ cam_cpas_stop(cci_dev->cpas_handle);
return rc;
}
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/cam_csiphy/cam_csiphy_core.c b/drivers/media/platform/msm/ais/cam_sensor_module/cam_csiphy/cam_csiphy_core.c
index d24cb693d019..a8088caa73e0 100644
--- a/drivers/media/platform/msm/ais/cam_sensor_module/cam_csiphy/cam_csiphy_core.c
+++ b/drivers/media/platform/msm/ais/cam_sensor_module/cam_csiphy/cam_csiphy_core.c
@@ -550,7 +550,7 @@ int32_t cam_csiphy_config_dev(struct csiphy_device *csiphy_dev)
void cam_csiphy_shutdown(struct csiphy_device *csiphy_dev)
{
struct cam_hw_soc_info *soc_info;
- int32_t i = 0, rc = 0;
+ int32_t i = 0;
if (csiphy_dev->csiphy_state == CAM_CSIPHY_INIT)
return;
@@ -573,10 +573,7 @@ void cam_csiphy_shutdown(struct csiphy_device *csiphy_dev)
cam_csiphy_reset(csiphy_dev);
cam_soc_util_disable_platform_resource(soc_info, true, true);
- rc = cam_cpas_stop(csiphy_dev->cpas_handle);
- if (rc)
- CAM_ERR(CAM_CSIPHY, "cpas stop failed %d", rc);
-
+ cam_cpas_stop(csiphy_dev->cpas_handle);
csiphy_dev->csiphy_state = CAM_CSIPHY_ACQUIRE;
}
@@ -727,7 +724,7 @@ int32_t cam_csiphy_core_cfg(void *phy_dev,
bridge_params.v4l2_sub_dev_flag = 0;
bridge_params.media_entity_flag = 0;
bridge_params.priv = csiphy_dev;
- bridge_params.dev_id = CAM_CSIPHY;
+
if (csiphy_acq_params.combo_mode >= 2) {
CAM_ERR(CAM_CSIPHY, "Invalid combo_mode %d",
csiphy_acq_params.combo_mode);
@@ -936,10 +933,7 @@ int32_t cam_csiphy_core_cfg(void *phy_dev,
if (rc < 0) {
csiphy_dev->csiphy_info.secure_mode[offset] =
CAM_SECURE_MODE_NON_SECURE;
- rc = cam_cpas_stop(csiphy_dev->cpas_handle);
- if (rc < 0)
- CAM_ERR(CAM_CSIPHY,
- "de-voting CPAS: %d", rc);
+ cam_cpas_stop(csiphy_dev->cpas_handle);
goto release_mutex;
}
}
@@ -947,9 +941,7 @@ int32_t cam_csiphy_core_cfg(void *phy_dev,
rc = cam_csiphy_enable_hw(csiphy_dev);
if (rc != 0) {
CAM_ERR(CAM_CSIPHY, "cam_csiphy_enable_hw failed");
- rc = cam_cpas_stop(csiphy_dev->cpas_handle);
- if (rc < 0)
- CAM_ERR(CAM_CSIPHY, "de-voting CPAS: %d", rc);
+ cam_cpas_stop(csiphy_dev->cpas_handle);
goto release_mutex;
}
rc = cam_csiphy_config_dev(csiphy_dev);
@@ -959,9 +951,7 @@ int32_t cam_csiphy_core_cfg(void *phy_dev,
if (rc < 0) {
CAM_ERR(CAM_CSIPHY, "cam_csiphy_config_dev failed");
cam_csiphy_disable_hw(csiphy_dev);
- rc = cam_cpas_stop(csiphy_dev->cpas_handle);
- if (rc < 0)
- CAM_ERR(CAM_CSIPHY, "de-voting CPAS: %d", rc);
+ cam_cpas_stop(csiphy_dev->cpas_handle);
goto release_mutex;
}
csiphy_dev->start_dev_count++;
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/cam_csiphy/cam_csiphy_soc.c b/drivers/media/platform/msm/ais/cam_sensor_module/cam_csiphy/cam_csiphy_soc.c
index 416cb2a9fa96..0bf5aac2f090 100644
--- a/drivers/media/platform/msm/ais/cam_sensor_module/cam_csiphy/cam_csiphy_soc.c
+++ b/drivers/media/platform/msm/ais/cam_sensor_module/cam_csiphy/cam_csiphy_soc.c
@@ -272,7 +272,7 @@ int32_t cam_csiphy_parse_dt_info(struct platform_device *pdev,
csiphy_dev->hw_version = CSIPHY_VERSION_V12;
csiphy_dev->clk_lane = 0;
csiphy_dev->ctrl_reg->data_rates_settings_table =
- &data_rate_delta_table_1_2;
+ &data_rate_delta_table;
} else if (of_device_is_compatible(soc_info->dev->of_node,
"qcom,csiphy-v2.0")) {
csiphy_dev->ctrl_reg->csiphy_2ph_reg = csiphy_2ph_v2_0_reg;
@@ -288,8 +288,7 @@ int32_t cam_csiphy_parse_dt_info(struct platform_device *pdev,
csiphy_dev->hw_version = CSIPHY_VERSION_V20;
csiphy_dev->is_csiphy_3phase_hw = CSI_3PHASE_HW;
csiphy_dev->clk_lane = 0;
- csiphy_dev->ctrl_reg->data_rates_settings_table =
- &data_rate_delta_table_2_0;
+ csiphy_dev->ctrl_reg->data_rates_settings_table = NULL;
} else {
CAM_ERR(CAM_CSIPHY, "invalid hw version : 0x%x",
csiphy_dev->hw_version);
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/cam_csiphy/include/cam_csiphy_1_2_hwreg.h b/drivers/media/platform/msm/ais/cam_sensor_module/cam_csiphy/include/cam_csiphy_1_2_hwreg.h
index e4f8fd62a0c7..67653e81fde1 100644
--- a/drivers/media/platform/msm/ais/cam_sensor_module/cam_csiphy/include/cam_csiphy_1_2_hwreg.h
+++ b/drivers/media/platform/msm/ais/cam_sensor_module/cam_csiphy/include/cam_csiphy_1_2_hwreg.h
@@ -15,19 +15,19 @@
#include "../cam_csiphy_dev.h"
-static struct csiphy_reg_parms_t csiphy_v1_2 = {
+struct csiphy_reg_parms_t csiphy_v1_2 = {
.mipi_csiphy_interrupt_status0_addr = 0x8B0,
.mipi_csiphy_interrupt_clear0_addr = 0x858,
.mipi_csiphy_glbl_irq_cmd_addr = 0x828,
.csiphy_common_array_size = 6,
.csiphy_reset_array_size = 5,
- .csiphy_2ph_config_array_size = 22,
+ .csiphy_2ph_config_array_size = 21,
.csiphy_3ph_config_array_size = 38,
.csiphy_2ph_clock_lane = 0x1,
.csiphy_2ph_combo_ck_ln = 0x10,
};
-static struct csiphy_reg_t csiphy_common_reg_1_2[] = {
+struct csiphy_reg_t csiphy_common_reg_1_2[] = {
{0x0814, 0xd5, 0x00, CSIPHY_LANE_ENABLE},
{0x0818, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x081C, 0x02, 0x00, CSIPHY_2PH_REGS},
@@ -36,7 +36,7 @@ static struct csiphy_reg_t csiphy_common_reg_1_2[] = {
{0x0800, 0x0E, 0x00, CSIPHY_3PH_REGS},
};
-static struct csiphy_reg_t csiphy_reset_reg_1_2[] = {
+struct csiphy_reg_t csiphy_reset_reg_1_2[] = {
{0x0814, 0x00, 0x05, CSIPHY_LANE_ENABLE},
{0x0818, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x081C, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
@@ -44,7 +44,7 @@ static struct csiphy_reg_t csiphy_reset_reg_1_2[] = {
{0x0800, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
};
-static struct csiphy_reg_t csiphy_irq_reg_1_2[] = {
+struct csiphy_reg_t csiphy_irq_reg_1_2[] = {
{0x082c, 0xFF, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0830, 0xFF, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0834, 0xFB, 0x00, CSIPHY_DEFAULT_PARAMS},
@@ -58,7 +58,7 @@ static struct csiphy_reg_t csiphy_irq_reg_1_2[] = {
{0x0854, 0xFF, 0x00, CSIPHY_DEFAULT_PARAMS},
};
-static struct
+struct
csiphy_reg_t csiphy_2ph_v1_2_reg[MAX_LANES][MAX_SETTINGS_PER_LANE] = {
{
{0x0030, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
@@ -78,11 +78,10 @@ csiphy_reg_t csiphy_2ph_v1_2_reg[MAX_LANES][MAX_SETTINGS_PER_LANE] = {
{0x0000, 0x91, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0004, 0x0C, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0020, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0008, 0x10, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE},
+ {0x0008, 0x04, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE},
{0x000c, 0x00, 0x00, CSIPHY_DNP_PARAMS},
{0x0010, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0038, 0xFE, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0800, 0x02, 0x00, CSIPHY_DEFAULT_PARAMS},
},
{
{0x0730, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
@@ -106,7 +105,6 @@ csiphy_reg_t csiphy_2ph_v1_2_reg[MAX_LANES][MAX_SETTINGS_PER_LANE] = {
{0x070c, 0xFF, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0710, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0738, 0x1F, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0800, 0x02, 0x00, CSIPHY_DEFAULT_PARAMS},
},
{
{0x0230, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
@@ -130,7 +128,6 @@ csiphy_reg_t csiphy_2ph_v1_2_reg[MAX_LANES][MAX_SETTINGS_PER_LANE] = {
{0x020c, 0x00, 0x00, CSIPHY_DNP_PARAMS},
{0x0210, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0238, 0xFE, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0800, 0x02, 0x00, CSIPHY_DEFAULT_PARAMS},
},
{
{0x0430, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
@@ -154,7 +151,6 @@ csiphy_reg_t csiphy_2ph_v1_2_reg[MAX_LANES][MAX_SETTINGS_PER_LANE] = {
{0x040c, 0x00, 0x00, CSIPHY_DNP_PARAMS},
{0x0410, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0438, 0xFE, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0800, 0x02, 0x00, CSIPHY_DEFAULT_PARAMS},
},
{
{0x0630, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
@@ -178,11 +174,10 @@ csiphy_reg_t csiphy_2ph_v1_2_reg[MAX_LANES][MAX_SETTINGS_PER_LANE] = {
{0x060c, 0x00, 0x00, CSIPHY_DNP_PARAMS},
{0x0610, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0638, 0xFE, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0800, 0x02, 0x00, CSIPHY_DEFAULT_PARAMS},
},
};
-static struct csiphy_reg_t
+struct csiphy_reg_t
csiphy_2ph_v1_2_combo_mode_reg[MAX_LANES][MAX_SETTINGS_PER_LANE] = {
{
{0x0030, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
@@ -202,11 +197,10 @@ static struct csiphy_reg_t
{0x0000, 0x91, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0004, 0x0C, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0020, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0008, 0x10, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE},
+ {0x0008, 0x04, 0x00, CSIPHY_SETTLE_CNT_LOWER_BYTE},
{0x000c, 0x00, 0x00, CSIPHY_DNP_PARAMS},
{0x0010, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0038, 0xFE, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0800, 0x00, 0x00, CSIPHY_DNP_PARAMS},
},
{
{0x0730, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
@@ -230,7 +224,6 @@ static struct csiphy_reg_t
{0x070c, 0xFF, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0710, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0738, 0x1F, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0800, 0x00, 0x00, CSIPHY_DNP_PARAMS},
},
{
{0x0230, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
@@ -254,7 +247,6 @@ static struct csiphy_reg_t
{0x020c, 0x00, 0x00, CSIPHY_DNP_PARAMS},
{0x0210, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0238, 0xFE, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0800, 0x00, 0x00, CSIPHY_DNP_PARAMS},
},
{
{0x0430, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
@@ -278,7 +270,6 @@ static struct csiphy_reg_t
{0x040c, 0x00, 0x00, CSIPHY_DNP_PARAMS},
{0x0410, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0438, 0xFE, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0800, 0x00, 0x00, CSIPHY_DNP_PARAMS},
},
{
{0x0630, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
@@ -302,11 +293,10 @@ static struct csiphy_reg_t
{0x060c, 0xFF, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0610, 0x52, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0638, 0xFE, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0800, 0x00, 0x00, CSIPHY_DNP_PARAMS},
},
};
-static struct
+struct
csiphy_reg_t csiphy_3ph_v1_2_reg[MAX_LANES][MAX_SETTINGS_PER_LANE] = {
{
{0x015C, 0x66, 0x00, CSIPHY_DEFAULT_PARAMS},
@@ -430,7 +420,7 @@ csiphy_reg_t csiphy_3ph_v1_2_reg[MAX_LANES][MAX_SETTINGS_PER_LANE] = {
},
};
-static struct data_rate_settings_t data_rate_delta_table_1_2 = {
+struct data_rate_settings_t data_rate_delta_table = {
.num_data_rate_settings = 3,
.data_rate_settings = {
{
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/cam_csiphy/include/cam_csiphy_2_0_hwreg.h b/drivers/media/platform/msm/ais/cam_sensor_module/cam_csiphy/include/cam_csiphy_2_0_hwreg.h
index 72d929f04a7c..b7345d4abeeb 100644
--- a/drivers/media/platform/msm/ais/cam_sensor_module/cam_csiphy/include/cam_csiphy_2_0_hwreg.h
+++ b/drivers/media/platform/msm/ais/cam_sensor_module/cam_csiphy/include/cam_csiphy_2_0_hwreg.h
@@ -15,7 +15,7 @@
#include "../cam_csiphy_dev.h"
-static struct csiphy_reg_parms_t csiphy_v2_0 = {
+struct csiphy_reg_parms_t csiphy_v2_0 = {
.mipi_csiphy_interrupt_status0_addr = 0x8B0,
.mipi_csiphy_interrupt_clear0_addr = 0x858,
.mipi_csiphy_glbl_irq_cmd_addr = 0x828,
@@ -27,7 +27,7 @@ static struct csiphy_reg_parms_t csiphy_v2_0 = {
.csiphy_2ph_combo_ck_ln = 0x10,
};
-static struct csiphy_reg_t csiphy_common_reg_2_0[] = {
+struct csiphy_reg_t csiphy_common_reg_2_0[] = {
{0x0814, 0x00, 0x00, CSIPHY_LANE_ENABLE},
{0x0818, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x081C, 0x06, 0x00, CSIPHY_3PH_REGS},
@@ -38,7 +38,7 @@ static struct csiphy_reg_t csiphy_common_reg_2_0[] = {
{0x0564, 0x00, 0x00, CSIPHY_2PH_REGS},
};
-static struct csiphy_reg_t csiphy_reset_reg_2_0[] = {
+struct csiphy_reg_t csiphy_reset_reg_2_0[] = {
{0x0814, 0x00, 0x05, CSIPHY_LANE_ENABLE},
{0x0818, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x081C, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
@@ -46,7 +46,7 @@ static struct csiphy_reg_t csiphy_reset_reg_2_0[] = {
{0x0800, 0x00, 0x00, CSIPHY_DEFAULT_PARAMS},
};
-static struct csiphy_reg_t csiphy_irq_reg_2_0[] = {
+struct csiphy_reg_t csiphy_irq_reg_2_0[] = {
{0x082c, 0xff, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0830, 0xff, 0x01, CSIPHY_DEFAULT_PARAMS},
{0x0834, 0xfb, 0x00, CSIPHY_DEFAULT_PARAMS},
@@ -60,8 +60,7 @@ static struct csiphy_reg_t csiphy_irq_reg_2_0[] = {
{0x0854, 0xff, 0x00, CSIPHY_DEFAULT_PARAMS},
};
-static struct
- csiphy_reg_t csiphy_2ph_v2_0_reg[MAX_LANES][MAX_SETTINGS_PER_LANE] = {
+struct csiphy_reg_t csiphy_2ph_v2_0_reg[MAX_LANES][MAX_SETTINGS_PER_LANE] = {
{
{0x0030, 0x02, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x002C, 0x01, 0x00, CSIPHY_DEFAULT_PARAMS},
@@ -149,7 +148,7 @@ static struct
},
};
-static struct csiphy_reg_t
+struct csiphy_reg_t
csiphy_2ph_v2_0_combo_mode_reg[MAX_LANES][MAX_SETTINGS_PER_LANE] = {
{
{0x0030, 0x02, 0x00, CSIPHY_DEFAULT_PARAMS},
@@ -238,8 +237,7 @@ static struct csiphy_reg_t
},
};
-static struct
- csiphy_reg_t csiphy_3ph_v2_0_reg[MAX_LANES][MAX_SETTINGS_PER_LANE] = {
+struct csiphy_reg_t csiphy_3ph_v2_0_reg[MAX_LANES][MAX_SETTINGS_PER_LANE] = {
{
{0x015C, 0x23, 0x00, CSIPHY_DEFAULT_PARAMS},
{0x0104, 0x06, 0x00, CSIPHY_DEFAULT_PARAMS},
@@ -299,32 +297,4 @@ static struct
},
};
-static struct data_rate_settings_t data_rate_delta_table_2_0 = {
- .num_data_rate_settings = 2,
- .data_rate_settings = {
- {
- // data rate <= 2 Gsps
- // max bandwidth = 2 * 2.28 * (10**3) Mbps
- .bandwidth = 4560000000,
- .data_rate_reg_array_size = 3,
- .csiphy_data_rate_regs = {
- {0x0164, 0x50, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0364, 0x50, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0564, 0x50, 0x00, CSIPHY_DEFAULT_PARAMS}
- }
- },
- {
- // 2 Gsps <= data rate <= 2.5 Gsps
- // max bandwidth = 2.5 * 2.28 * (10**3) Mbps
- .bandwidth = 5700000000,
- .data_rate_reg_array_size = 3,
- .csiphy_data_rate_regs = {
- {0x0164, 0x40, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0364, 0x40, 0x00, CSIPHY_DEFAULT_PARAMS},
- {0x0564, 0x40, 0x00, CSIPHY_DEFAULT_PARAMS}
- }
- }
- }
-};
-
#endif /* _CAM_CSIPHY_2_0_HWREG_H_ */
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/cam_eeprom/cam_eeprom_core.c b/drivers/media/platform/msm/ais/cam_sensor_module/cam_eeprom/cam_eeprom_core.c
index c74be4cf4e45..3683fc73501b 100644
--- a/drivers/media/platform/msm/ais/cam_sensor_module/cam_eeprom/cam_eeprom_core.c
+++ b/drivers/media/platform/msm/ais/cam_sensor_module/cam_eeprom/cam_eeprom_core.c
@@ -356,7 +356,7 @@ static int32_t cam_eeprom_get_dev_handle(struct cam_eeprom_ctrl_t *e_ctrl,
bridge_params.v4l2_sub_dev_flag = 0;
bridge_params.media_entity_flag = 0;
bridge_params.priv = e_ctrl;
- bridge_params.dev_id = CAM_EEPROM;
+
eeprom_acq_dev.device_handle =
cam_create_device_hdl(&bridge_params);
e_ctrl->bridge_intf.device_hdl = eeprom_acq_dev.device_handle;
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/cam_eeprom/cam_eeprom_dev.h b/drivers/media/platform/msm/ais/cam_sensor_module/cam_eeprom/cam_eeprom_dev.h
index 9c36134a1b8f..7ffafc377da6 100644
--- a/drivers/media/platform/msm/ais/cam_sensor_module/cam_eeprom/cam_eeprom_dev.h
+++ b/drivers/media/platform/msm/ais/cam_sensor_module/cam_eeprom/cam_eeprom_dev.h
@@ -35,7 +35,7 @@
#define PROPERTY_MAXSIZE 32
#define MSM_EEPROM_MEMORY_MAP_MAX_SIZE 80
-#define MSM_EEPROM_MAX_MEM_MAP_CNT 16
+#define MSM_EEPROM_MAX_MEM_MAP_CNT 8
#define MSM_EEPROM_MEM_MAP_PROPERTIES_CNT 8
enum cam_eeprom_state {
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/cam_flash/cam_flash_dev.c b/drivers/media/platform/msm/ais/cam_sensor_module/cam_flash/cam_flash_dev.c
index f4c9d254df7c..1a0edb8d4d02 100644
--- a/drivers/media/platform/msm/ais/cam_sensor_module/cam_flash/cam_flash_dev.c
+++ b/drivers/media/platform/msm/ais/cam_sensor_module/cam_flash/cam_flash_dev.c
@@ -71,7 +71,7 @@ static int32_t cam_flash_driver_cmd(struct cam_flash_ctrl *fctrl,
bridge_params.v4l2_sub_dev_flag = 0;
bridge_params.media_entity_flag = 0;
bridge_params.priv = fctrl;
- bridge_params.dev_id = CAM_FLASH;
+
flash_acq_dev.device_handle =
cam_create_device_hdl(&bridge_params);
fctrl->bridge_intf.device_hdl =
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/Makefile b/drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/Makefile
deleted file mode 100644
index 2444a34c4dba..000000000000
--- a/drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-ccflags-y += -Idrivers/media/platform/msm/camera/cam_utils
-ccflags-y += -Idrivers/media/platform/msm/camera/cam_sync
-ccflags-y += -Idrivers/media/platform/msm/camera/cam_sensor_module/cam_res_mgr
-ccflags-y += -Idrivers/media/platform/msm/camera/cam_sensor_module/cam_sensor_utils
-ccflags-y += -Idrivers/media/platform/msm/camera/cam_sensor_module/cam_sensor_io
-ccflags-y += -Idrivers/media/platform/msm/camera/cam_sensor_module/cam_cci
-ccflags-y += -Idrivers/media/platform/msm/camera/cam_req_mgr
-ccflags-y += -Idrivers/media/platform/msm/camera/cam_smmu/
-
-obj-$(CONFIG_SPECTRA_CAMERA) += cam_ir_led_dev.o cam_ir_led_soc.o cam_ir_led_core.o
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/cam_ir_led_core.c b/drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/cam_ir_led_core.c
deleted file mode 100644
index 590e689bf72a..000000000000
--- a/drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/cam_ir_led_core.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Copyright (c) 2019, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-#include "cam_ir_led_core.h"
-
-int cam_ir_led_stop_dev(struct cam_ir_led_ctrl *ictrl)
-{
- return ictrl->func_tbl->camera_ir_led_off(ictrl);
-}
-
-int cam_ir_led_release_dev(struct cam_ir_led_ctrl *ictrl)
-{
- int rc = 0;
-
- if (ictrl->device_hdl != -1) {
- rc = cam_destroy_device_hdl(ictrl->device_hdl);
- if (rc)
- CAM_ERR(CAM_IR_LED,
- "Failed in destroying device handle rc = %d",
- rc);
- ictrl->device_hdl = -1;
- }
-
- return rc;
-}
-
-void cam_ir_led_shutdown(struct cam_ir_led_ctrl *ictrl)
-{
- int rc;
-
- if (ictrl->ir_led_state == CAM_IR_LED_STATE_INIT)
- return;
-
- if (ictrl->ir_led_state == CAM_IR_LED_STATE_ON) {
- rc = cam_ir_led_stop_dev(ictrl);
- if (rc)
- CAM_ERR(CAM_IR_LED, "Stop Failed rc: %d", rc);
- }
-
- rc = cam_ir_led_release_dev(ictrl);
- if (rc)
- CAM_ERR(CAM_IR_LED, "Release failed rc: %d", rc);
- else
- ictrl->ir_led_state = CAM_IR_LED_STATE_INIT;
-}
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/cam_ir_led_core.h b/drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/cam_ir_led_core.h
deleted file mode 100644
index b05aab2f2995..000000000000
--- a/drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/cam_ir_led_core.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright (c) 2019, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-#ifndef _CAM_IR_LED_CORE_H_
-#define _CAM_IR_LED_CORE_H_
-#include "cam_ir_led_dev.h"
-
-void cam_ir_led_shutdown(struct cam_ir_led_ctrl *ir_led_ctrl);
-int cam_ir_led_stop_dev(struct cam_ir_led_ctrl *ir_led_ctrl);
-int cam_ir_led_release_dev(struct cam_ir_led_ctrl *fctrl);
-#endif /*_CAM_IR_LED_CORE_H_*/
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/cam_ir_led_dev.c b/drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/cam_ir_led_dev.c
deleted file mode 100644
index 31dfb2c98fc8..000000000000
--- a/drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/cam_ir_led_dev.c
+++ /dev/null
@@ -1,583 +0,0 @@
-/* Copyright (c) 2019, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-#include <linux/module.h>
-#include <linux/pwm.h>
-#include "cam_ir_led_dev.h"
-#include "cam_ir_led_soc.h"
-#include "cam_ir_led_core.h"
-
-static struct cam_ir_led_table cam_pmic_ir_led_table;
-
-static struct cam_ir_led_table *ir_led_table[] = {
- &cam_pmic_ir_led_table,
-};
-
-static int32_t cam_pmic_ir_led_init(
- struct cam_ir_led_ctrl *ictrl)
-{
- return ictrl->func_tbl->camera_ir_led_off(ictrl);
-}
-
-static int32_t cam_pmic_ir_led_release(
- struct cam_ir_led_ctrl *ictrl)
-{
- int32_t rc = 0;
-
- CAM_DBG(CAM_IR_LED, "Enter");
- rc = ictrl->func_tbl->camera_ir_led_off(ictrl);
- if (rc < 0) {
- CAM_ERR(CAM_IR_LED, "camera_ir_led_off failed (%d)", rc);
- return rc;
- }
- return rc;
-}
-
-static int32_t cam_pmic_ir_led_off(struct cam_ir_led_ctrl *ictrl)
-{
- int32_t rc = 0;
-
- CAM_DBG(CAM_IR_LED, "Enter");
- if (ictrl->pwm_dev) {
- pwm_disable(ictrl->pwm_dev);
- } else {
- CAM_ERR(CAM_IR_LED, "pwm device is null");
- return -EINVAL;
- }
-
- rc = gpio_direction_input(
- ictrl->soc_info.gpio_data->cam_gpio_common_tbl[0].gpio);
- if (rc)
- CAM_ERR(CAM_IR_LED, "gpio operation failed(%d)", rc);
-
- return rc;
-}
-
-static int32_t cam_pmic_ir_led_on(
- struct cam_ir_led_ctrl *ictrl,
- struct cam_ir_led_set_on_off *ir_led_data)
-{
- int rc;
-
- if (ictrl->pwm_dev) {
- rc = pwm_config(ictrl->pwm_dev,
- ir_led_data->pwm_duty_on_ns,
- ir_led_data->pwm_period_ns);
- if (rc) {
- CAM_ERR(CAM_IR_LED, "PWM config failed (%d)", rc);
- return rc;
- }
-
- rc = pwm_enable(ictrl->pwm_dev);
- CAM_DBG(CAM_IR_LED, "enabled=%d, period=%llu, duty_cycle=%llu",
- ictrl->pwm_dev->state.enabled,
- ictrl->pwm_dev->state.period,
- ictrl->pwm_dev->state.duty_cycle);
- if (rc) {
- CAM_ERR(CAM_IR_LED, "PWM enable failed(%d)", rc);
- return rc;
- }
- rc = gpio_direction_output(
- ictrl->soc_info.gpio_data->cam_gpio_common_tbl[0].gpio,
- 1);
- if (rc) {
- CAM_ERR(CAM_IR_LED, "gpio operation failed(%d)", rc);
- return rc;
- }
- rc = gpio_direction_output(
- ictrl->soc_info.gpio_data->cam_gpio_common_tbl[1].gpio,
- 1);
- if (rc) {
- CAM_ERR(CAM_IR_LED, "gpio operation failed(%d)", rc);
- return rc;
- }
- } else {
- CAM_ERR(CAM_IR_LED, "pwm device is null");
- }
-
- return 0;
-}
-
-static int32_t cam_ir_led_handle_init(
- struct cam_ir_led_ctrl *ictrl)
-{
- uint32_t i = 0;
- int32_t rc = -EFAULT;
- enum cam_ir_led_driver_type ir_led_driver_type =
- ictrl->ir_led_driver_type;
-
- CAM_DBG(CAM_IR_LED, "IRLED HW type=%d", ir_led_driver_type);
- for (i = 0; i < ARRAY_SIZE(ir_led_table); i++) {
- if (ir_led_driver_type == ir_led_table[i]->ir_led_driver_type) {
- ictrl->func_tbl = &ir_led_table[i]->func_tbl;
- rc = 0;
- break;
- }
- }
-
- if (rc < 0) {
- CAM_ERR(CAM_IR_LED, "failed invalid ir_led_driver_type %d",
- ir_led_driver_type);
- return -EINVAL;
- }
-
- rc = ictrl->func_tbl->camera_ir_led_init(ictrl);
- if (rc < 0)
- CAM_ERR(CAM_IR_LED, "camera_ir_led_init failed (%d)", rc);
-
- return rc;
-}
-static int32_t cam_ir_led_config(struct cam_ir_led_ctrl *ictrl,
- void *arg)
-{
- int rc = 0;
- uint32_t *cmd_buf = NULL;
- uintptr_t generic_ptr;
- uint32_t *offset = NULL;
- size_t len_of_buffer;
- struct cam_control *ioctl_ctrl = NULL;
- struct cam_packet *csl_packet = NULL;
- struct cam_config_dev_cmd config;
- struct cam_cmd_buf_desc *cmd_desc = NULL;
- struct cam_ir_led_set_on_off *cam_ir_led_info = NULL;
-
- if (!ictrl || !arg) {
- CAM_ERR(CAM_IR_LED, "ictrl/arg is NULL");
- return -EINVAL;
- }
- /* getting CSL Packet */
- ioctl_ctrl = (struct cam_control *)arg;
-
- if (copy_from_user((&config), u64_to_user_ptr(ioctl_ctrl->handle),
- sizeof(config))) {
- CAM_ERR(CAM_IR_LED, "Copy cmd handle from user failed");
- rc = -EFAULT;
- return rc;
- }
-
- rc = cam_mem_get_cpu_buf(config.packet_handle,
- (uintptr_t *)&generic_ptr, &len_of_buffer);
- if (rc) {
- CAM_ERR(CAM_IR_LED, "Failed in getting the buffer : %d", rc);
- return rc;
- }
-
- if (config.offset > len_of_buffer) {
- CAM_ERR(CAM_IR_LED,
- "offset is out of bounds: offset: %lld len: %zu",
- config.offset, len_of_buffer);
- return -EINVAL;
- }
-
- /* Add offset to the ir_led csl header */
- csl_packet = (struct cam_packet *)(uintptr_t)(generic_ptr +
- config.offset);
-
- offset = (uint32_t *)((uint8_t *)&csl_packet->payload +
- csl_packet->cmd_buf_offset);
- cmd_desc = (struct cam_cmd_buf_desc *)(offset);
- rc = cam_mem_get_cpu_buf(cmd_desc->mem_handle,
- (uintptr_t *)&generic_ptr, &len_of_buffer);
- if (rc < 0) {
- CAM_ERR(CAM_IR_LED, "Failed to get the command Buffer");
- return -EINVAL;
- }
-
- cmd_buf = (uint32_t *)((uint8_t *)generic_ptr +
- cmd_desc->offset);
- cam_ir_led_info = (struct cam_ir_led_set_on_off *)cmd_buf;
-
- switch (csl_packet->header.op_code & 0xFFFFFF) {
- case CAM_IR_LED_PACKET_OPCODE_ON:
- rc = ictrl->func_tbl->camera_ir_led_on(
- ictrl, cam_ir_led_info);
- if (rc < 0) {
- CAM_ERR(CAM_IR_LED, "Fail to turn irled ON rc=%d", rc);
- return rc;
- }
- ictrl->ir_led_state = CAM_IR_LED_STATE_ON;
- break;
- case CAM_IR_LED_PACKET_OPCODE_OFF:
- if (ictrl->ir_led_state != CAM_IR_LED_STATE_ON) {
- CAM_DBG(CAM_IR_LED,
- "IRLED_OFF NA, Already OFF, state:%d",
- ictrl->ir_led_state);
- return 0;
- }
- rc = ictrl->func_tbl->camera_ir_led_off(ictrl);
- if (rc < 0) {
- CAM_ERR(CAM_IR_LED, "Fail to turn irled OFF rc=%d", rc);
- return rc;
- }
- ictrl->ir_led_state = CAM_IR_LED_STATE_OFF;
- break;
- case CAM_PKT_NOP_OPCODE:
- CAM_DBG(CAM_IR_LED, "CAM_PKT_NOP_OPCODE");
- break;
- default:
- CAM_ERR(CAM_IR_LED, "Invalid Opcode : %d",
- (csl_packet->header.op_code & 0xFFFFFF));
- return -EINVAL;
- }
-
- return rc;
-}
-
-static int32_t cam_ir_led_driver_cmd(struct cam_ir_led_ctrl *ictrl,
- void *arg, struct cam_ir_led_private_soc *soc_private)
-{
- int rc = 0;
- struct cam_control *cmd = (struct cam_control *)arg;
- struct cam_sensor_acquire_dev ir_led_acq_dev;
- struct cam_create_dev_hdl dev_hdl;
- struct cam_ir_led_query_cap_info ir_led_cap = {0};
-
- if (!ictrl || !arg) {
- CAM_ERR(CAM_IR_LED, "ictrl/arg is NULL with arg:%pK ictrl%pK",
- ictrl, arg);
- return -EINVAL;
- }
-
- if (cmd->handle_type != CAM_HANDLE_USER_POINTER) {
- CAM_ERR(CAM_IR_LED, "Invalid handle type: %d",
- cmd->handle_type);
- return -EINVAL;
- }
-
- mutex_lock(&(ictrl->ir_led_mutex));
- CAM_DBG(CAM_IR_LED, "cmd->op_code %d", cmd->op_code);
- switch (cmd->op_code) {
- case CAM_ACQUIRE_DEV:
- if (ictrl->ir_led_state != CAM_IR_LED_STATE_INIT) {
- CAM_ERR(CAM_IR_LED,
- "Cannot apply Acquire dev: Prev state: %d",
- ictrl->ir_led_state);
- rc = -EINVAL;
- goto release_mutex;
- }
-
- rc = copy_from_user(&ir_led_acq_dev,
- u64_to_user_ptr(cmd->handle),
- sizeof(ir_led_acq_dev));
- if (rc) {
- CAM_ERR(CAM_IR_LED, "Failed Copy from User rc=%d", rc);
- goto release_mutex;
- }
-
- dev_hdl.priv = ictrl;
-
- ir_led_acq_dev.device_handle =
- cam_create_device_hdl(&dev_hdl);
- ictrl->device_hdl =
- ir_led_acq_dev.device_handle;
-
- rc = copy_to_user(u64_to_user_ptr(cmd->handle), &ir_led_acq_dev,
- sizeof(struct cam_sensor_acquire_dev));
- if (rc) {
- CAM_ERR(CAM_IR_LED, "Failed Copy to User rc=%d", rc);
- rc = -EFAULT;
- goto release_mutex;
- }
- rc = cam_ir_led_handle_init(ictrl);
- ictrl->ir_led_state = CAM_IR_LED_STATE_ACQUIRE;
- break;
- case CAM_RELEASE_DEV:
- if ((ictrl->ir_led_state == CAM_IR_LED_STATE_INIT) ||
- (ictrl->ir_led_state == CAM_IR_LED_STATE_START)) {
- CAM_WARN(CAM_IR_LED,
- " Cannot apply Release dev: Prev state:%d",
- ictrl->ir_led_state);
- }
-
- if (ictrl->device_hdl == -1 &&
- ictrl->ir_led_state == CAM_IR_LED_STATE_ACQUIRE) {
- CAM_ERR(CAM_IR_LED,
- " Invalid Handle: device hdl: %d",
- ictrl->device_hdl);
- rc = -EINVAL;
- goto release_mutex;
- }
- rc = cam_ir_led_release_dev(ictrl);
- if (rc)
- CAM_ERR(CAM_IR_LED,
- " Failed in destroying the device Handle rc= %d",
- rc);
- ictrl->ir_led_state = CAM_IR_LED_STATE_INIT;
- break;
- case CAM_QUERY_CAP:
- ir_led_cap.slot_info = ictrl->soc_info.index;
-
- if (copy_to_user(u64_to_user_ptr(cmd->handle), &ir_led_cap,
- sizeof(struct cam_ir_led_query_cap_info))) {
- CAM_ERR(CAM_IR_LED, " Failed Copy to User");
- rc = -EFAULT;
- goto release_mutex;
- }
- break;
- case CAM_START_DEV:
- if (ictrl->ir_led_state != CAM_IR_LED_STATE_ACQUIRE) {
- CAM_ERR(CAM_IR_LED,
- "Cannot apply Start Dev: Prev state: %d",
- ictrl->ir_led_state);
- rc = -EINVAL;
- goto release_mutex;
- }
- ictrl->ir_led_state = CAM_IR_LED_STATE_START;
- break;
- case CAM_STOP_DEV:
- rc = cam_ir_led_stop_dev(ictrl);
- if (rc) {
- CAM_ERR(CAM_IR_LED, "Failed STOP_DEV: rc=%d", rc);
- goto release_mutex;
- }
- ictrl->ir_led_state = CAM_IR_LED_STATE_ACQUIRE;
- break;
- case CAM_CONFIG_DEV:
- if ((ictrl->ir_led_state == CAM_IR_LED_STATE_INIT) ||
- (ictrl->ir_led_state == CAM_IR_LED_STATE_ACQUIRE)) {
- CAM_ERR(CAM_IR_LED,
- "Cannot apply Config Dev: Prev state: %d",
- ictrl->ir_led_state);
- rc = -EINVAL;
- goto release_mutex;
- }
- rc = cam_ir_led_config(ictrl, arg);
- if (rc) {
- CAM_ERR(CAM_IR_LED, "Failed CONFIG_DEV: rc=%d", rc);
- goto release_mutex;
- }
- break;
- case CAM_FLUSH_REQ:
- rc = cam_ir_led_stop_dev(ictrl);
- if (rc) {
- CAM_ERR(CAM_IR_LED, "Failed FLUSH_REQ: rc=%d", rc);
- goto release_mutex;
- }
- ictrl->ir_led_state = CAM_IR_LED_STATE_ACQUIRE;
- break;
- default:
- CAM_ERR(CAM_IR_LED, "Invalid Opcode:%d", cmd->op_code);
- rc = -EINVAL;
- }
-
-release_mutex:
- mutex_unlock(&(ictrl->ir_led_mutex));
- return rc;
-}
-
-static const struct of_device_id cam_ir_led_dt_match[] = {
- {.compatible = "qcom,camera-ir-led", .data = NULL},
- {}
-};
-
-static long cam_ir_led_subdev_ioctl(struct v4l2_subdev *sd,
- unsigned int cmd, void *arg)
-{
- int rc = 0;
- struct cam_ir_led_ctrl *ictrl = NULL;
- struct cam_ir_led_private_soc *soc_private = NULL;
-
- CAM_DBG(CAM_IR_LED, "Enter");
-
- ictrl = v4l2_get_subdevdata(sd);
- soc_private = ictrl->soc_info.soc_private;
-
- switch (cmd) {
- case VIDIOC_CAM_CONTROL:
- rc = cam_ir_led_driver_cmd(ictrl, arg,
- soc_private);
- break;
- default:
- CAM_ERR(CAM_IR_LED, " Invalid ioctl cmd type");
- rc = -EINVAL;
- break;
- }
-
- CAM_DBG(CAM_IR_LED, "Exit");
- return rc;
-}
-
-#ifdef CONFIG_COMPAT
-static long cam_ir_led_subdev_do_ioctl(struct v4l2_subdev *sd,
- unsigned int cmd, unsigned long arg)
-{
- struct cam_control cmd_data;
- int32_t rc = 0;
-
- if (copy_from_user(&cmd_data, (void __user *)arg,
- sizeof(cmd_data))) {
- CAM_ERR(CAM_IR_LED,
- " Failed to copy from user_ptr=%pK size=%zu",
- (void __user *)arg, sizeof(cmd_data));
- return -EFAULT;
- }
-
- switch (cmd) {
- case VIDIOC_CAM_CONTROL:
- rc = cam_ir_led_subdev_ioctl(sd, cmd, &cmd_data);
- if (rc)
- CAM_ERR(CAM_IR_LED, "cam_ir_led_ioctl failed");
- break;
- default:
- CAM_ERR(CAM_IR_LED, " Invalid compat ioctl cmd_type:%d",
- cmd);
- rc = -EINVAL;
- }
-
- if (!rc) {
- if (copy_to_user((void __user *)arg, &cmd_data,
- sizeof(cmd_data))) {
- CAM_ERR(CAM_IR_LED,
- " Failed to copy to user_ptr=%pK size=%zu",
- (void __user *)arg, sizeof(cmd_data));
- rc = -EFAULT;
- }
- }
-
- return rc;
-}
-#endif
-
-static int cam_ir_led_platform_remove(struct platform_device *pdev)
-{
- struct cam_ir_led_ctrl *ictrl;
-
- ictrl = platform_get_drvdata(pdev);
- if (!ictrl) {
- CAM_ERR(CAM_IR_LED, " Ir_led device is NULL");
- return 0;
- }
-
- kfree(ictrl);
-
- return 0;
-}
-
-static int cam_ir_led_subdev_close(struct v4l2_subdev *sd,
- struct v4l2_subdev_fh *fh)
-{
- struct cam_ir_led_ctrl *ictrl =
- v4l2_get_subdevdata(sd);
-
- if (!ictrl) {
- CAM_ERR(CAM_IR_LED, " Ir_led ctrl ptr is NULL");
- return -EINVAL;
- }
-
- mutex_lock(&ictrl->ir_led_mutex);
- cam_ir_led_shutdown(ictrl);
- mutex_unlock(&ictrl->ir_led_mutex);
-
- return 0;
-}
-
-static struct v4l2_subdev_core_ops cam_ir_led_subdev_core_ops = {
- .ioctl = cam_ir_led_subdev_ioctl,
-#ifdef CONFIG_COMPAT
- .compat_ioctl32 = cam_ir_led_subdev_do_ioctl
-#endif
-};
-
-static struct v4l2_subdev_ops cam_ir_led_subdev_ops = {
- .core = &cam_ir_led_subdev_core_ops,
-};
-
-static const struct v4l2_subdev_internal_ops cam_ir_led_internal_ops = {
- .close = cam_ir_led_subdev_close,
-};
-
-static int32_t cam_ir_led_platform_probe(struct platform_device *pdev)
-{
- int32_t rc = 0;
- struct cam_ir_led_ctrl *ictrl = NULL;
-
- CAM_DBG(CAM_IR_LED, "Enter");
- if (!pdev->dev.of_node) {
- CAM_ERR(CAM_IR_LED, "of_node NULL");
- return -EINVAL;
- }
-
- ictrl = kzalloc(sizeof(struct cam_ir_led_ctrl), GFP_KERNEL);
- if (!ictrl) {
- CAM_ERR(CAM_IR_LED, "kzalloc failed!!");
- return -ENOMEM;
- }
-
- ictrl->pdev = pdev;
- ictrl->soc_info.pdev = pdev;
- ictrl->soc_info.dev = &pdev->dev;
- ictrl->soc_info.dev_name = pdev->name;
-
- rc = cam_ir_led_get_dt_data(ictrl, &ictrl->soc_info);
- if (rc) {
- CAM_ERR(CAM_IR_LED, "cam_ir_led_get_dt_data failed rc=%d", rc);
- if (ictrl->soc_info.soc_private != NULL) {
- kfree(ictrl->soc_info.soc_private);
- ictrl->soc_info.soc_private = NULL;
- }
- kfree(ictrl);
- ictrl = NULL;
- return -EINVAL;
- }
-
- ictrl->v4l2_dev_str.internal_ops =
- &cam_ir_led_internal_ops;
- ictrl->v4l2_dev_str.ops = &cam_ir_led_subdev_ops;
- ictrl->v4l2_dev_str.name = CAMX_IR_LED_DEV_NAME;
- ictrl->v4l2_dev_str.sd_flags =
- V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS;
- ictrl->v4l2_dev_str.ent_function = CAM_IRLED_DEVICE_TYPE;
- ictrl->v4l2_dev_str.token = ictrl;
-
- rc = cam_register_subdev(&(ictrl->v4l2_dev_str));
- if (rc) {
- CAM_ERR(CAM_IR_LED, "Fail to create subdev with %d", rc);
- kfree(ictrl);
- return rc;
- }
-
- ictrl->device_hdl = -1;
- platform_set_drvdata(pdev, ictrl);
- v4l2_set_subdevdata(&ictrl->v4l2_dev_str.sd, ictrl);
- mutex_init(&(ictrl->ir_led_mutex));
- ictrl->ir_led_state = CAM_IR_LED_STATE_INIT;
- return rc;
-}
-
-static struct cam_ir_led_table cam_pmic_ir_led_table = {
- .ir_led_driver_type = IR_LED_DRIVER_PMIC,
- .func_tbl = {
- .camera_ir_led_init = &cam_pmic_ir_led_init,
- .camera_ir_led_release = &cam_pmic_ir_led_release,
- .camera_ir_led_off = &cam_pmic_ir_led_off,
- .camera_ir_led_on = &cam_pmic_ir_led_on,
- },
-};
-
-MODULE_DEVICE_TABLE(of, cam_ir_led_dt_match);
-
-static struct platform_driver cam_ir_led_platform_driver = {
- .probe = cam_ir_led_platform_probe,
- .remove = cam_ir_led_platform_remove,
- .driver = {
- .name = "CAM-IR-LED-DRIVER",
- .owner = THIS_MODULE,
- .of_match_table = cam_ir_led_dt_match,
- .suppress_bind_attrs = true,
- },
-};
-
-module_platform_driver(cam_ir_led_platform_driver);
-
-MODULE_DESCRIPTION("CAM IR_LED");
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/cam_ir_led_dev.h b/drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/cam_ir_led_dev.h
deleted file mode 100644
index 7549435ae92b..000000000000
--- a/drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/cam_ir_led_dev.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/* Copyright (c) 2019, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-#ifndef _CAM_IR_LED_DEV_H_
-#define _CAM_IR_LED_DEV_H_
-
-#include <linux/leds.h>
-#include <linux/platform_device.h>
-#include <linux/delay.h>
-#include <linux/io.h>
-#include <linux/of.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/gpio.h>
-#include <media/v4l2-subdev.h>
-#include <media/v4l2-ioctl.h>
-#include <media/v4l2-event.h>
-#include <media/cam_sensor.h>
-#include <media/cam_req_mgr.h>
-#include "cam_req_mgr_util.h"
-#include "cam_req_mgr_interface.h"
-#include "cam_subdev.h"
-#include "cam_mem_mgr.h"
-#include "cam_sensor_cmn_header.h"
-#include "cam_soc_util.h"
-#include "cam_debug_util.h"
-
-#define CAMX_IR_LED_DEV_NAME "cam-ir-led-dev"
-#define CAM_IR_LED_PIPELINE_DELAY 1
-#define CAM_IR_LED_PACKET_OPCODE_OFF 0
-#define CAM_IR_LED_PACKET_OPCODE_ON 1
-
-enum cam_ir_led_switch_trigger_ops {
- LED_SWITCH_OFF = 0,
- LED_SWITCH_ON,
-};
-
-enum cam_ir_led_driver_type {
- IR_LED_DRIVER_GPIO,
- IR_LED_DRIVER_PMIC,
- IR_LED_DRIVER_DEFAULT,
-};
-
-enum cam_ir_led_state {
- CAM_IR_LED_STATE_INIT = 0,
- CAM_IR_LED_STATE_ACQUIRE,
- CAM_IR_LED_STATE_START,
- CAM_IR_LED_STATE_ON,
- CAM_IR_LED_STATE_OFF,
-};
-
-/**
- * struct cam_ir_led_intf_params
- * @device_hdl : Device Handle
- * @session_hdl : Session Handle
- * @link_hdl : Link Handle
- * @ops : KMD operations
- * @crm_cb : Callback API pointers
- */
-struct cam_ir_led_intf_params {
- int32_t device_hdl;
- int32_t session_hdl;
- int32_t link_hdl;
- struct cam_req_mgr_kmd_ops ops;
- struct cam_req_mgr_crm_cb *crm_cb;
-};
-
-/**
- * struct cam_ir_led_common_attr
- * @is_settings_valid : Notify the valid settings
- * @request_id : Request id provided by umd
- * @count : Number of led count
- * @cmd_type : Command buffer type
- */
-struct cam_ir_led_common_attr {
- bool is_settings_valid;
- uint64_t request_id;
- uint16_t count;
- uint8_t cmd_type;
-};
-
-/**
- * struct ir_led_init_packet
- * @cmn_attr : Provides common attributes
- * @ir_led_type : Ir_led type(PMIC/I2C/GPIO)
- */
-struct cam_ir_led_init_packet {
- struct cam_ir_led_common_attr cmn_attr;
- uint8_t ir_led_type;
-};
-
-/**
- * struct cam_ir_led_private_soc
- * @switch_trigger_name : Switch trigger name
- * @ir_led_trigger_name : Ir_led trigger name array
- * @ir_led_op_current : Ir_led operational current
- * @ir_led_max_current : Max supported current for LED in ir_led mode
- * @ir_led_max_duration : Max turn on duration for LED in Ir_led mode
- * @torch_trigger_name : Torch trigger name array
- * @torch_op_current : Torch operational current
- * @torch_max_current : Max supported current for LED in torch mode
- */
-
-struct cam_ir_led_private_soc {
- const char *switch_trigger_name;
- const char *ir_led_trigger_name;
- uint32_t ir_led_op_current;
- uint32_t ir_led_max_current;
- uint32_t ir_led_max_duration;
- const char *torch_trigger_name;
- uint32_t torch_op_current;
- uint32_t torch_max_current;
-};
-
-/**
- * struct cam_ir_led_ctrl
- * @soc_info : Soc related information
- * @pdev : Platform device
- * @pwm_dev : PWM device handle
- * @func_tbl : structure of h/w specific function pointers
- * @of_node : Of Node ptr
- * @v4l2_dev_str : V4L2 device structure
- * @ir_led_mutex : Mutex for ir_led operations
- * @ir_led_state : Current ir_led state (INIT/ACQUIRE/START/ON/OFF)
- * @device_hdl : Device Handle
- * @ir_led_driver_type : ir_led driver type (GPIO/PWM)
- */
-struct cam_ir_led_ctrl {
- struct cam_hw_soc_info soc_info;
- struct platform_device *pdev;
- struct pwm_device *pwm_dev;
- struct cam_ir_led_func *func_tbl;
- struct device_node *of_node;
- struct cam_subdev v4l2_dev_str;
- struct mutex ir_led_mutex;
- enum cam_ir_led_state ir_led_state;
- int32_t device_hdl;
- enum cam_ir_led_driver_type ir_led_driver_type;
-};
-
-struct cam_ir_led_func {
- int32_t (*camera_ir_led_init)(struct cam_ir_led_ctrl *);
- int32_t (*camera_ir_led_release)(struct cam_ir_led_ctrl *);
- int32_t (*camera_ir_led_off)(struct cam_ir_led_ctrl *);
- int32_t (*camera_ir_led_on)(struct cam_ir_led_ctrl *,
- struct cam_ir_led_set_on_off *);
-};
-
-struct cam_ir_led_table {
- enum cam_ir_led_driver_type ir_led_driver_type;
- struct cam_ir_led_func func_tbl;
-};
-
-#endif /*_CAM_IR_LED_DEV_H_*/
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/cam_ir_led_soc.c b/drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/cam_ir_led_soc.c
deleted file mode 100644
index cb0262fe2767..000000000000
--- a/drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/cam_ir_led_soc.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Copyright (c) 2019, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-#include <linux/of.h>
-#include <linux/of_gpio.h>
-#include <linux/pwm.h>
-#include "cam_ir_led_soc.h"
-#include "cam_res_mgr_api.h"
-
-int cam_ir_led_get_dt_data(struct cam_ir_led_ctrl *ictrl,
- struct cam_hw_soc_info *soc_info)
-{
- int32_t rc = 0;
-
- if (!ictrl) {
- CAM_ERR(CAM_IR_LED, "NULL ir_led control structure");
- return -EINVAL;
- }
-
- rc = cam_soc_util_get_dt_properties(soc_info);
- if (rc < 0) {
- CAM_ERR(CAM_IR_LED, "get_dt_properties failed rc %d", rc);
- return rc;
- }
-
- soc_info->soc_private =
- kzalloc(sizeof(struct cam_ir_led_private_soc), GFP_KERNEL);
- if (!soc_info->soc_private) {
- CAM_ERR(CAM_IR_LED, "soc_info->soc_private is NULL");
- rc = -ENOMEM;
- goto release_soc_res;
- }
-
- if (of_property_read_bool(soc_info->dev->of_node, "pwms")) {
- ictrl->pwm_dev = of_pwm_get(ictrl->pdev->dev.of_node, NULL);
- if (ictrl->pwm_dev == NULL)
- CAM_ERR(CAM_IR_LED, "Cannot get PWM device");
- ictrl->ir_led_driver_type = IR_LED_DRIVER_PMIC;
- } else {
- ictrl->ir_led_driver_type = IR_LED_DRIVER_GPIO;
- }
-
- return rc;
-
-release_soc_res:
- cam_soc_util_release_platform_resource(soc_info);
- return rc;
-}
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/cam_ir_led_soc.h b/drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/cam_ir_led_soc.h
deleted file mode 100644
index 3a9139ae2cc1..000000000000
--- a/drivers/media/platform/msm/ais/cam_sensor_module/cam_ir_led/cam_ir_led_soc.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Copyright (c) 2019, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-#ifndef _CAM_IR_LED_SOC_H_
-#define _CAM_IR_LED_SOC_H_
-
-#include "cam_ir_led_dev.h"
-
-int cam_ir_led_get_dt_data(struct cam_ir_led_ctrl *fctrl,
- struct cam_hw_soc_info *soc_info);
-
-#endif /*_CAM_IR_LED_SOC_H_*/
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/cam_ois/cam_ois_core.c b/drivers/media/platform/msm/ais/cam_sensor_module/cam_ois/cam_ois_core.c
index 937c46ab5033..ce854fddddce 100644
--- a/drivers/media/platform/msm/ais/cam_sensor_module/cam_ois/cam_ois_core.c
+++ b/drivers/media/platform/msm/ais/cam_sensor_module/cam_ois/cam_ois_core.c
@@ -90,7 +90,7 @@ static int cam_ois_get_dev_handle(struct cam_ois_ctrl_t *o_ctrl,
bridge_params.v4l2_sub_dev_flag = 0;
bridge_params.media_entity_flag = 0;
bridge_params.priv = o_ctrl;
- bridge_params.dev_id = CAM_OIS;
+
ois_acq_dev.device_handle =
cam_create_device_hdl(&bridge_params);
o_ctrl->bridge_intf.device_hdl = ois_acq_dev.device_handle;
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/cam_sensor/cam_sensor_core.c b/drivers/media/platform/msm/ais/cam_sensor_module/cam_sensor/cam_sensor_core.c
index c129f1d8c6fd..cf44b36afb87 100644
--- a/drivers/media/platform/msm/ais/cam_sensor_module/cam_sensor/cam_sensor_core.c
+++ b/drivers/media/platform/msm/ais/cam_sensor_module/cam_sensor/cam_sensor_core.c
@@ -631,8 +631,6 @@ void cam_sensor_query_cap(struct cam_sensor_ctrl_t *s_ctrl,
s_ctrl->sensordata->subdev_id[SUB_MODULE_LED_FLASH];
query_cap->ois_slot_id =
s_ctrl->sensordata->subdev_id[SUB_MODULE_OIS];
- query_cap->ir_led_slot_id =
- s_ctrl->sensordata->subdev_id[SUB_MODULE_IR_LED];
query_cap->slot_info =
s_ctrl->soc_info.index;
}
@@ -1216,7 +1214,7 @@ free_probe_cmd:
bridge_params.v4l2_sub_dev_flag = 0;
bridge_params.media_entity_flag = 0;
bridge_params.priv = s_ctrl;
- bridge_params.dev_id = CAM_SENSOR;
+
sensor_acq_dev.device_handle =
cam_create_device_hdl(&bridge_params);
s_ctrl->bridge_intf.device_hdl = sensor_acq_dev.device_handle;
@@ -1367,16 +1365,6 @@ free_probe_cmd:
}
break;
case CAM_CONFIG_DEV: {
- if (s_ctrl->sensor_state < CAM_SENSOR_ACQUIRE) {
- rc = -EINVAL;
- CAM_ERR(CAM_SENSOR,
- "sensor_id:[0x%x] not acquired to configure [%d] ",
- s_ctrl->sensordata->slave_info.sensor_id,
- s_ctrl->sensor_state
- );
- goto release_mutex;
- }
-
rc = cam_sensor_i2c_pkt_parse(s_ctrl, arg);
if (rc < 0) {
CAM_ERR(CAM_SENSOR, "Failed i2c pkt parse: %d", rc);
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/cam_sensor/cam_sensor_soc.c b/drivers/media/platform/msm/ais/cam_sensor_module/cam_sensor/cam_sensor_soc.c
index 8cdd99b6edab..25d8fc06a1ec 100644
--- a/drivers/media/platform/msm/ais/cam_sensor_module/cam_sensor/cam_sensor_soc.c
+++ b/drivers/media/platform/msm/ais/cam_sensor_module/cam_sensor/cam_sensor_soc.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -98,21 +98,6 @@ int32_t cam_sensor_get_sub_module_index(struct device_node *of_node,
else
sensor_info->subdev_id[SUB_MODULE_CSIPHY] = val;
- src_node = of_parse_phandle(of_node, "ir-led-src", 0);
- if (!src_node) {
- CAM_DBG(CAM_SENSOR, "ir led src_node NULL");
- } else {
- rc = of_property_read_u32(src_node, "cell-index", &val);
- CAM_DBG(CAM_SENSOR, "ir led cell index %d, rc %d", val, rc);
- if (rc < 0) {
- CAM_ERR(CAM_SENSOR, "failed %d", rc);
- of_node_put(src_node);
- return rc;
- }
- sensor_info->subdev_id[SUB_MODULE_IR_LED] = val;
- of_node_put(src_node);
- }
-
return rc;
}
diff --git a/drivers/media/platform/msm/ais/cam_sensor_module/cam_sensor_utils/cam_sensor_cmn_header.h b/drivers/media/platform/msm/ais/cam_sensor_module/cam_sensor_utils/cam_sensor_cmn_header.h
index ba81d9120a0d..7bd7e80dfb3f 100644
--- a/drivers/media/platform/msm/ais/cam_sensor_module/cam_sensor_utils/cam_sensor_cmn_header.h
+++ b/drivers/media/platform/msm/ais/cam_sensor_module/cam_sensor_utils/cam_sensor_cmn_header.h
@@ -133,7 +133,6 @@ enum sensor_sub_module {
SUB_MODULE_CSID,
SUB_MODULE_CSIPHY,
SUB_MODULE_OIS,
- SUB_MODULE_IR_LED,
SUB_MODULE_EXT,
SUB_MODULE_MAX,
};
diff --git a/drivers/media/platform/msm/ais/cam_smmu/cam_smmu_api.c b/drivers/media/platform/msm/ais/cam_smmu/cam_smmu_api.c
index a9871f019c8a..5b426b650899 100644
--- a/drivers/media/platform/msm/ais/cam_smmu/cam_smmu_api.c
+++ b/drivers/media/platform/msm/ais/cam_smmu/cam_smmu_api.c
@@ -189,7 +189,7 @@ static struct cam_iommu_cb_set iommu_cb_set;
static struct dentry *smmu_dentry;
-static bool smmu_fatal_flag = true;
+static bool smmu_fatal_flag;
static enum dma_data_direction cam_smmu_translate_dir(
enum cam_smmu_map_dir dir);
diff --git a/drivers/media/platform/msm/ais/cam_sync/cam_sync.c b/drivers/media/platform/msm/ais/cam_sync/cam_sync.c
index ca4972b4d8e1..a1518e464884 100644
--- a/drivers/media/platform/msm/ais/cam_sync/cam_sync.c
+++ b/drivers/media/platform/msm/ais/cam_sync/cam_sync.c
@@ -288,7 +288,6 @@ int cam_sync_merge(int32_t *sync_obj, uint32_t num_objs, int32_t *merged_obj)
int rc;
long idx = 0;
bool bit;
- int i = 0;
if (!sync_obj || !merged_obj) {
CAM_ERR(CAM_SYNC, "Invalid pointer(s)");
@@ -306,14 +305,6 @@ int cam_sync_merge(int32_t *sync_obj, uint32_t num_objs, int32_t *merged_obj)
return -EINVAL;
}
- for (i = 0; i < num_objs; i++) {
- rc = cam_sync_check_valid(sync_obj[i]);
- if (rc) {
- CAM_ERR(CAM_SYNC, "Sync_obj[%d] %d valid check fail",
- i, sync_obj[i]);
- return rc;
- }
- }
do {
idx = find_first_zero_bit(sync_dev->bitmap, CAM_SYNC_MAX_OBJS);
if (idx >= CAM_SYNC_MAX_OBJS)
@@ -385,29 +376,6 @@ int cam_sync_destroy(int32_t sync_obj)
return cam_sync_deinit_object(sync_dev->sync_table, sync_obj);
}
-int cam_sync_check_valid(int32_t sync_obj)
-{
- struct sync_table_row *row = NULL;
-
- if (sync_obj >= CAM_SYNC_MAX_OBJS || sync_obj <= 0)
- return -EINVAL;
-
- row = sync_dev->sync_table + sync_obj;
-
- if (!test_bit(sync_obj, sync_dev->bitmap)) {
- CAM_ERR(CAM_SYNC, "Error: Released sync obj received %d",
- sync_obj);
- return -EINVAL;
- }
-
- if (row->state == CAM_SYNC_STATE_INVALID) {
- CAM_ERR(CAM_SYNC,
- "Error: accessing an uninitialized sync obj = %d",
- sync_obj);
- return -EINVAL;
- }
- return 0;
-}
int cam_sync_wait(int32_t sync_obj, uint64_t timeout_ms)
{
unsigned long timeleft;
diff --git a/drivers/media/platform/msm/ais/cam_sync/cam_sync_api.h b/drivers/media/platform/msm/ais/cam_sync/cam_sync_api.h
index f2f67cb3eb7b..c735d51fe462 100644
--- a/drivers/media/platform/msm/ais/cam_sync/cam_sync_api.h
+++ b/drivers/media/platform/msm/ais/cam_sync/cam_sync_api.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -147,14 +147,5 @@ int cam_sync_destroy(int32_t sync_obj);
*/
int cam_sync_wait(int32_t sync_obj, uint64_t timeout_ms);
-/**
- * @brief: Check if sync object is valid
- *
- * @param sync_obj: int referencing the sync object to be checked
- *
- * @return 0 upon success, -EINVAL if sync object is in bad state or arguments
- * are invalid
- */
-int cam_sync_check_valid(int32_t sync_obj);
#endif /* __CAM_SYNC_API_H__ */
diff --git a/drivers/media/platform/msm/ais/cam_utils/cam_debug_util.c b/drivers/media/platform/msm/ais/cam_utils/cam_debug_util.c
index 8ad985898702..4f326342e3a7 100644
--- a/drivers/media/platform/msm/ais/cam_utils/cam_debug_util.c
+++ b/drivers/media/platform/msm/ais/cam_utils/cam_debug_util.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017-2019, The Linux Foundataion. All rights reserved.
+/* Copyright (c) 2017-2018, The Linux Foundataion. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -98,9 +98,6 @@ const char *cam_get_module_name(unsigned int module_id)
case CAM_REQ:
name = "CAM-REQ";
break;
- case CAM_IR_LED:
- name = "CAM-IR-LED";
- break;
default:
name = "CAM";
break;
diff --git a/drivers/media/platform/msm/ais/cam_utils/cam_debug_util.h b/drivers/media/platform/msm/ais/cam_utils/cam_debug_util.h
index 52c334201478..3fa92df65a3a 100644
--- a/drivers/media/platform/msm/ais/cam_utils/cam_debug_util.h
+++ b/drivers/media/platform/msm/ais/cam_utils/cam_debug_util.h
@@ -47,7 +47,6 @@
#define CAM_PERF (1 << 25)
#define CAM_HYP (1 << 26)
-#define CAM_IR_LED (1 << 27)
#define STR_BUFFER_MAX_LENGTH 1024
/*
diff --git a/drivers/media/platform/msm/ais/cam_utils/cam_packet_util.c b/drivers/media/platform/msm/ais/cam_utils/cam_packet_util.c
index 593bed9b137d..eae0dc00c03f 100644
--- a/drivers/media/platform/msm/ais/cam_utils/cam_packet_util.c
+++ b/drivers/media/platform/msm/ais/cam_utils/cam_packet_util.c
@@ -182,15 +182,11 @@ int cam_packet_util_process_patches(struct cam_packet *packet,
int i;
int rc = 0;
int32_t hdl;
- uint64_t requestId;
- uint32_t num_patches;
/* process patch descriptor */
patch_desc = (struct cam_patch_desc *)
((uint32_t *) &packet->payload +
packet->patch_offset/4);
- requestId = packet->header.request_id;
- num_patches = packet->num_patches;
CAM_DBG(CAM_UTIL, "packet = %pK patch_desc = %pK size = %lu",
(void *)packet, (void *)patch_desc,
sizeof(struct cam_patch_desc));
@@ -201,16 +197,7 @@ int cam_packet_util_process_patches(struct cam_packet *packet,
rc = cam_mem_get_io_buf(patch_desc[i].src_buf_hdl,
hdl, &iova_addr, &src_buf_size);
if (rc < 0) {
- CAM_ERR(CAM_UTIL,
- "unable to get src buf address ReqId: %llu, num_patches = %d",
- requestId, num_patches);
- CAM_ERR(CAM_UTIL,
- "i = %d patch info = %x %x %x %x src_bfsz:0x%x",
- i, patch_desc[i].dst_buf_hdl,
- patch_desc[i].dst_offset,
- patch_desc[i].src_buf_hdl,
- patch_desc[i].src_offset,
- (uint32_t)src_buf_size);
+ CAM_ERR(CAM_UTIL, "unable to get src buf address");
return rc;
}
src_buf_iova_addr = (uint32_t *)iova_addr;
@@ -219,37 +206,18 @@ int cam_packet_util_process_patches(struct cam_packet *packet,
rc = cam_mem_get_cpu_buf(patch_desc[i].dst_buf_hdl,
&cpu_addr, &dst_buf_len);
if (rc < 0 || !cpu_addr || (dst_buf_len == 0)) {
- CAM_ERR(CAM_UTIL,
- "unable to get dst buf address ReqId: %llu, num_patches = %d",
- requestId, num_patches);
- CAM_ERR(CAM_UTIL,
- "i = %d patch info = %x %x %x %x dst_bfsz:0x%x",
- i, patch_desc[i].dst_buf_hdl,
- patch_desc[i].dst_offset,
- patch_desc[i].src_buf_hdl,
- patch_desc[i].src_offset,
- (uint32_t)dst_buf_len);
+ CAM_ERR(CAM_UTIL, "unable to get dst buf address");
return rc;
}
dst_cpu_addr = (uint32_t *)cpu_addr;
- CAM_DBG(CAM_UTIL,
- "ReqId: %llu, i = %d patch info = %x %x %x %x",
- requestId, i, patch_desc[i].dst_buf_hdl,
- patch_desc[i].dst_offset,
+ CAM_DBG(CAM_UTIL, "i = %d patch info = %x %x %x %x", i,
+ patch_desc[i].dst_buf_hdl, patch_desc[i].dst_offset,
patch_desc[i].src_buf_hdl, patch_desc[i].src_offset);
if ((size_t)patch_desc[i].src_offset >= src_buf_size) {
CAM_ERR(CAM_UTIL,
- "Invalid src buf patch offset ReqId: %llu, num_patches = %d",
- requestId, num_patches);
- CAM_ERR(CAM_UTIL,
- "i = %d patch info = %x %x %x %x src_bfsz:0x%x",
- i, patch_desc[i].dst_buf_hdl,
- patch_desc[i].dst_offset,
- patch_desc[i].src_buf_hdl,
- patch_desc[i].src_offset,
- (uint32_t)src_buf_size);
+ "Invalid src buf patch offset");
return -EINVAL;
}
@@ -257,15 +225,7 @@ int cam_packet_util_process_patches(struct cam_packet *packet,
((dst_buf_len - sizeof(void *)) <
(size_t)patch_desc[i].dst_offset)) {
CAM_ERR(CAM_UTIL,
- "Invalid dst buf patch offset ReqId: %llu, num_patches = %d",
- requestId, num_patches);
- CAM_ERR(CAM_UTIL,
- "i = %d patch info = %x %x %x %x dst_bfsz:0x%x",
- i, patch_desc[i].dst_buf_hdl,
- patch_desc[i].dst_offset,
- patch_desc[i].src_buf_hdl,
- patch_desc[i].src_offset,
- (uint32_t)dst_buf_len);
+ "Invalid dst buf patch offset");
return -EINVAL;
}
@@ -393,115 +353,3 @@ rel_cmd_buf:
return rc;
}
-
-int32_t cam_packet_validate_plane_size(
- struct cam_buf_io_cfg *io_cfg,
- int plane_index,
- size_t size)
-{
- int rc = 0;
- uint32_t kmd_plane_size = 0;
- uint32_t plane_stride = 0;
- uint32_t slice_height = 0;
- uint32_t metadata_size = 0;
- uint32_t format = io_cfg->format;
- uint32_t plane_pixel_size = 0;
-
- if (plane_index < CAM_PACKET_MAX_PLANES) {
- plane_stride = io_cfg->planes[plane_index].plane_stride;
- slice_height = io_cfg->planes[plane_index].slice_height;
- }
-
- if (!(plane_stride && slice_height)) {
- CAM_ERR(CAM_ISP,
- "Invalid values from UMD stride %d, slice height %d",
- plane_stride,
- slice_height);
- return -EINVAL;
- }
-
- switch (format) {
- case CAM_FORMAT_MIPI_RAW_6:
- case CAM_FORMAT_MIPI_RAW_8:
- kmd_plane_size = ((plane_stride * slice_height) + 16 - 1)
- / 16 * 16;
- break;
- case CAM_FORMAT_MIPI_RAW_10:
- if (plane_stride % 4 == 0)
- kmd_plane_size = ((plane_stride * slice_height)
- + 16 - 1) / 16 * 16;
- break;
- case CAM_FORMAT_MIPI_RAW_12:
- if (plane_stride % 2 == 0)
- kmd_plane_size = ((plane_stride * slice_height)
- + 16 - 1) / 16 * 16;
- break;
- case CAM_FORMAT_MIPI_RAW_14:
- if (plane_stride % 4 == 0)
- kmd_plane_size = plane_stride * slice_height * 7 / 4;
- break;
- case CAM_FORMAT_PLAIN16_8:
- case CAM_FORMAT_PLAIN16_10:
- case CAM_FORMAT_PLAIN16_12:
- case CAM_FORMAT_PLAIN16_14:
- case CAM_FORMAT_PLAIN16_16:
- case CAM_FORMAT_PLAIN64:
- kmd_plane_size = plane_stride * slice_height;
- break;
- case CAM_FORMAT_NV21:
- case CAM_FORMAT_NV12:
- if (plane_index < CAM_PACKET_MAX_PLANES)
- kmd_plane_size = plane_stride * slice_height;
- break;
- case CAM_FORMAT_PD10:
- if (plane_index < CAM_PACKET_MAX_PLANES)
- kmd_plane_size = plane_stride * slice_height;
- break;
- case CAM_FORMAT_UBWC_NV12:
- case CAM_FORMAT_UBWC_NV12_4R:
- case CAM_FORMAT_UBWC_TP10:
- metadata_size = io_cfg->planes[plane_index].meta_size;
- plane_pixel_size = ((plane_stride * slice_height) +
- (4096 - 1)) & ~((uint32_t) 4096 - 1);
- kmd_plane_size = metadata_size + plane_pixel_size;
- break;
- case CAM_FORMAT_UBWC_P010:
- case CAM_FORMAT_PLAIN32_20:
- case CAM_FORMAT_TP10:
- case CAM_FORMAT_YUV422:
- case CAM_FORMAT_PD8:
- case CAM_FORMAT_PLAIN128:
- case CAM_FORMAT_ARGB:
- case CAM_FORMAT_ARGB_10:
- case CAM_FORMAT_ARGB_12:
- case CAM_FORMAT_ARGB_14:
- case CAM_FORMAT_MIPI_RAW_16:
- case CAM_FORMAT_MIPI_RAW_20:
- case CAM_FORMAT_QTI_RAW_8:
- case CAM_FORMAT_QTI_RAW_10:
- case CAM_FORMAT_QTI_RAW_12:
- case CAM_FORMAT_QTI_RAW_14:
- case CAM_FORMAT_PLAIN8:
- case CAM_FORMAT_PLAIN8_SWAP:
- case CAM_FORMAT_PLAIN8_10:
- case CAM_FORMAT_PLAIN8_10_SWAP:
- kmd_plane_size = plane_stride * slice_height;
- break;
- default:
- kmd_plane_size = plane_stride * slice_height;
- break;
- }
- if (!kmd_plane_size ||
- kmd_plane_size > (size - io_cfg->offsets[plane_index])) {
- CAM_ERR(CAM_ISP,
- "kmd size: %d umd size: %d width: %d height: %d stride: %d sliceheight: %d ",
- kmd_plane_size,
- size,
- io_cfg->planes[plane_index].width,
- io_cfg->planes[plane_index].height,
- plane_stride,
- slice_height);
- return -EINVAL;
- }
- return rc;
-}
diff --git a/drivers/media/platform/msm/ais/cam_utils/cam_packet_util.h b/drivers/media/platform/msm/ais/cam_utils/cam_packet_util.h
index e49968e6a291..33c07ad89f4e 100644
--- a/drivers/media/platform/msm/ais/cam_utils/cam_packet_util.h
+++ b/drivers/media/platform/msm/ais/cam_utils/cam_packet_util.h
@@ -135,20 +135,4 @@ int cam_packet_util_process_generic_cmd_buffer(
struct cam_cmd_buf_desc *cmd_buf,
cam_packet_generic_blob_handler blob_handler_cb, void *user_data);
-/**
- * cam_packet_validate_plane_size()
- *
- * @brief: Utility function to calculate and validate size of buffer
- * required for a format.
- * @io_cfg: Contains IO config info
- * @plane_index Plane index for which size is to be calculated
- *
- * @return: Size of buffer
- *
- */
-int32_t cam_packet_validate_plane_size(
- struct cam_buf_io_cfg *io_cfg,
- int plane_index,
- size_t size);
-
#endif /* _CAM_PACKET_UTIL_H_ */
diff --git a/drivers/media/platform/msm/ais/cam_utils/cam_soc_util.c b/drivers/media/platform/msm/ais/cam_utils/cam_soc_util.c
index 4c0672eeb2e5..d0666a401bae 100644
--- a/drivers/media/platform/msm/ais/cam_utils/cam_soc_util.c
+++ b/drivers/media/platform/msm/ais/cam_utils/cam_soc_util.c
@@ -23,7 +23,7 @@ static char supported_clk_info[256];
static char debugfs_dir_name[64];
static int cam_soc_util_get_clk_level(struct cam_hw_soc_info *soc_info,
- int32_t src_clk_idx, int64_t clk_rate)
+ int32_t src_clk_idx, int32_t clk_rate)
{
int i;
long clk_rate_round;
@@ -38,7 +38,7 @@ static int cam_soc_util_get_clk_level(struct cam_hw_soc_info *soc_info,
for (i = 0; i < CAM_MAX_VOTE; i++) {
if (soc_info->clk_rate[i][src_clk_idx] >= clk_rate_round) {
CAM_DBG(CAM_UTIL,
- "soc = %d round rate = %ld actual = %lld",
+ "soc = %d round rate = %ld actual = %d",
soc_info->clk_rate[i][src_clk_idx],
clk_rate_round, clk_rate);
return i;
@@ -398,7 +398,7 @@ int cam_soc_util_set_clk_flags(struct cam_hw_soc_info *soc_info,
* @return: Success or failure
*/
static int cam_soc_util_set_clk_rate(struct clk *clk, const char *clk_name,
- int64_t clk_rate)
+ int32_t clk_rate)
{
int rc = 0;
long clk_rate_round;
@@ -406,7 +406,7 @@ static int cam_soc_util_set_clk_rate(struct clk *clk, const char *clk_name,
if (!clk || !clk_name)
return -EINVAL;
- CAM_DBG(CAM_UTIL, "set %s, rate %lld", clk_name, clk_rate);
+ CAM_DBG(CAM_UTIL, "set %s, rate %d", clk_name, clk_rate);
if (clk_rate > 0) {
clk_rate_round = clk_round_rate(clk, clk_rate);
CAM_DBG(CAM_UTIL, "new_rate %ld", clk_rate_round);
@@ -442,7 +442,7 @@ static int cam_soc_util_set_clk_rate(struct clk *clk, const char *clk_name,
}
int cam_soc_util_set_src_clk_rate(struct cam_hw_soc_info *soc_info,
- int64_t clk_rate)
+ int32_t clk_rate)
{
int32_t src_clk_idx;
struct clk *clk = NULL;
@@ -463,7 +463,7 @@ int cam_soc_util_set_src_clk_rate(struct cam_hw_soc_info *soc_info,
if (soc_info->cam_cx_ipeak_enable && clk_rate >= 0) {
apply_level = cam_soc_util_get_clk_level(soc_info, src_clk_idx,
clk_rate);
- CAM_DBG(CAM_UTIL, "set %s, rate %lld dev_name = %s\n"
+ CAM_DBG(CAM_UTIL, "set %s, rate %d dev_name = %s\n"
"apply level = %d",
soc_info->clk_name[src_clk_idx], clk_rate,
soc_info->dev_name, apply_level);
diff --git a/drivers/media/platform/msm/ais/cam_utils/cam_soc_util.h b/drivers/media/platform/msm/ais/cam_utils/cam_soc_util.h
index d0bab027790e..0ee8445c0129 100644
--- a/drivers/media/platform/msm/ais/cam_utils/cam_soc_util.h
+++ b/drivers/media/platform/msm/ais/cam_utils/cam_soc_util.h
@@ -390,7 +390,7 @@ int cam_soc_util_set_clk_flags(struct cam_hw_soc_info *soc_info,
* @return: success or failure
*/
int cam_soc_util_set_src_clk_rate(struct cam_hw_soc_info *soc_info,
- int64_t clk_rate);
+ int32_t clk_rate);
/**
* cam_soc_util_get_option_clk_by_name()