Merge tag 'dt2-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[firefly-linux-kernel-4.4.55.git] / drivers / media / platform / davinci / vpif_capture.c
index b054b7eec53dc5a98dd43ba02dd8e343bbc19005..fa0a51521772543316a27ec6d98cae3461d7e886 100644 (file)
@@ -213,8 +213,6 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
        /* Remove buffer from the buffer queue */
        list_del(&common->cur_frm->list);
        spin_unlock_irqrestore(&common->irqlock, flags);
-       /* Mark state of the current frame to active */
-       common->cur_frm->vb.state = VB2_BUF_STATE_ACTIVE;
 
        addr = vb2_dma_contig_plane_dma_addr(&common->cur_frm->vb, 0);
 
@@ -313,6 +311,8 @@ static struct vb2_ops video_qops = {
        .start_streaming        = vpif_start_streaming,
        .stop_streaming         = vpif_stop_streaming,
        .buf_queue              = vpif_buffer_queue,
+       .wait_prepare           = vb2_ops_wait_prepare,
+       .wait_finish            = vb2_ops_wait_finish,
 };
 
 /**
@@ -350,7 +350,6 @@ static void vpif_schedule_next_buffer(struct common_obj *common)
        /* Remove that buffer from the buffer queue */
        list_del(&common->next_frm->list);
        spin_unlock(&common->irqlock);
-       common->next_frm->vb.state = VB2_BUF_STATE_ACTIVE;
        addr = vb2_dma_contig_plane_dma_addr(&common->next_frm->vb, 0);
 
        /* Set top and bottom field addresses in VPIF registers */
@@ -373,7 +372,6 @@ static irqreturn_t vpif_channel_isr(int irq, void *dev_id)
        struct vpif_device *dev = &vpif_obj;
        struct common_obj *common;
        struct channel_obj *ch;
-       enum v4l2_field field;
        int channel_id = 0;
        int fid = -1, i;
 
@@ -383,8 +381,6 @@ static irqreturn_t vpif_channel_isr(int irq, void *dev_id)
 
        ch = dev->dev[channel_id];
 
-       field = ch->common[VPIF_VIDEO_INDEX].fmt.fmt.pix.field;
-
        for (i = 0; i < VPIF_NUMBER_OF_OBJECTS; i++) {
                common = &ch->common[i];
                /* skip If streaming is not started in this channel */
@@ -533,7 +529,7 @@ static int vpif_update_std_info(struct channel_obj *ch)
  */
 static void vpif_calculate_offsets(struct channel_obj *ch)
 {
-       unsigned int hpitch, vpitch, sizeimage;
+       unsigned int hpitch, sizeimage;
        struct video_obj *vid_ch = &(ch->video);
        struct vpif_params *vpifparams = &ch->vpifparams;
        struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
@@ -552,7 +548,6 @@ static void vpif_calculate_offsets(struct channel_obj *ch)
        sizeimage = common->fmt.fmt.pix.sizeimage;
 
        hpitch = common->fmt.fmt.pix.bytesperline;
-       vpitch = sizeimage / (hpitch * 2);
 
        if ((V4L2_FIELD_NONE == vid_ch->buf_field) ||
            (V4L2_FIELD_INTERLACED == vid_ch->buf_field)) {
@@ -1603,7 +1598,7 @@ static int vpif_suspend(struct device *dev)
                ch = vpif_obj.dev[i];
                common = &ch->common[VPIF_VIDEO_INDEX];
 
-               if (!vb2_is_streaming(&common->buffer_queue))
+               if (!vb2_start_streaming_called(&common->buffer_queue))
                        continue;
 
                mutex_lock(&common->lock);
@@ -1637,7 +1632,7 @@ static int vpif_resume(struct device *dev)
                ch = vpif_obj.dev[i];
                common = &ch->common[VPIF_VIDEO_INDEX];
 
-               if (!vb2_is_streaming(&common->buffer_queue))
+               if (!vb2_start_streaming_called(&common->buffer_queue))
                        continue;
 
                mutex_lock(&common->lock);
@@ -1663,7 +1658,6 @@ static SIMPLE_DEV_PM_OPS(vpif_pm_ops, vpif_suspend, vpif_resume);
 static __refdata struct platform_driver vpif_driver = {
        .driver = {
                .name   = VPIF_DRIVER_NAME,
-               .owner  = THIS_MODULE,
                .pm     = &vpif_pm_ops,
        },
        .probe = vpif_probe,