sel.which = V4L2_SUBDEV_FORMAT_TRY;
sel.target = V4L2_SEL_TGT_CROP;
sel.r = input->native_rect;
- v4l2_subdev_lock_state(input->try_sd_state);
+
+ /* Don't lock try_sd_state if the lock is shared with the active state */
+ if (!input->sensor->state_lock)
+ v4l2_subdev_lock_state(input->try_sd_state);
+
err = v4l2_subdev_call(input->sensor, pad, set_selection,
input->try_sd_state, &sel);
- v4l2_subdev_unlock_state(input->try_sd_state);
+
+ if (!input->sensor->state_lock)
+ v4l2_subdev_unlock_state(input->try_sd_state);
+
if (err)
goto unlock_act_sd_state;