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

Commit 8819f223 authored by Tony Lijo Jose's avatar Tony Lijo Jose Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: sensor: Add check to know if device acquired



Allow to submit the configdev packets only if the device is acquired.

Change-Id: I18096104cdcb4f88b7a9fb7e2ccfae170103665b
Signed-off-by: default avatarTony Lijo Jose <tjose@codeaurora.org>
parent 7f6647e2
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -927,6 +927,16 @@ int32_t cam_sensor_driver_cmd(struct cam_sensor_ctrl_t *s_ctrl,
	}
		break;
	case CAM_CONFIG_DEV: {
		if (s_ctrl->sensor_state < CAM_SENSOR_ACQUIRE) {
			rc = -EINVAL;
			CAM_ERR(CAM_SENSOR,
				"sensor_id:[0x%x] not acquired to configure [%d] ",
				s_ctrl->sensordata->slave_info.sensor_id,
				s_ctrl->sensor_state
			);
			goto release_mutex;
		}

		rc = cam_sensor_i2c_pkt_parse(s_ctrl, arg);
		if (rc < 0) {
			CAM_ERR(CAM_SENSOR, "Failed i2c pkt parse: %d", rc);