]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/media/usb/airspy/airspy.c
Merge remote-tracking branch 'v4l-dvb/master'
[karo-tx-linux.git] / drivers / media / usb / airspy / airspy.c
index 8f2e1c277c5f3a02f8e5c5ef4978dc460a6a1e8c..fcbb49757614487aa0a88e2740bc0dcd4ff73236 100644 (file)
@@ -21,6 +21,7 @@
 #include <media/v4l2-ioctl.h>
 #include <media/v4l2-ctrls.h>
 #include <media/v4l2-event.h>
+#include <media/videobuf2-v4l2.h>
 #include <media/videobuf2-vmalloc.h>
 
 /* AirSpy USB API commands (from AirSpy Library) */
@@ -97,7 +98,8 @@ static const unsigned int NUM_FORMATS = ARRAY_SIZE(formats);
 
 /* intermediate buffers with raw data from the USB device */
 struct airspy_frame_buf {
-       struct vb2_buffer vb;   /* common v4l buffer stuff -- must be first */
+       /* common v4l buffer stuff -- must be first */
+       struct vb2_v4l2_buffer vb;
        struct list_head list;
 };
 
@@ -310,13 +312,13 @@ static void airspy_urb_complete(struct urb *urb)
                }
 
                /* fill framebuffer */
-               ptr = vb2_plane_vaddr(&fbuf->vb, 0);
+               ptr = vb2_plane_vaddr(&fbuf->vb.vb2_buf, 0);
                len = airspy_convert_stream(s, ptr, urb->transfer_buffer,
                                urb->actual_length);
-               vb2_set_plane_payload(&fbuf->vb, 0, len);
-               v4l2_get_timestamp(&fbuf->vb.v4l2_buf.timestamp);
-               fbuf->vb.v4l2_buf.sequence = s->sequence++;
-               vb2_buffer_done(&fbuf->vb, VB2_BUF_STATE_DONE);
+               vb2_set_plane_payload(&fbuf->vb.vb2_buf, 0, len);
+               v4l2_get_timestamp(&fbuf->vb.timestamp);
+               fbuf->vb.sequence = s->sequence++;
+               vb2_buffer_done(&fbuf->vb.vb2_buf, VB2_BUF_STATE_DONE);
        }
 skip:
        usb_submit_urb(urb, GFP_ATOMIC);
@@ -459,7 +461,7 @@ static void airspy_cleanup_queued_bufs(struct airspy *s)
                buf = list_entry(s->queued_bufs.next,
                                struct airspy_frame_buf, list);
                list_del(&buf->list);
-               vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR);
+               vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR);
        }
        spin_unlock_irqrestore(&s->queued_bufs_lock, flags);
 }
@@ -486,7 +488,7 @@ static void airspy_disconnect(struct usb_interface *intf)
 
 /* Videobuf2 operations */
 static int airspy_queue_setup(struct vb2_queue *vq,
-               const struct v4l2_format *fmt, unsigned int *nbuffers,
+               const void *parg, unsigned int *nbuffers,
                unsigned int *nplanes, unsigned int sizes[], void *alloc_ctxs[])
 {
        struct airspy *s = vb2_get_drv_priv(vq);
@@ -505,14 +507,15 @@ static int airspy_queue_setup(struct vb2_queue *vq,
 
 static void airspy_buf_queue(struct vb2_buffer *vb)
 {
+       struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);
        struct airspy *s = vb2_get_drv_priv(vb->vb2_queue);
        struct airspy_frame_buf *buf =
-                       container_of(vb, struct airspy_frame_buf, vb);
+                       container_of(vbuf, struct airspy_frame_buf, vb);
        unsigned long flags;
 
        /* Check the device has not disconnected between prep and queuing */
        if (unlikely(!s->udev)) {
-               vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR);
+               vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR);
                return;
        }
 
@@ -571,7 +574,8 @@ err_clear_bit:
 
                list_for_each_entry_safe(buf, tmp, &s->queued_bufs, list) {
                        list_del(&buf->list);
-                       vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED);
+                       vb2_buffer_done(&buf->vb.vb2_buf,
+                                       VB2_BUF_STATE_QUEUED);
                }
        }