mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 15:49:17 -04:00
Merge "msm: camera: isp: IFE and CSID probe based on fuse" into camera-kernel.lnx.4.0
This commit is contained in:
commit
344dad9915
5 changed files with 31 additions and 9 deletions
|
|
@ -161,19 +161,14 @@ bool cam_cpas_is_feature_supported(uint32_t flag, uint32_t hw_map,
|
|||
if (soc_private->feature_info[i].feature == flag)
|
||||
break;
|
||||
|
||||
if (i == soc_private->num_feature_info) {
|
||||
CAM_INFO(CAM_CPAS, "Feature not found, no of featues: %d",
|
||||
soc_private->num_feature_info);
|
||||
if (i == soc_private->num_feature_info)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (soc_private->feature_info[i].type == CAM_CPAS_FEATURE_TYPE_DISABLE
|
||||
|| (soc_private->feature_info[i].type ==
|
||||
CAM_CPAS_FEATURE_TYPE_ENABLE)) {
|
||||
if ((soc_private->feature_info[i].hw_map & hw_map) == hw_map)
|
||||
supported = soc_private->feature_info[i].enable;
|
||||
else
|
||||
supported = !soc_private->feature_info[i].enable;
|
||||
} else {
|
||||
if (!fuse_val) {
|
||||
CAM_ERR(CAM_CPAS,
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#include "cam_cpas_api.h"
|
||||
#include "cam_subdev.h"
|
||||
#include "cam_tasklet_util.h"
|
||||
#include "dt-bindings/msm/msm-camera.h"
|
||||
|
||||
/* Timeout value in msec */
|
||||
#define IFE_CSID_TIMEOUT 1000
|
||||
|
|
@ -5556,6 +5557,16 @@ int cam_ife_csid_hw_probe_init(struct cam_hw_intf *csid_hw_intf,
|
|||
ife_csid_hw->device_enabled = 0;
|
||||
ife_csid_hw->is_resetting = false;
|
||||
ife_csid_hw->hw_info->hw_state = CAM_HW_STATE_POWER_DOWN;
|
||||
|
||||
if (!cam_cpas_is_feature_supported(CAM_CPAS_ISP_FUSE,
|
||||
(1 << ife_csid_hw->hw_intf->hw_idx), 0) ||
|
||||
!cam_cpas_is_feature_supported(CAM_CPAS_ISP_LITE_FUSE,
|
||||
(1 << ife_csid_hw->hw_intf->hw_idx), 0)) {
|
||||
CAM_DBG(CAM_ISP, "IFE:%d is not supported",
|
||||
ife_csid_hw->hw_intf->hw_idx);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
mutex_init(&ife_csid_hw->hw_info->hw_mutex);
|
||||
spin_lock_init(&ife_csid_hw->hw_info->hw_lock);
|
||||
spin_lock_init(&ife_csid_hw->lock_state);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/slab.h>
|
||||
|
|
@ -79,8 +79,11 @@ static int cam_ife_csid_component_bind(struct device *dev,
|
|||
csid_dev->csid_info = csid_hw_data;
|
||||
|
||||
rc = cam_ife_csid_hw_probe_init(csid_hw_intf, csid_dev_idx, false);
|
||||
if (rc)
|
||||
if (rc) {
|
||||
if (rc == -ENODEV)
|
||||
rc = 0;
|
||||
goto free_dev;
|
||||
}
|
||||
|
||||
platform_set_drvdata(pdev, csid_dev);
|
||||
CAM_DBG(CAM_ISP, "CSID:%d component bound successfully",
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@
|
|||
#include "cam_ife_hw_mgr.h"
|
||||
#include "cam_debug_util.h"
|
||||
#include "cam_cpas_api.h"
|
||||
#include <dt-bindings/msm/msm-camera.h>
|
||||
|
||||
|
||||
static const char drv_name[] = "vfe";
|
||||
|
||||
|
|
@ -682,6 +684,15 @@ int cam_vfe_core_init(struct cam_vfe_hw_core_info *core_info,
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (!cam_cpas_is_feature_supported(CAM_CPAS_ISP_FUSE,
|
||||
(1 << hw_intf->hw_idx), 0) ||
|
||||
!cam_cpas_is_feature_supported(CAM_CPAS_ISP_LITE_FUSE,
|
||||
(1 << hw_intf->hw_idx), 0)) {
|
||||
CAM_DBG(CAM_ISP, "IFE:%d is not supported",
|
||||
hw_intf->hw_idx);
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
rc = cam_irq_controller_init(drv_name,
|
||||
CAM_SOC_GET_REG_MAP_START(soc_info, VFE_CORE_BASE_IDX),
|
||||
vfe_hw_info->irq_reg_info, &core_info->vfe_irq_controller,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
|
|
@ -100,6 +100,8 @@ static int cam_vfe_component_bind(struct device *dev,
|
|||
rc = cam_vfe_core_init(core_info, &vfe_hw->soc_info,
|
||||
vfe_hw_intf, hw_info);
|
||||
if (rc < 0) {
|
||||
if (rc == -ENXIO)
|
||||
rc = 0;
|
||||
CAM_ERR(CAM_ISP, "Failed to init core rc=%d", rc);
|
||||
goto deinit_soc;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue