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

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

Merge "msm: camera: Call secure camera during stream on" into dev/msm-4.9-camx

parents dd873c09 07659728
Loading
Loading
Loading
Loading
+25 −15
Original line number Diff line number Diff line
@@ -140,12 +140,6 @@ int32_t cam_cmd_buf_parser(struct csiphy_device *csiphy_dev,
	csiphy_dev->csiphy_info.data_rate = cam_cmd_csiphy_info->data_rate;
	csiphy_dev->csiphy_info.secure_mode = cam_cmd_csiphy_info->secure_mode;

	if (csiphy_dev->csiphy_info.secure_mode &&
		(csiphy_dev->config_count == 1))
		rc = cam_csiphy_notify_secure_mode(
			csiphy_dev->soc_info.index,
			CAM_SECURE_MODE_SECURE);

	return rc;
}

@@ -365,6 +359,14 @@ void cam_csiphy_shutdown(struct csiphy_device *csiphy_dev)
	if (csiphy_dev->csiphy_state == CAM_CSIPHY_START) {
		soc_info = &csiphy_dev->soc_info;

		if (csiphy_dev->csiphy_info.secure_mode)
			cam_csiphy_notify_secure_mode(
				csiphy_dev->soc_info.index,
				CAM_SECURE_MODE_NON_SECURE);

		csiphy_dev->csiphy_info.secure_mode =
			CAM_SECURE_MODE_NON_SECURE;

		cam_csiphy_reset(csiphy_dev);
		cam_soc_util_disable_platform_resource(soc_info, true, true);

@@ -553,6 +555,14 @@ int32_t cam_csiphy_core_cfg(void *phy_dev,
			goto release_mutex;
		}

		if (csiphy_dev->csiphy_info.secure_mode)
			cam_csiphy_notify_secure_mode(
				csiphy_dev->soc_info.index,
				CAM_SECURE_MODE_NON_SECURE);

		csiphy_dev->csiphy_info.secure_mode =
			CAM_SECURE_MODE_NON_SECURE;

		rc = cam_csiphy_disable_hw(csiphy_dev);
		if (rc < 0)
			CAM_ERR(CAM_CSIPHY, "Failed in csiphy release");
@@ -597,15 +607,6 @@ int32_t cam_csiphy_core_cfg(void *phy_dev,
		csiphy_dev->config_count--;
		csiphy_dev->acquire_count--;

		if (csiphy_dev->csiphy_info.secure_mode &&
			(!csiphy_dev->config_count)) {
			csiphy_dev->csiphy_info.secure_mode =
				CAM_SECURE_MODE_NON_SECURE;
			rc = cam_csiphy_notify_secure_mode(
				csiphy_dev->soc_info.index,
				CAM_SECURE_MODE_NON_SECURE);
		}

		if (csiphy_dev->acquire_count == 0)
			csiphy_dev->csiphy_state = CAM_CSIPHY_INIT;
	}
@@ -646,6 +647,15 @@ int32_t cam_csiphy_core_cfg(void *phy_dev,
			goto release_mutex;
		}

		if (csiphy_dev->csiphy_info.secure_mode) {
			rc = cam_csiphy_notify_secure_mode(
				csiphy_dev->soc_info.index,
				CAM_SECURE_MODE_SECURE);
			if (rc < 0)
				csiphy_dev->csiphy_info.secure_mode =
					CAM_SECURE_MODE_NON_SECURE;
		}

		rc = cam_csiphy_enable_hw(csiphy_dev);
		if (rc != 0) {
			CAM_ERR(CAM_CSIPHY, "cam_csiphy_enable_hw failed");