Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 26182c7d authored by Wyes Karny's avatar Wyes Karny
Browse files

msm: camera: isp: IFE and CSID probe based on fuse



Some ISP hardware id instances are disabled on some target skus.
Cpas driver has fuse information based on the dtsi entries.
ISP hw driver queries the cpas driver whether hw instance is
supported or not. If ISP hardware is supported on the target then
continue the isp hardware probe.

Fix for get HW feature:
When feature is enable or disable type and HW mask is not indicating the
HW index, do not update the supported. By default it is supported.

CRs-Fixed: 2825675
Change-Id: I777e5790060388458562e7a53fea8a7324ffa9d3
Signed-off-by: default avatarWyes Karny <wkarny@codeaurora.org>
parent 51f76262
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -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,
+11 −0
Original line number Diff line number Diff line
@@ -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);
+5 −2
Original line number Diff line number Diff line
// 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",
+11 −0
Original line number Diff line number Diff line
@@ -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,
+3 −1
Original line number Diff line number Diff line
// 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;
	}