if (ret)
return ret;
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
asd->subdev.devnode = vdev;
/* Deferred firmware loading case. */
*/
if (pipe->users) {
dev_dbg(isp->dev, "video node already opened\n");
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
return -EBUSY;
}
done:
pipe->users++;
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
/* Ensure that a mode is set */
v4l2_ctrl_s_ctrl(asd->run_mode, pipe->default_run_mode);
atomisp_css_uninit(isp);
pm_runtime_put(vdev->v4l2_dev->dev);
error:
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
v4l2_fh_release(file);
return ret;
}
return -EBADF;
mutex_lock(&isp->streamoff_mutex);
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
dev_dbg(isp->dev, "release device %s\n", vdev->name);
atomisp_subdev_source_pad(vdev),
V4L2_SEL_TGT_COMPOSE, 0,
&clear_compose);
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
mutex_unlock(&isp->streamoff_mutex);
return v4l2_fh_release(file);
if (!(vma->vm_flags & (VM_WRITE | VM_READ)))
return -EACCES;
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
if (!(vma->vm_flags & VM_SHARED)) {
/* Map private buffer.
*/
vma->vm_flags |= VM_SHARED;
ret = hmm_mmap(vma, vma->vm_pgoff << PAGE_SHIFT);
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
return ret;
}
}
raw_virt_addr->data_bytes = origin_size;
vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
return 0;
}
ret = -EINVAL;
goto error;
}
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
return atomisp_videobuf_mmap_mapper(&pipe->capq, vma);
error:
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
return ret;
}
struct atomisp_device *isp = video_get_drvdata(vdev);
struct atomisp_video_pipe *pipe = atomisp_to_video_pipe(vdev);
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
if (pipe->capq.streaming != 1) {
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
return EPOLLERR;
}
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
return videobuf_poll_stream(file, &pipe->capq, pt);
}
return -EINVAL;
}
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
*input = asd->input_curr;
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
return 0;
}
return -EINVAL;
}
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
if (input >= ATOM_ISP_MAX_INPUTS || input >= isp->input_cnt) {
dev_dbg(isp->dev, "input_cnt: %d\n", isp->input_cnt);
ret = -EINVAL;
asd->input_curr = input;
/* mark this camera is used by the current stream */
isp->inputs[input].asd = asd;
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
return 0;
error:
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
return ret;
}
return -EINVAL;
}
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
rval = v4l2_subdev_call(camera, pad, enum_mbus_code, NULL, &code);
if (rval == -ENOIOCTLCMD) {
"enum_mbus_code pad op not supported by %s. Please fix your sensor driver!\n",
camera->name);
}
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
if (rval)
return rval;
f->fmt.pix.width += pad_w;
f->fmt.pix.height += pad_h;
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
ret = atomisp_try_fmt(vdev, &f->fmt.pix, NULL);
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
if (ret)
return ret;
struct atomisp_device *isp = video_get_drvdata(vdev);
struct atomisp_video_pipe *pipe;
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
pipe = atomisp_to_video_pipe(vdev);
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
f->fmt.pix = pipe->pix;
struct atomisp_device *isp = video_get_drvdata(vdev);
int ret;
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
if (isp->isp_fatal_error) {
ret = -EIO;
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
return ret;
}
ret = atomisp_set_fmt(vdev, f);
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
return ret;
}
struct atomisp_device *isp = video_get_drvdata(vdev);
int ret;
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
ret = __atomisp_reqbufs(file, fh, req);
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
return ret;
}
return -EINVAL;
}
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
if (isp->isp_fatal_error) {
ret = -EIO;
goto error;
pipe->frame_params[buf->index] = NULL;
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
ret = videobuf_qbuf(&pipe->capq, buf);
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
if (ret)
goto error;
asd->pending_capture_request++;
dev_dbg(isp->dev, "Add one pending capture request.\n");
}
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
dev_dbg(isp->dev, "qbuf buffer %d (%s) for asd%d\n", buf->index,
vdev->name, asd->index);
return ret;
error:
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
return ret;
}
return -EINVAL;
}
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
if (isp->isp_fatal_error) {
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
return -EIO;
}
if (asd->streaming == ATOMISP_DEVICE_STREAMING_STOPPING) {
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
dev_err(isp->dev, "%s: reject, as ISP at stopping.\n",
__func__);
return -EIO;
}
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
ret = videobuf_dqbuf(&pipe->capq, buf, file->f_flags & O_NONBLOCK);
if (ret) {
dev_dbg(isp->dev, "<%s: %d\n", __func__, ret);
return ret;
}
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
buf->bytesused = pipe->pix.sizeimage;
buf->reserved = asd->frame_status[buf->index];
if (!(buf->flags & V4L2_BUF_FLAG_ERROR))
buf->reserved |= __get_frame_exp_id(pipe, buf) << 16;
buf->reserved2 = pipe->frame_config_id[buf->index];
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
dev_dbg(isp->dev,
"dqbuf buffer %d (%s) for asd%d with exp_id %d, isp_config_id %d\n",
return -EINVAL;
}
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
if (isp->isp_fatal_error) {
ret = -EIO;
goto out;
if (asd->delayed_init == ATOMISP_DELAYED_INIT_QUEUED) {
flush_work(&asd->delayed_init_work);
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
if (wait_for_completion_interruptible(
&asd->init_done) != 0)
return -ERESTARTSYS;
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
}
/* handle per_frame_setting parameter and buffers */
asd->delayed_init = ATOMISP_DELAYED_INIT_NOT_QUEUED;
}
out:
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
return ret;
}
if (first_streamoff) {
/* if other streams are running, should not disable watch dog */
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
atomisp_wdt_stop(asd, true);
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
}
spin_lock_irqsave(&isp->lock, flags);
int rval;
mutex_lock(&isp->streamoff_mutex);
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
rval = __atomisp_streamoff(file, fh, type);
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
mutex_unlock(&isp->streamoff_mutex);
return rval;
if (ret)
return ret;
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
switch (control->id) {
case V4L2_CID_IRIS_ABSOLUTE:
case V4L2_CID_TEST_PATTERN_COLOR_GR:
case V4L2_CID_TEST_PATTERN_COLOR_GB:
case V4L2_CID_TEST_PATTERN_COLOR_B:
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
return v4l2_g_ctrl(isp->inputs[asd->input_curr].camera->
ctrl_handler, control);
case V4L2_CID_COLORFX:
break;
}
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
return ret;
}
if (ret)
return ret;
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
switch (control->id) {
case V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE:
case V4L2_CID_EXPOSURE:
case V4L2_CID_TEST_PATTERN_COLOR_GR:
case V4L2_CID_TEST_PATTERN_COLOR_GB:
case V4L2_CID_TEST_PATTERN_COLOR_B:
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
return v4l2_s_ctrl(NULL,
isp->inputs[asd->input_curr].camera->
ctrl_handler, control);
ret = -EINVAL;
break;
}
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
return ret;
}
&ctrl);
break;
case V4L2_CID_ZOOM_ABSOLUTE:
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
ret = atomisp_digital_zoom(asd, 0, &ctrl.value);
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
break;
case V4L2_CID_G_SKIP_FRAMES:
ret = v4l2_subdev_call(
case V4L2_CID_FLASH_STROBE:
case V4L2_CID_FLASH_MODE:
case V4L2_CID_FLASH_STATUS_REGISTER:
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
if (isp->flash) {
ret =
v4l2_s_ctrl(NULL, isp->flash->ctrl_handler,
asd->params.num_flash_frames = 0;
}
}
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
break;
case V4L2_CID_ZOOM_ABSOLUTE:
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
ret = atomisp_digital_zoom(asd, 1, &ctrl.value);
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
break;
default:
ctr = v4l2_ctrl_find(&asd->ctrl_handler, ctrl.id);
return -EINVAL;
}
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
parm->parm.capture.capturemode = asd->run_mode->val;
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
return 0;
}
return -EINVAL;
}
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
asd->high_speed_mode = false;
switch (parm->parm.capture.capturemode) {
rval = v4l2_ctrl_s_ctrl(asd->run_mode, mode);
out:
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
return rval == -ENOIOCTLCMD ? 0 : rval;
}
/* we do not need take isp->mutex for these IOCTLs */
break;
default:
- rt_mutex_lock(&isp->mutex);
+ mutex_lock(&isp->mutex);
break;
}
switch (cmd) {
case ATOMISP_IOC_G_UPDATE_EXPOSURE:
break;
default:
- rt_mutex_unlock(&isp->mutex);
+ mutex_unlock(&isp->mutex);
break;
}
return err;