mirror of
https://github.com/commaai/agnos-kernel-sdm845.git
synced 2026-06-08 11:24:51 +08:00
msm: camera: isp: Select epoch config based on Hardware
Select the EPOCH to twenty for lines devices other than SM8150 Change-Id: I238196a7a3e26e5bec74432372f068ec35eb080c Signed-off-by: Abhilash Kumar <krabhi@codeaurora.org>
This commit is contained in:
committed by
Haizhou Fan
parent
c1392749b8
commit
864262097c
@@ -211,6 +211,8 @@ static int cam_vfe_camif_resource_start(
|
||||
uint32_t epoch0_irq_mask;
|
||||
uint32_t epoch1_irq_mask;
|
||||
uint32_t computed_epoch_line_cfg;
|
||||
uint32_t camera_hw_version = 0;
|
||||
int rc = 0;
|
||||
|
||||
if (!camif_res) {
|
||||
CAM_ERR(CAM_ISP, "Error! Invalid input arguments");
|
||||
@@ -250,16 +252,50 @@ static int cam_vfe_camif_resource_start(
|
||||
rsrc_data->common_reg->module_ctrl[
|
||||
CAM_VFE_TOP_VER2_MODULE_STATS]->cgc_ovd);
|
||||
|
||||
/* get the HW version */
|
||||
rc = cam_cpas_get_cpas_hw_version(&camera_hw_version);
|
||||
|
||||
if (rc) {
|
||||
CAM_ERR(CAM_ISP, "Couldn't find HW version. rc: %d", rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* epoch config */
|
||||
epoch0_irq_mask = ((rsrc_data->last_line - rsrc_data->first_line) / 2) +
|
||||
rsrc_data->first_line;
|
||||
epoch1_irq_mask = rsrc_data->reg_data->epoch_line_cfg & 0xFFFF;
|
||||
computed_epoch_line_cfg = (epoch0_irq_mask << 16) | epoch1_irq_mask;
|
||||
cam_io_w_mb(computed_epoch_line_cfg,
|
||||
rsrc_data->mem_base + rsrc_data->camif_reg->epoch_irq);
|
||||
CAM_DBG(CAM_ISP, "first_line:%u last_line:%u epoch_line_cfg: 0x%x",
|
||||
rsrc_data->first_line, rsrc_data->last_line,
|
||||
computed_epoch_line_cfg);
|
||||
switch (camera_hw_version) {
|
||||
case CAM_CPAS_TITAN_175_V101:
|
||||
case CAM_CPAS_TITAN_175_V100:
|
||||
epoch0_irq_mask = ((rsrc_data->last_line -
|
||||
rsrc_data->first_line) / 2) +
|
||||
rsrc_data->first_line;
|
||||
epoch1_irq_mask = rsrc_data->reg_data->epoch_line_cfg &
|
||||
0xFFFF;
|
||||
computed_epoch_line_cfg = (epoch0_irq_mask << 16) |
|
||||
epoch1_irq_mask;
|
||||
cam_io_w_mb(computed_epoch_line_cfg,
|
||||
rsrc_data->mem_base +
|
||||
rsrc_data->camif_reg->epoch_irq);
|
||||
CAM_DBG(CAM_ISP, "first_line: %u\n"
|
||||
"last_line: %u\n"
|
||||
"epoch_line_cfg: 0x%x",
|
||||
rsrc_data->first_line,
|
||||
rsrc_data->last_line,
|
||||
computed_epoch_line_cfg);
|
||||
break;
|
||||
case CAM_CPAS_TITAN_170_V100:
|
||||
case CAM_CPAS_TITAN_170_V110:
|
||||
case CAM_CPAS_TITAN_170_V120:
|
||||
cam_io_w_mb(rsrc_data->reg_data->epoch_line_cfg,
|
||||
rsrc_data->mem_base +
|
||||
rsrc_data->camif_reg->epoch_irq);
|
||||
break;
|
||||
default:
|
||||
cam_io_w_mb(rsrc_data->reg_data->epoch_line_cfg,
|
||||
rsrc_data->mem_base +
|
||||
rsrc_data->camif_reg->epoch_irq);
|
||||
CAM_WARN(CAM_ISP, "Hardware version not proper: 0x%x",
|
||||
camera_hw_version);
|
||||
break;
|
||||
}
|
||||
|
||||
camif_res->res_state = CAM_ISP_RESOURCE_STATE_STREAMING;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user