diff options
Diffstat (limited to 'drivers/staging/media/davinci_vpfe/vpfe_video.c')
-rw-r--r-- | drivers/staging/media/davinci_vpfe/vpfe_video.c | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/drivers/staging/media/davinci_vpfe/vpfe_video.c b/drivers/staging/media/davinci_vpfe/vpfe_video.c index db49af902..be72a8e5f 100644 --- a/drivers/staging/media/davinci_vpfe/vpfe_video.c +++ b/drivers/staging/media/davinci_vpfe/vpfe_video.c @@ -178,9 +178,10 @@ static int vpfe_update_pipe_state(struct vpfe_video_device *video) if (ret) return ret; - /* Find out if there is any input video - if yes, it is single shot. - */ + /* + * Find out if there is any input video + * if yes, it is single shot. + */ if (pipe->input_num == 0) { pipe->state = VPFE_PIPELINE_STREAM_CONTINUOUS; ret = vpfe_update_current_ext_subdev(video); @@ -460,7 +461,7 @@ void vpfe_video_schedule_next_buffer(struct vpfe_video_device *video) video->next_frm = list_entry(video->dma_queue.next, struct vpfe_cap_buffer, list); - if (VPFE_PIPELINE_STREAM_SINGLESHOT == video->pipe.state) + if (video->pipe.state == VPFE_PIPELINE_STREAM_SINGLESHOT) video->cur_frm = video->next_frm; list_del(&video->next_frm->list); @@ -529,10 +530,11 @@ static int vpfe_release(struct file *file) if (fh->io_allowed) { if (video->started) { vpfe_stop_capture(video); - /* mark pipe state as stopped in vpfe_release(), - as app might call streamon() after streamoff() - in which case driver has to start streaming. - */ + /* + * mark pipe state as stopped in vpfe_release(), + * as app might call streamon() after streamoff() + * in which case driver has to start streaming. + */ video->pipe.state = VPFE_PIPELINE_STREAM_STOPPED; vb2_streamoff(&video->buffer_queue, video->buffer_queue.type); @@ -672,8 +674,10 @@ static int vpfe_enum_fmt(struct file *file, void *priv, v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_enum_fmt\n"); - /* since already subdev pad format is set, - only one pixel format is available */ + /* + * since already subdev pad format is set, + * only one pixel format is available + */ if (fmt->index > 0) { v4l2_err(&vpfe_dev->v4l2_dev, "Invalid index\n"); return -EINVAL; @@ -1328,8 +1332,8 @@ static int vpfe_reqbufs(struct file *file, void *priv, v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_reqbufs\n"); - if (V4L2_BUF_TYPE_VIDEO_CAPTURE != req_buf->type && - V4L2_BUF_TYPE_VIDEO_OUTPUT != req_buf->type) { + if (req_buf->type != V4L2_BUF_TYPE_VIDEO_CAPTURE && + req_buf->type != V4L2_BUF_TYPE_VIDEO_OUTPUT){ v4l2_err(&vpfe_dev->v4l2_dev, "Invalid buffer type\n"); return -EINVAL; } @@ -1390,8 +1394,8 @@ static int vpfe_querybuf(struct file *file, void *priv, v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_querybuf\n"); - if (V4L2_BUF_TYPE_VIDEO_CAPTURE != buf->type && - V4L2_BUF_TYPE_VIDEO_OUTPUT != buf->type) { + if (buf->type != V4L2_BUF_TYPE_VIDEO_CAPTURE && + buf->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) { v4l2_err(&vpfe_dev->v4l2_dev, "Invalid buf type\n"); return -EINVAL; } @@ -1417,8 +1421,8 @@ static int vpfe_qbuf(struct file *file, void *priv, v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_qbuf\n"); - if (V4L2_BUF_TYPE_VIDEO_CAPTURE != p->type && - V4L2_BUF_TYPE_VIDEO_OUTPUT != p->type) { + if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE && + p->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) { v4l2_err(&vpfe_dev->v4l2_dev, "Invalid buf type\n"); return -EINVAL; } @@ -1445,8 +1449,8 @@ static int vpfe_dqbuf(struct file *file, void *priv, v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_dqbuf\n"); - if (V4L2_BUF_TYPE_VIDEO_CAPTURE != buf->type && - V4L2_BUF_TYPE_VIDEO_OUTPUT != buf->type) { + if (buf->type != V4L2_BUF_TYPE_VIDEO_CAPTURE && + buf->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) { v4l2_err(&vpfe_dev->v4l2_dev, "Invalid buf type\n"); return -EINVAL; } @@ -1478,8 +1482,8 @@ static int vpfe_streamon(struct file *file, void *priv, v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_streamon\n"); - if (V4L2_BUF_TYPE_VIDEO_CAPTURE != buf_type && - V4L2_BUF_TYPE_VIDEO_OUTPUT != buf_type) { + if (buf_type != V4L2_BUF_TYPE_VIDEO_CAPTURE && + buf_type != V4L2_BUF_TYPE_VIDEO_OUTPUT) { v4l2_err(&vpfe_dev->v4l2_dev, "Invalid buf type\n"); return ret; } @@ -1495,7 +1499,7 @@ static int vpfe_streamon(struct file *file, void *priv, return -EIO; } /* Validate the pipeline */ - if (V4L2_BUF_TYPE_VIDEO_CAPTURE == buf_type) { + if (buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { ret = vpfe_video_validate_pipeline(pipe); if (ret < 0) return ret; |