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

Commit d1469c8f authored by Ravikishore Pampana's avatar Ravikishore Pampana
Browse files

msm: camera: isp: Set device enable flag after enable csid hardware



Device enable flag is getting set after configuring the CSID csi rx
and csid path configuration. If irq comes after configuring the csi rx
hardware then irq handler is not handling as it is checking the device
enable flag. So set device enable flag after enabling the hardware.

CRs-Fixed: 2541840
Change-Id: I022b6dccef4153c34bc8cf99e7a18e2978f92d3f
Signed-off-by: default avatarRavikishore Pampana <rpampana@codeaurora.org>
parent cb1341b5
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -1194,6 +1194,7 @@ static int cam_ife_csid_enable_hw(struct cam_ife_csid_hw *csid_hw)
	struct cam_hw_soc_info                 *soc_info;
	struct cam_hw_soc_info                 *soc_info;
	uint32_t                               i, val;
	uint32_t                               i, val;
	int                                    clk_lvl;
	int                                    clk_lvl;
	unsigned long                          flags;


	csid_reg = csid_hw->csid_info->csid_reg;
	csid_reg = csid_hw->csid_info->csid_reg;
	soc_info = &csid_hw->hw_info->soc_info;
	soc_info = &csid_hw->hw_info->soc_info;
@@ -1274,6 +1275,10 @@ static int cam_ife_csid_enable_hw(struct cam_ife_csid_hw *csid_hw)
	CAM_DBG(CAM_ISP, "CSID:%d CSID HW version: 0x%x",
	CAM_DBG(CAM_ISP, "CSID:%d CSID HW version: 0x%x",
		csid_hw->hw_intf->hw_idx, val);
		csid_hw->hw_intf->hw_idx, val);


	spin_lock_irqsave(&csid_hw->lock_state, flags);
	csid_hw->device_enabled = 1;
	spin_unlock_irqrestore(&csid_hw->lock_state, flags);

	return 0;
	return 0;


disable_soc:
disable_soc:
@@ -3257,7 +3262,6 @@ int cam_ife_csid_init_hw(void *hw_priv,
	struct cam_hw_info                     *csid_hw_info;
	struct cam_hw_info                     *csid_hw_info;
	struct cam_isp_resource_node           *res;
	struct cam_isp_resource_node           *res;
	const struct cam_ife_csid_reg_offset   *csid_reg;
	const struct cam_ife_csid_reg_offset   *csid_reg;
	unsigned long                           flags;


	if (!hw_priv || !init_args ||
	if (!hw_priv || !init_args ||
		(arg_size != sizeof(struct cam_isp_resource_node))) {
		(arg_size != sizeof(struct cam_isp_resource_node))) {
@@ -3338,9 +3342,6 @@ int cam_ife_csid_init_hw(void *hw_priv,
	if (rc)
	if (rc)
		cam_ife_csid_disable_hw(csid_hw);
		cam_ife_csid_disable_hw(csid_hw);


	spin_lock_irqsave(&csid_hw->lock_state, flags);
	csid_hw->device_enabled = 1;
	spin_unlock_irqrestore(&csid_hw->lock_state, flags);
end:
end:
	mutex_unlock(&csid_hw->hw_info->hw_mutex);
	mutex_unlock(&csid_hw->hw_info->hw_mutex);
	return rc;
	return rc;