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

Commit f268f4f4 authored by Chandan Kumar Jha's avatar Chandan Kumar Jha
Browse files

msm: camera: common: Bring up changes for lagoon camera



1. Change ubwc config register value to default.
2. Remove camera hw version check to pick fixed camera id.
3. Add camera hw version check to enable crop or drop feature.
4. By pass lrme start and stop on camera hw version basis. This is
   temporary fix to avoid lag.

CRs-Fixed: 2571273
Change-Id: I2144784984be721c34745c7744f3dcb29526701d
Signed-off-by: default avatarChandan Kumar Jha <cjha@codeaurora.org>
parent 6744842d
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -290,7 +290,7 @@ static struct cam_camnoc_specific
			.access_type = CAM_REG_TYPE_READ_WRITE,
			.masked_value = 0,
			.offset = 0x2588, /* SPECIFIC_IFE01_ENCCTL_LOW */
			.value = 1,
			.value = 5,
		},
	},
	{
@@ -338,7 +338,7 @@ static struct cam_camnoc_specific
			.access_type = CAM_REG_TYPE_READ_WRITE,
			.masked_value = 0,
			.offset = 0x2788, /* SPECIFIC_IFE23_ENCCTL_LOW */
			.value = 1,
			.value = 5,
		},
	},
	{
@@ -431,14 +431,14 @@ static struct cam_camnoc_specific
			.access_type = CAM_REG_TYPE_READ_WRITE,
			.masked_value = 0,
			.offset = 0x2A48, /* SPECIFIC_IBL_WR_SAFELUT_LOW */
			.value = 0x0,
			.value = 0xFFF,
		},
		.ubwc_ctl = {
			.enable = true,
			.access_type = CAM_REG_TYPE_READ_WRITE,
			.masked_value = 0,
			.offset = 0x2B88, /* SPECIFIC_IBL_WR_ENCCTL_LOW */
			.value = 1,
			.value = 5,
		},
	},
	{
+2 −2
Original line number Diff line number Diff line
@@ -763,7 +763,6 @@ int cam_ife_csid_cid_reserve(struct cam_ife_csid_hw *csid_hw,
	case CAM_CPAS_TITAN_170_V100:
	case CAM_CPAS_TITAN_170_V110:
	case CAM_CPAS_TITAN_170_V120:
	case CAM_CPAS_TITAN_170_V200:
		if (cid_reserv->in_port->res_type == CAM_ISP_IFE_IN_RES_PHY_3 &&
			csid_hw->hw_intf->hw_idx != 2) {
			rc = -EINVAL;
@@ -2222,7 +2221,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_170_V200) {
		val |= (path_data->drop_enable <<
			csid_reg->cmn_reg->drop_h_en_shift_val) |
			(path_data->drop_enable <<
+20 −8
Original line number Diff line number Diff line
// 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/platform_device.h>
@@ -84,6 +84,8 @@ static int cam_lrme_hw_dev_probe(struct platform_device *pdev)
	const struct of_device_id *match_dev = NULL;
	struct cam_lrme_hw_info *hw_info;
	int rc, i;
	int32_t camera_hw_version;


	lrme_hw = kzalloc(sizeof(struct cam_hw_info), GFP_KERNEL);
	if (!lrme_hw) {
@@ -152,11 +154,19 @@ static int cam_lrme_hw_dev_probe(struct platform_device *pdev)
		goto release_cdm;
	}

	rc = cam_cpas_get_cpas_hw_version(&camera_hw_version);
	if (rc) {
		CAM_ERR(CAM_ISP, "Failed to get HW version rc:%d", rc);
		goto release_cdm;
	}

	if (camera_hw_version != CAM_CPAS_TITAN_170_V200) {
		rc = cam_lrme_hw_start(lrme_hw, NULL, 0);
		if (rc) {
			CAM_ERR(CAM_LRME, "Failed to hw init, rc=%d", rc);
			goto detach_smmu;
		}
	}

	rc = cam_lrme_hw_util_get_caps(lrme_hw, &lrme_core->hw_caps);
	if (rc) {
@@ -166,11 +176,13 @@ static int cam_lrme_hw_dev_probe(struct platform_device *pdev)
		goto detach_smmu;
	}

	if (camera_hw_version != CAM_CPAS_TITAN_170_V200) {
		rc = cam_lrme_hw_stop(lrme_hw, NULL, 0);
		if (rc) {
			CAM_ERR(CAM_LRME, "Failed to deinit hw, rc=%d", rc);
			goto detach_smmu;
		}
	}

	lrme_core->hw_idx = lrme_hw->soc_info.index;
	lrme_hw_intf.hw_priv = lrme_hw;