mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 21:54:34 -04:00
msm: camera: isp: Add hw version checks and dt match string
The platform register requires dt match string for csid to probe and correct cpas hw version is required for vfe to function. Add dt match strings and hw version checks in csid and vfe. CRs-Fixed: 2584631 Change-Id: Ieb2766fa6243bf4133b43f657a18aed7f04447be Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org> Signed-off-by: Vishalsingh Hajeri <vhajeri@codeaurora.org>
This commit is contained in:
parent
7d7ed34560
commit
eef5866053
7 changed files with 36 additions and 15 deletions
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/uaccess.h>
|
||||
|
|
@ -5626,7 +5626,8 @@ int cam_icp_hw_mgr_init(struct device_node *of_node, uint64_t *hw_mgr_hdl,
|
|||
&query.camera_version, &query.cpas_version, &cam_caps);
|
||||
cam_cpas_get_cpas_hw_version(&camera_hw_version);
|
||||
|
||||
if (camera_hw_version == CAM_CPAS_TITAN_480_V100) {
|
||||
if ((camera_hw_version == CAM_CPAS_TITAN_480_V100) ||
|
||||
(camera_hw_version == CAM_CPAS_TITAN_580_V100)) {
|
||||
if (cam_caps & CPAS_TITAN_480_IPE0_BIT)
|
||||
icp_hw_mgr.ipe0_enable = true;
|
||||
if (cam_caps & CPAS_BPS_BIT)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
|
|
@ -54,6 +54,10 @@ static const struct of_device_id cam_ife_csid17x_dt_match[] = {
|
|||
.compatible = "qcom,csid480",
|
||||
.data = &cam_ife_csid480_hw_info,
|
||||
},
|
||||
{
|
||||
.compatible = "qcom,csid580",
|
||||
.data = &cam_ife_csid480_hw_info,
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/iopoll.h>
|
||||
|
|
@ -339,7 +339,8 @@ static int cam_ife_match_vc_dt_pair(int32_t *vc, uint32_t *dt,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (camera_hw_version != CAM_CPAS_TITAN_480_V100)
|
||||
if ((camera_hw_version != CAM_CPAS_TITAN_480_V100) &&
|
||||
(camera_hw_version != CAM_CPAS_TITAN_580_V100))
|
||||
num_valid_vc_dt = 1;
|
||||
|
||||
switch (num_valid_vc_dt) {
|
||||
|
|
@ -771,6 +772,7 @@ int cam_ife_csid_cid_reserve(struct cam_ife_csid_hw *csid_hw,
|
|||
}
|
||||
break;
|
||||
case CAM_CPAS_TITAN_480_V100:
|
||||
case CAM_CPAS_TITAN_580_V100:
|
||||
if (cid_reserv->in_port->cust_node == 1) {
|
||||
if (cid_reserv->in_port->usage_type == 1) {
|
||||
CAM_ERR(CAM_ISP, "Dual IFE is not supported");
|
||||
|
|
@ -1716,7 +1718,8 @@ static int cam_ife_csid_init_config_pxl_path(
|
|||
}
|
||||
CAM_DBG(CAM_ISP, "HW version: %x", camera_hw_version);
|
||||
|
||||
if (camera_hw_version == CAM_CPAS_TITAN_480_V100)
|
||||
if ((camera_hw_version == CAM_CPAS_TITAN_480_V100) ||
|
||||
(camera_hw_version == CAM_CPAS_TITAN_580_V100))
|
||||
val |= (path_data->drop_enable <<
|
||||
csid_reg->cmn_reg->drop_h_en_shift_val) |
|
||||
(path_data->drop_enable <<
|
||||
|
|
@ -1737,7 +1740,8 @@ static int cam_ife_csid_init_config_pxl_path(
|
|||
pxl_reg->csid_pxl_cfg0_addr);
|
||||
|
||||
if (path_data->is_valid_vc1_dt1 &&
|
||||
camera_hw_version == CAM_CPAS_TITAN_480_V100) {
|
||||
((camera_hw_version == CAM_CPAS_TITAN_480_V100) ||
|
||||
(camera_hw_version == CAM_CPAS_TITAN_580_V100))) {
|
||||
val = cam_io_r_mb(soc_info->reg_map[0].mem_base +
|
||||
pxl_reg->csid_pxl_multi_vcdt_cfg0_addr);
|
||||
val |= ((path_data->vc1 << 2) |
|
||||
|
|
@ -1773,7 +1777,8 @@ static int cam_ife_csid_init_config_pxl_path(
|
|||
* Skip for version 480 HW due to HW limitation.
|
||||
*/
|
||||
if (!(csid_hw->csid_debug & CSID_DEBUG_DISABLE_EARLY_EOF) &&
|
||||
(camera_hw_version != CAM_CPAS_TITAN_480_V100)) {
|
||||
(camera_hw_version != CAM_CPAS_TITAN_480_V100) &&
|
||||
(camera_hw_version != CAM_CPAS_TITAN_580_V100)) {
|
||||
val = cam_io_r_mb(soc_info->reg_map[0].mem_base +
|
||||
pxl_reg->csid_pxl_cfg0_addr);
|
||||
val |= (1 << pxl_reg->early_eof_en_shift_val);
|
||||
|
|
@ -2167,7 +2172,8 @@ static int cam_ife_csid_init_config_rdi_path(
|
|||
CAM_DBG(CAM_ISP, "HW version: %x", camera_hw_version);
|
||||
|
||||
if (camera_hw_version == CAM_CPAS_TITAN_480_V100 ||
|
||||
camera_hw_version == CAM_CPAS_TITAN_175_V130) {
|
||||
camera_hw_version == CAM_CPAS_TITAN_175_V130 ||
|
||||
camera_hw_version == CAM_CPAS_TITAN_580_V100) {
|
||||
val |= (path_data->drop_enable <<
|
||||
csid_reg->cmn_reg->drop_h_en_shift_val) |
|
||||
(path_data->drop_enable <<
|
||||
|
|
@ -2180,7 +2186,8 @@ static int cam_ife_csid_init_config_rdi_path(
|
|||
csid_reg->rdi_reg[id]->csid_rdi_cfg0_addr);
|
||||
|
||||
if (path_data->is_valid_vc1_dt1 &&
|
||||
camera_hw_version == CAM_CPAS_TITAN_480_V100) {
|
||||
((camera_hw_version == CAM_CPAS_TITAN_480_V100) ||
|
||||
(camera_hw_version == CAM_CPAS_TITAN_580_V100))) {
|
||||
val = cam_io_r_mb(soc_info->reg_map[0].mem_base +
|
||||
csid_reg->rdi_reg[id]->csid_rdi_multi_vcdt_cfg0_addr);
|
||||
val |= ((path_data->vc1 << 2) |
|
||||
|
|
@ -2236,7 +2243,8 @@ static int cam_ife_csid_init_config_rdi_path(
|
|||
csid_reg->rdi_reg[id]->csid_rdi_rpp_pix_drop_pattern_addr);
|
||||
|
||||
/* Write max value to pixel drop period due to a bug in ver 480 HW */
|
||||
if (camera_hw_version == CAM_CPAS_TITAN_480_V100 &&
|
||||
if (((camera_hw_version == CAM_CPAS_TITAN_480_V100) ||
|
||||
(camera_hw_version == CAM_CPAS_TITAN_580_V100)) &&
|
||||
path_data->drop_enable)
|
||||
cam_io_w_mb(0x1F, soc_info->reg_map[0].mem_base +
|
||||
csid_reg->rdi_reg[id]->csid_rdi_rpp_pix_drop_period_addr);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
|
|
@ -32,6 +32,10 @@ static const struct of_device_id cam_ife_csid_lite_dt_match[] = {
|
|||
.compatible = "qcom,csid-lite480",
|
||||
.data = &cam_ife_csid_lite_480_hw_info,
|
||||
},
|
||||
{
|
||||
.compatible = "qcom,csid-lite580",
|
||||
.data = &cam_ife_csid_lite_480_hw_info,
|
||||
},
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, cam_ife_csid_lite_dt_match);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/delay.h>
|
||||
|
|
@ -90,6 +90,7 @@ int cam_vfe_reset_irq_top_half(uint32_t evt_id,
|
|||
|
||||
switch (soc_info->hw_version) {
|
||||
case CAM_CPAS_TITAN_480_V100:
|
||||
case CAM_CPAS_TITAN_580_V100:
|
||||
if (!soc_private->is_ife_lite) {
|
||||
if (th_payload->evt_status_arr[0] & 0x1) {
|
||||
cam_io_w(0xFFFFFFFF, mem_base +
|
||||
|
|
@ -330,6 +331,7 @@ int cam_vfe_reset(void *hw_priv, void *reset_core_args, uint32_t arg_size)
|
|||
|
||||
switch (soc_info->hw_version) {
|
||||
case CAM_CPAS_TITAN_480_V100:
|
||||
case CAM_CPAS_TITAN_580_V100:
|
||||
if (!soc_private->is_ife_lite)
|
||||
top_reset_irq_reg_mask[CAM_IFE_IRQ_CAMIF_REG_STATUS0]
|
||||
= CAM_VFE_48X_TOP_RESET_MASK;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/slab.h>
|
||||
|
|
@ -60,6 +60,7 @@ static int cam_vfe_get_dt_properties(struct cam_hw_soc_info *soc_info)
|
|||
|
||||
switch (soc_info->hw_version) {
|
||||
case CAM_CPAS_TITAN_480_V100:
|
||||
case CAM_CPAS_TITAN_580_V100:
|
||||
num_ubwc_cfg = of_property_count_u32_elems(of_node,
|
||||
"ubwc-static-cfg");
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2019, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/slab.h>
|
||||
|
|
@ -425,6 +425,7 @@ static int cam_vfe_camif_ver3_resource_start(
|
|||
/* epoch config */
|
||||
switch (soc_private->cpas_version) {
|
||||
case CAM_CPAS_TITAN_480_V100:
|
||||
case CAM_CPAS_TITAN_580_V100:
|
||||
epoch0_line_cfg = (rsrc_data->last_line -
|
||||
rsrc_data->first_line) / 4;
|
||||
/* epoch line cfg will still be configured at midpoint of the
|
||||
|
|
|
|||
Loading…
Reference in a new issue