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

Commit 0472f983 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: add new version of CSID registers"

parents 5860b034 3d226021
Loading
Loading
Loading
Loading
+63 −0
Original line number Diff line number Diff line
/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef MSM_CSID_3_4_1_HWREG_H
#define MSM_CSID_3_4_1_HWREG_H

#include <sensor/csid/msm_csid.h>
uint8_t csid_lane_assign_v3_4_1[PHY_LANE_MAX] = {0, 1, 2, 3, 4};

struct csid_reg_parms_t csid_v3_4_1 = {
	/* MIPI	CSID registers */
	0x0,
	0x4,
	0x8,
	0xC,
	0x10,
	0x14,
	0x18,
	0x1C,
	0x20,
	0x60,
	0x64,
	0x68,
	0x6C,
	0x70,
	0x74,
	0x78,
	0x7C,
	0x80,
	0x84,
	0x88,
	0x8C,
	0x90,
	0x94,
	0x98,
	0xA0,
	0xA4,
	0xAC,
	0xB0,
	0xB4,
	11,
	0x7FFF,
	0x4,
	17,
	0x30040001,
	0xFFFFFFFF,
	0xFFFFFFFF,
	0xFFFFFFFF,
	0x7f010800,
	20,
	0xFFFFFFFF,
	0xFFFFFFFF,
};
#endif
+63 −0
Original line number Diff line number Diff line
/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef MSM_CSID_3_6_0_HWREG_H
#define MSM_CSID_3_6_0_HWREG_H

#include <sensor/csid/msm_csid.h>

uint8_t csid_lane_assign_v3_6_0[PHY_LANE_MAX] = {0, 1, 2, 3, 4};
struct csid_reg_parms_t csid_v3_6_0 = {
	/* MIPI	CSID registers */
	0x0,
	0x4,
	0x8,
	0xC,
	0x10,
	0x14,
	0x18,
	0x1C,
	0x20,
	0x60,
	0x64,
	0x68,
	0x6C,
	0x70,
	0x74,
	0x78,
	0x7C,
	0x80,
	0x84,
	0x88,
	0x8C,
	0x90,
	0x94,
	0x98,
	0xA0,
	0xA4,
	0xAC,
	0xB0,
	0xB4,
	11,
	0x7FFF,
	0x4,
	17,
	0x30060000,
	0xFFFFFFFF,
	0xFFFFFFFF,
	0xFFFFFFFF,
	0x7f010800,
	20,
	0xFFFFFFFF,
	0xFFFFFFFF,
};
#endif
+55 −21
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@
#include "include/msm_csid_3_1_hwreg.h"
#include "include/msm_csid_3_2_hwreg.h"
#include "include/msm_csid_3_5_hwreg.h"
#include "include/msm_csid_3_4_1_hwreg.h"
#include "include/msm_csid_3_6_0_hwreg.h"
#include "cam_hw_ops.h"

#define V4L2_IDENT_CSID                            50002
@@ -36,6 +38,8 @@
#define CSID_VERSION_V32                      0x30020000
#define CSID_VERSION_V33                      0x30030000
#define CSID_VERSION_V34                      0x30040000
#define CSID_VERSION_V34_1                    0x30040001
#define CSID_VERSION_V36                      0x30060000
#define CSID_VERSION_V37                      0x30070000
#define CSID_VERSION_V35                      0x30050000
#define CSID_VERSION_V40                      0x40000000
@@ -130,6 +134,14 @@ static void msm_csid_set_debug_reg(struct csid_device *csid_dev,
{
	uint32_t val = 0;

	if ((csid_dev->hw_dts_version == CSID_VERSION_V34_1) ||
		(csid_dev->hw_dts_version == CSID_VERSION_V36)) {
			val = ((1 << csid_params->lane_cnt) - 1) << 20;
			msm_camera_io_w(0x7f010800 | val, csid_dev->base +
			csid_dev->ctrl_reg->csid_reg.csid_irq_mask_addr);
			msm_camera_io_w(0x7f010800 | val, csid_dev->base +
			csid_dev->ctrl_reg->csid_reg.csid_irq_clear_cmd_addr);
	} else {
		if (csid_dev->csid_3p_enabled == 1) {
			val = ((1 << csid_params->lane_cnt) - 1) <<
				csid_dev->ctrl_reg->
@@ -145,12 +157,21 @@ static void msm_csid_set_debug_reg(struct csid_device *csid_dev,
		msm_camera_io_w(val, csid_dev->base +
		csid_dev->ctrl_reg->csid_reg.csid_irq_clear_cmd_addr);
	}
}
#elif(SHORT_PKT_CAPTURE)
static void msm_csid_set_debug_reg(struct csid_device *csid_dev,
	struct msm_camera_csid_params *csid_params)
{
	uint32_t val = 0;

	if ((csid_dev->hw_dts_version == CSID_VERSION_V34_1) ||
		(csid_dev->hw_dts_version == CSID_VERSION_V36)) {
			val = ((1 << csid_params->lane_cnt) - 1) << 20;
			msm_camera_io_w(0x7f010a00 | val, csid_dev->base +
			csid_dev->ctrl_reg->csid_reg.csid_irq_mask_addr);
			msm_camera_io_w(0x7f010a00 | val, csid_dev->base +
			csid_dev->ctrl_reg->csid_reg.csid_irq_clear_cmd_addr);
	} else {
		if (csid_dev->csid_3p_enabled == 1) {
			val = ((1 << csid_params->lane_cnt) - 1) <<
				csid_dev->ctrl_reg->
@@ -167,6 +188,7 @@ static void msm_csid_set_debug_reg(struct csid_device *csid_dev,
		msm_camera_io_w(val, csid_dev->base +
		csid_dev->ctrl_reg->csid_reg.csid_irq_clear_cmd_addr);
	}
}
#else
static void msm_csid_set_debug_reg(struct csid_device *csid_dev,
	struct msm_camera_csid_params *csid_params) {}
@@ -1218,6 +1240,18 @@ static int csid_probe(struct platform_device *pdev)
		new_csid_dev->ctrl_reg->csid_lane_assign =
			csid_lane_assign_v3_2;
		new_csid_dev->hw_dts_version = CSID_VERSION_V32;
	} else if (of_device_is_compatible(new_csid_dev->pdev->dev.of_node,
		"qcom,csid-v3.4.1")) {
		new_csid_dev->ctrl_reg->csid_reg = csid_v3_4_1;
		new_csid_dev->hw_dts_version = CSID_VERSION_V34_1;
		new_csid_dev->ctrl_reg->csid_lane_assign =
			csid_lane_assign_v3_4_1;
	} else if (of_device_is_compatible(new_csid_dev->pdev->dev.of_node,
		"qcom,csid-v3.6.0")) {
		new_csid_dev->ctrl_reg->csid_reg = csid_v3_6_0;
		new_csid_dev->hw_dts_version = CSID_VERSION_V36;
				new_csid_dev->ctrl_reg->csid_lane_assign =
			csid_lane_assign_v3_6_0;
	} else if (of_device_is_compatible(new_csid_dev->pdev->dev.of_node,
		"qcom,csid-v3.5")) {
		new_csid_dev->ctrl_reg->csid_reg = csid_v3_5;