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

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

Merge "msm: camera: lrme: set the HW state regardless of stop result" into dev/msm-4.14-camx

parents 1f2db01f 20692275
Loading
Loading
Loading
Loading
+5 −6
Original line number Original line Diff line number Diff line
@@ -857,7 +857,8 @@ int cam_lrme_hw_stop(void *hw_priv, void *hw_stop_args, uint32_t arg_size)


	mutex_lock(&lrme_hw->hw_mutex);
	mutex_lock(&lrme_hw->hw_mutex);


	if (lrme_hw->open_count == 0) {
	if (lrme_hw->open_count == 0 ||
		lrme_hw->hw_state == CAM_HW_STATE_POWER_DOWN) {
		mutex_unlock(&lrme_hw->hw_mutex);
		mutex_unlock(&lrme_hw->hw_mutex);
		CAM_ERR(CAM_LRME, "Error Unbalanced stop");
		CAM_ERR(CAM_LRME, "Error Unbalanced stop");
		return -EINVAL;
		return -EINVAL;
@@ -886,10 +887,8 @@ int cam_lrme_hw_stop(void *hw_priv, void *hw_stop_args, uint32_t arg_size)
	}
	}


	rc = cam_lrme_soc_disable_resources(lrme_hw);
	rc = cam_lrme_soc_disable_resources(lrme_hw);
	if (rc) {
	if (rc)
		CAM_ERR(CAM_LRME, "Failed in Disable SOC, rc=%d", rc);
		CAM_ERR(CAM_LRME, "Failed in Disable SOC, rc=%d", rc);
		goto unlock;
	}


	lrme_hw->hw_state = CAM_HW_STATE_POWER_DOWN;
	lrme_hw->hw_state = CAM_HW_STATE_POWER_DOWN;
	if (lrme_core->state == CAM_LRME_CORE_STATE_IDLE) {
	if (lrme_core->state == CAM_LRME_CORE_STATE_IDLE) {
@@ -1051,9 +1050,9 @@ int cam_lrme_hw_flush(void *hw_priv, void *hw_flush_args, uint32_t arg_size)


	if (lrme_core->state != CAM_LRME_CORE_STATE_PROCESSING &&
	if (lrme_core->state != CAM_LRME_CORE_STATE_PROCESSING &&
		lrme_core->state != CAM_LRME_CORE_STATE_REQ_PENDING &&
		lrme_core->state != CAM_LRME_CORE_STATE_REQ_PENDING &&
		lrme_core->state == CAM_LRME_CORE_STATE_REQ_PROC_PEND) {
		lrme_core->state != CAM_LRME_CORE_STATE_REQ_PROC_PEND) {
		mutex_unlock(&lrme_hw->hw_mutex);
		mutex_unlock(&lrme_hw->hw_mutex);
		CAM_DBG(CAM_LRME, "Stop not needed in %d state",
		CAM_DBG(CAM_LRME, "Flush is not needed in %d state",
			lrme_core->state);
			lrme_core->state);
		return 0;
		return 0;
	}
	}