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

Commit 106041d4 authored by Jeyaprakash Soundrapandian's avatar Jeyaprakash Soundrapandian Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: icp: Deinit A5 before irq reset" into dev/msm-4.9-camx

parents c6d00752 6baba8c7
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -203,8 +203,8 @@ struct cam_hw_config_args {
 * @hw_write:              Function pointer for Write hardware registers
 * @hw_cmd:                Function pointer for any customized commands for the
 *                         hardware manager
 * @download_fw:           Function pointer for firmware downloading
 * @hw_close:              Function pointer for subdev close
 * @hw_open:               Function pointer for HW init
 * @hw_close:              Function pointer for HW deinit
 *
 */
struct cam_hw_mgr_intf {
@@ -220,7 +220,7 @@ struct cam_hw_mgr_intf {
	int (*hw_read)(void *hw_priv, void *read_args);
	int (*hw_write)(void *hw_priv, void *write_args);
	int (*hw_cmd)(void *hw_priv, void *write_args);
	int (*download_fw)(void *hw_priv, void *fw_download_args);
	int (*hw_open)(void *hw_priv, void *fw_download_args);
	int (*hw_close)(void *hw_priv, void *hw_close_args);
};

+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ static int cam_icp_subdev_open(struct v4l2_subdev *sd,
	}

	hw_mgr_intf = &node->hw_mgr_intf;
	rc = hw_mgr_intf->download_fw(hw_mgr_intf->hw_mgr_priv, NULL);
	rc = hw_mgr_intf->hw_open(hw_mgr_intf->hw_mgr_priv, NULL);
	if (rc < 0) {
		CAM_ERR(CAM_ICP, "FW download failed");
		goto end;
+13 −12
Original line number Diff line number Diff line
@@ -1703,15 +1703,6 @@ static int cam_icp_mgr_hw_close(void *hw_priv, void *hw_close_args)
		return -EINVAL;
	}

	irq_cb.icp_hw_mgr_cb = NULL;
	irq_cb.data = NULL;
	rc = a5_dev_intf->hw_ops.process_cmd(
		a5_dev_intf->hw_priv,
		CAM_ICP_A5_SET_IRQ_CB,
		&irq_cb, sizeof(irq_cb));
	if (rc)
		CAM_ERR(CAM_ICP, "deregister irq call back failed");

	fw_buf_info.kva = 0;
	fw_buf_info.iova = 0;
	fw_buf_info.len = 0;
@@ -1730,6 +1721,16 @@ static int cam_icp_mgr_hw_close(void *hw_priv, void *hw_close_args)
	mutex_lock(&hw_mgr->hw_mgr_mutex);
	cam_hfi_deinit();
	cam_icp_mgr_device_deinit(hw_mgr);

	irq_cb.icp_hw_mgr_cb = NULL;
	irq_cb.data = NULL;
	rc = a5_dev_intf->hw_ops.process_cmd(
		a5_dev_intf->hw_priv,
		CAM_ICP_A5_SET_IRQ_CB,
		&irq_cb, sizeof(irq_cb));
	if (rc)
		CAM_ERR(CAM_ICP, "deregister irq call back failed");

	cam_icp_free_hfi_mem();
	hw_mgr->fw_download = false;
	hw_mgr->secure_mode = CAM_SECURE_MODE_NON_SECURE;
@@ -1911,7 +1912,7 @@ static int cam_icp_mgr_send_fw_init(struct cam_icp_hw_mgr *hw_mgr)
	return rc;
}

static int cam_icp_mgr_download_fw(void *hw_mgr_priv, void *download_fw_args)
static int cam_icp_mgr_hw_open(void *hw_mgr_priv, void *download_fw_args)
{
	struct cam_hw_intf *a5_dev_intf = NULL;
	struct cam_hw_info *a5_dev = NULL;
@@ -2752,7 +2753,7 @@ static int cam_icp_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args)
		rc = cam_icp_clk_info_init(hw_mgr, ctx_data);
		if (rc)
			goto get_io_buf_failed;
		rc = cam_icp_mgr_download_fw(hw_mgr, ctx_data);
		rc = cam_icp_mgr_hw_open(hw_mgr, ctx_data);
		if (rc)
			goto get_io_buf_failed;
		rc = cam_icp_mgr_ipe_bps_resume(hw_mgr, ctx_data);
@@ -3071,7 +3072,7 @@ int cam_icp_hw_mgr_init(struct device_node *of_node, uint64_t *hw_mgr_hdl)
	hw_mgr_intf->hw_release = cam_icp_mgr_release_hw;
	hw_mgr_intf->hw_prepare_update = cam_icp_mgr_prepare_hw_update;
	hw_mgr_intf->hw_config = cam_icp_mgr_config_hw;
	hw_mgr_intf->download_fw = cam_icp_mgr_download_fw;
	hw_mgr_intf->hw_open = cam_icp_mgr_hw_open;
	hw_mgr_intf->hw_close = cam_icp_mgr_hw_close;

	icp_hw_mgr.secure_mode = CAM_SECURE_MODE_NON_SECURE;
+2 −1
Original line number Diff line number Diff line
@@ -282,5 +282,6 @@ struct cam_icp_hw_mgr {
};

static int cam_icp_mgr_hw_close(void *hw_priv, void *hw_close_args);
static int cam_icp_mgr_download_fw(void *hw_mgr_priv, void *download_fw_args);
static int cam_icp_mgr_hw_open(void *hw_mgr_priv, void *download_fw_args);

#endif /* CAM_ICP_HW_MGR_H */