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

Commit 0490cb29 authored by Camera Software Integration's avatar Camera Software Integration Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: reqmgr: Pause the timer before sensor stream on" into camera-kernel.lnx.4.0

parents 55ff5254 fd450fbd
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -2078,7 +2078,9 @@ static int __cam_req_mgr_process_sof_freeze(void *priv, void *data)

	spin_lock_bh(&link->link_state_spin_lock);
	if ((link->watchdog) && (link->watchdog->pause_timer)) {
		CAM_INFO(CAM_CRM, "Watchdog Paused");
		CAM_INFO(CAM_CRM,
			"link:%x watchdog paused, maybe stream on/off is delayed",
			link->link_hdl);
		spin_unlock_bh(&link->link_state_spin_lock);
		return rc;
	}
@@ -3190,8 +3192,16 @@ static int cam_req_mgr_cb_notify_timer(
		rc = -EPERM;
		goto end;
	}
	if ((link->watchdog) && (!timer_data->state))
	if (link->watchdog) {
		if (!timer_data->state)
			link->watchdog->pause_timer = true;
		else
			link->watchdog->pause_timer = false;
		crm_timer_reset(link->watchdog);
		CAM_DBG(CAM_CRM, "link %x pause_timer %d",
			link->link_hdl, link->watchdog->pause_timer);
	}

	spin_unlock_bh(&link->link_state_spin_lock);

end:
@@ -3238,6 +3248,7 @@ static int cam_req_mgr_cb_notify_stop(
		goto end;
	}
	crm_timer_reset(link->watchdog);
	link->watchdog->pause_timer = true;
	spin_unlock_bh(&link->link_state_spin_lock);

	task = cam_req_mgr_workq_get_task(link->workq);
@@ -4286,6 +4297,8 @@ int cam_req_mgr_link_control(struct cam_req_mgr_link_control *control)
					link->link_hdl);
				rc = -EFAULT;
			}
			/* Pause the timer before sensor stream on */
			link->watchdog->pause_timer = true;
			/* notify nodes */
			for (j = 0; j < link->num_devs; j++) {
				dev = &link->l_dev[j];
+16 −0
Original line number Diff line number Diff line
@@ -932,6 +932,7 @@ int32_t cam_sensor_driver_cmd(struct cam_sensor_ctrl_t *s_ctrl,
		break;
	}
	case CAM_START_DEV: {
		struct cam_req_mgr_timer_notify timer;
		if ((s_ctrl->sensor_state == CAM_SENSOR_INIT) ||
			(s_ctrl->sensor_state == CAM_SENSOR_START)) {
			rc = -EINVAL;
@@ -952,6 +953,21 @@ int32_t cam_sensor_driver_cmd(struct cam_sensor_ctrl_t *s_ctrl,
			}
		}
		s_ctrl->sensor_state = CAM_SENSOR_START;

		if (s_ctrl->bridge_intf.crm_cb &&
			s_ctrl->bridge_intf.crm_cb->notify_timer) {
			timer.link_hdl = s_ctrl->bridge_intf.link_hdl;
			timer.dev_hdl = s_ctrl->bridge_intf.device_hdl;
			timer.state = true;
			rc = s_ctrl->bridge_intf.crm_cb->notify_timer(&timer);
			if (rc) {
				CAM_ERR(CAM_SENSOR,
					"Enable CRM SOF freeze timer failed rc: %d",
					rc);
				return rc;
			}
		}

		CAM_INFO(CAM_SENSOR,
			"CAM_START_DEV Success, sensor_id:0x%x,sensor_slave_addr:0x%x",
			s_ctrl->sensordata->slave_info.sensor_id,