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

Commit 6ce2c899 authored by Venkat Chinta's avatar Venkat Chinta Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: csid: Add support for version 480 hardware



This change adds the structures and driver registration
related changes required to support version 480 CSID
and CSID Lite hardware.

Change-Id: I4c1aec5798f62bc03b6878716e4905718ff50cad
Signed-off-by: default avatarVenkat Chinta <vchinta@codeaurora.org>
parent a9ddedf7
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 */


@@ -14,6 +14,7 @@
#define CAM_CSID_DRV_NAME                    "csid_17x"
#define CAM_CSID_VERSION_V170                 0x10070000
#define CAM_CSID_VERSION_V175                 0x10070050
#define CAM_CSID_VERSION_V480                 0x40080000

static struct cam_ife_csid_hw_info cam_ife_csid170_hw_info = {
	.csid_reg = &cam_ife_csid_170_reg_offset,
@@ -30,6 +31,11 @@ static struct cam_ife_csid_hw_info cam_ife_csid175_200_hw_info = {
	.hw_dts_version = CAM_CSID_VERSION_V175,
};

static struct cam_ife_csid_hw_info cam_ife_csid480_hw_info = {
	.csid_reg = &cam_ife_csid_175_reg_offset,
	.hw_dts_version = CAM_CSID_VERSION_V480,
};

static const struct of_device_id cam_ife_csid17x_dt_match[] = {
	{
		.compatible = "qcom,csid170",
@@ -43,6 +49,10 @@ static const struct of_device_id cam_ife_csid17x_dt_match[] = {
		.compatible = "qcom,csid175_200",
		.data = &cam_ife_csid175_200_hw_info,
	},
	{
		.compatible = "qcom,csid480",
		.data = &cam_ife_csid480_hw_info,
	},
	{}
};

+6 −6
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
 */

#include <linux/iopoll.h>
@@ -303,7 +303,7 @@ static int cam_ife_csid_cid_get(struct cam_ife_csid_hw *csid_hw,
	*res = NULL;

	/* Return already reserved CID if the VC/DT matches */
	for (i = 0; i < CAM_IFE_CSID_CID_RES_MAX; i++) {
	for (i = 0; i < CAM_IFE_CSID_CID_MAX; i++) {
		if (csid_hw->cid_res[i].res_state >=
			CAM_ISP_RESOURCE_STATE_RESERVED) {
			cid_data = (struct cam_ife_csid_cid_data *)
@@ -319,7 +319,7 @@ static int cam_ife_csid_cid_get(struct cam_ife_csid_hw *csid_hw,
		}
	}

	for (i = 0; i < CAM_IFE_CSID_CID_RES_MAX; i++) {
	for (i = 0; i < CAM_IFE_CSID_CID_MAX; i++) {
		if (csid_hw->cid_res[i].res_state ==
			CAM_ISP_RESOURCE_STATE_AVAILABLE) {
			cid_data = (struct cam_ife_csid_cid_data *)
@@ -3310,7 +3310,7 @@ int cam_ife_csid_hw_probe_init(struct cam_hw_intf *csid_hw_intf,
	struct cam_hw_info                   *csid_hw_info;
	struct cam_ife_csid_hw               *ife_csid_hw = NULL;

	if (csid_idx >= CAM_IFE_CSID_HW_RES_MAX) {
	if (csid_idx >= CAM_IFE_CSID_HW_NUM_MAX) {
		CAM_ERR(CAM_ISP, "Invalid csid index:%d", csid_idx);
		return rc;
	}
@@ -3441,7 +3441,7 @@ int cam_ife_csid_hw_probe_init(struct cam_hw_intf *csid_hw_intf,
			i++)
			kfree(ife_csid_hw->rdi_res[i].res_priv);

		for (i = 0; i < CAM_IFE_CSID_CID_RES_MAX; i++)
		for (i = 0; i < CAM_IFE_CSID_CID_MAX; i++)
			kfree(ife_csid_hw->cid_res[i].res_priv);

	}
@@ -3468,7 +3468,7 @@ int cam_ife_csid_hw_deinit(struct cam_ife_csid_hw *ife_csid_hw)
		i++) {
		kfree(ife_csid_hw->rdi_res[i].res_priv);
	}
	for (i = 0; i < CAM_IFE_CSID_CID_RES_MAX; i++)
	for (i = 0; i < CAM_IFE_CSID_CID_MAX; i++)
		kfree(ife_csid_hw->cid_res[i].res_priv);

	cam_ife_csid_deinit_soc_resources(&ife_csid_hw->hw_info->soc_info);
+2 −6
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 */

#ifndef _CAM_IFE_CSID_HW_H_
@@ -10,10 +10,6 @@
#include "cam_ife_csid_hw_intf.h"
#include "cam_ife_csid_soc.h"

#define CAM_IFE_CSID_HW_RES_MAX      4
#define CAM_IFE_CSID_CID_RES_MAX     4
#define CAM_IFE_CSID_RDI_MAX         4

#define CSID_CSI2_RX_INFO_PHY_DL0_EOT_CAPTURED    BIT(0)
#define CSID_CSI2_RX_INFO_PHY_DL1_EOT_CAPTURED    BIT(1)
#define CSID_CSI2_RX_INFO_PHY_DL2_EOT_CAPTURED    BIT(2)
@@ -476,7 +472,7 @@ struct cam_ife_csid_hw {
	struct cam_isp_resource_node     ipp_res;
	struct cam_isp_resource_node     ppp_res;
	struct cam_isp_resource_node     rdi_res[CAM_IFE_CSID_RDI_MAX];
	struct cam_isp_resource_node     cid_res[CAM_IFE_CSID_CID_RES_MAX];
	struct cam_isp_resource_node     cid_res[CAM_IFE_CSID_CID_MAX];
	struct completion                csid_top_complete;
	struct completion                csid_csi2_complete;
	struct completion                csid_ipp_complete;
+3 −3
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 */

#include <linux/slab.h>
@@ -11,7 +11,7 @@
#include "cam_ife_csid_hw_intf.h"
#include "cam_debug_util.h"

static struct cam_hw_intf *cam_ife_csid_hw_list[CAM_IFE_CSID_HW_RES_MAX] = {
static struct cam_hw_intf *cam_ife_csid_hw_list[CAM_IFE_CSID_HW_NUM_MAX] = {
	0, 0, 0, 0};

static char csid_dev_name[8];
@@ -85,7 +85,7 @@ int cam_ife_csid_probe(struct platform_device *pdev)
		csid_hw_intf->hw_idx);


	if (csid_hw_intf->hw_idx < CAM_IFE_CSID_HW_RES_MAX)
	if (csid_hw_intf->hw_idx < CAM_IFE_CSID_HW_NUM_MAX)
		cam_ife_csid_hw_list[csid_hw_intf->hw_idx] = csid_hw_intf;
	else
		goto free_dev;
+5 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 */

#include <linux/module.h>
@@ -23,6 +23,10 @@ static const struct of_device_id cam_ife_csid_lite_dt_match[] = {
		.compatible = "qcom,csid-lite175",
		.data = &cam_ife_csid_lite_hw_info,
	},
	{
		.compatible = "qcom,csid-lite480",
		.data = &cam_ife_csid_lite_hw_info,
	},
	{}
};
MODULE_DEVICE_TABLE(of, cam_ife_csid_lite_dt_match);
Loading