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

Commit c702b31d 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: sensor: Disable IRQ in csid after few frames"

parents 7d66b6f5 34bcc24c
Loading
Loading
Loading
Loading
+27 −3
Original line number Diff line number Diff line
@@ -194,10 +194,21 @@ static void msm_csid_set_debug_reg(struct csid_device *csid_dev,
	struct msm_camera_csid_params *csid_params) {}
#endif

static void msm_csid_set_sof_freeze_debug_reg(struct csid_device *csid_dev)
static void msm_csid_set_sof_freeze_debug_reg(
	struct csid_device *csid_dev, uint8_t irq_enable)
{
	uint32_t val = 0;

	if (!irq_enable) {
		val = msm_camera_io_r(csid_dev->base +
			csid_dev->ctrl_reg->csid_reg.csid_irq_status_addr);
		msm_camera_io_w(val, csid_dev->base +
			csid_dev->ctrl_reg->csid_reg.csid_irq_clear_cmd_addr);
		msm_camera_io_w(0, csid_dev->base +
			csid_dev->ctrl_reg->csid_reg.csid_irq_mask_addr);
		return;
	}

	if (csid_dev->csid_3p_enabled == 1) {
		val = ((1 << csid_dev->current_csid_params.lane_cnt) - 1) <<
			csid_dev->ctrl_reg->
@@ -446,6 +457,16 @@ static irqreturn_t msm_csid_irq(int irq_num, void *data)
		pr_err("%s:%d csid_dev NULL\n", __func__, __LINE__);
		return IRQ_HANDLED;
	}

	if (csid_dev->csid_sof_debug == SOF_DEBUG_ENABLE) {
		if (csid_dev->csid_sof_debug_count < CSID_SOF_DEBUG_COUNT)
			csid_dev->csid_sof_debug_count++;
		else {
			msm_csid_set_sof_freeze_debug_reg(csid_dev, false);
			return IRQ_HANDLED;
		}
	}

	irq = msm_camera_io_r(csid_dev->base +
		csid_dev->ctrl_reg->csid_reg.csid_irq_status_addr);
	pr_err_ratelimited("%s CSID%d_IRQ_STATUS_ADDR = 0x%x\n",
@@ -480,6 +501,7 @@ static int msm_csid_init(struct csid_device *csid_dev, uint32_t *csid_version)
		return rc;
	}

	csid_dev->csid_sof_debug_count = 0;
	csid_dev->reg_ptr = NULL;

	if (csid_dev->csid_state == CSID_POWER_UP) {
@@ -760,13 +782,14 @@ static long msm_csid_subdev_ioctl(struct v4l2_subdev *sd,
			break;
		if (csid_dev->csid_sof_debug == SOF_DEBUG_DISABLE) {
			csid_dev->csid_sof_debug = SOF_DEBUG_ENABLE;
			msm_csid_set_sof_freeze_debug_reg(csid_dev);
			msm_csid_set_sof_freeze_debug_reg(csid_dev, true);
		}
		break;
	case MSM_SD_UNNOTIFY_FREEZE:
		if (csid_dev->csid_state != CSID_POWER_UP)
			break;
		csid_dev->csid_sof_debug = SOF_DEBUG_DISABLE;
		msm_csid_set_sof_freeze_debug_reg(csid_dev, false);
		break;
	case VIDIOC_MSM_CSID_RELEASE:
	case MSM_SD_SHUTDOWN:
@@ -916,13 +939,14 @@ static long msm_csid_subdev_ioctl32(struct v4l2_subdev *sd,
			break;
		if (csid_dev->csid_sof_debug == SOF_DEBUG_DISABLE) {
			csid_dev->csid_sof_debug = SOF_DEBUG_ENABLE;
			msm_csid_set_sof_freeze_debug_reg(csid_dev);
			msm_csid_set_sof_freeze_debug_reg(csid_dev, true);
		}
		break;
	case MSM_SD_UNNOTIFY_FREEZE:
		if (csid_dev->csid_state != CSID_POWER_UP)
			break;
		csid_dev->csid_sof_debug = SOF_DEBUG_DISABLE;
		msm_csid_set_sof_freeze_debug_reg(csid_dev, false);
		break;
	case VIDIOC_MSM_CSID_RELEASE:
	case MSM_SD_SHUTDOWN:
+3 −0
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@
#include "msm_sd.h"
#include "cam_soc_api.h"

#define CSID_SOF_DEBUG_COUNT                      3

enum csiphy_lane_assign {
	PHY_LANE_D0,
	PHY_LANE_CLK,
@@ -112,6 +114,7 @@ struct csid_device {
	struct msm_camera_csid_params  current_csid_params;
	uint32_t csid_sof_debug;
	uint32_t csid_lane_cnt;
	uint32_t csid_sof_debug_count;
};

#define VIDIOC_MSM_CSID_RELEASE \