s2255drv.c (16217dc79dbc599b110dda26d0421df47904bba4) s2255drv.c (1bc177174b97e4df8d27b6c3cdd79ffea9e2d18e)
1/*
2 * s2255drv.c - a driver for the Sensoray 2255 USB video capture device
3 *
4 * Copyright (C) 2007-2014 by Sensoray Company Inc.
5 * Dean Anderson
6 *
7 * Some video buffer code based on vivi driver:
8 *

--- 703 unchanged lines hidden (view full) ---

712 spin_lock_irqsave(&vc->qlock, flags);
713 list_add_tail(&buf->list, &vc->buf_list);
714 spin_unlock_irqrestore(&vc->qlock, flags);
715}
716
717static int start_streaming(struct vb2_queue *vq, unsigned int count);
718static void stop_streaming(struct vb2_queue *vq);
719
1/*
2 * s2255drv.c - a driver for the Sensoray 2255 USB video capture device
3 *
4 * Copyright (C) 2007-2014 by Sensoray Company Inc.
5 * Dean Anderson
6 *
7 * Some video buffer code based on vivi driver:
8 *

--- 703 unchanged lines hidden (view full) ---

712 spin_lock_irqsave(&vc->qlock, flags);
713 list_add_tail(&buf->list, &vc->buf_list);
714 spin_unlock_irqrestore(&vc->qlock, flags);
715}
716
717static int start_streaming(struct vb2_queue *vq, unsigned int count);
718static void stop_streaming(struct vb2_queue *vq);
719
720static struct vb2_ops s2255_video_qops = {
720static const struct vb2_ops s2255_video_qops = {
721 .queue_setup = queue_setup,
722 .buf_prepare = buffer_prepare,
723 .buf_queue = buffer_queue,
724 .start_streaming = start_streaming,
725 .stop_streaming = stop_streaming,
726 .wait_prepare = vb2_ops_wait_prepare,
727 .wait_finish = vb2_ops_wait_finish,
728};

--- 1379 unchanged lines hidden (view full) ---

2108 int pipe;
2109 int retval;
2110 struct s2255_pipeinfo *pipe_info = &dev->pipe;
2111 pipe = usb_rcvbulkpipe(dev->udev, dev->read_endpoint);
2112 dprintk(dev, 2, "%s: IN %d\n", __func__, dev->read_endpoint);
2113 pipe_info->state = 1;
2114 pipe_info->err_count = 0;
2115 pipe_info->stream_urb = usb_alloc_urb(0, GFP_KERNEL);
721 .queue_setup = queue_setup,
722 .buf_prepare = buffer_prepare,
723 .buf_queue = buffer_queue,
724 .start_streaming = start_streaming,
725 .stop_streaming = stop_streaming,
726 .wait_prepare = vb2_ops_wait_prepare,
727 .wait_finish = vb2_ops_wait_finish,
728};

--- 1379 unchanged lines hidden (view full) ---

2108 int pipe;
2109 int retval;
2110 struct s2255_pipeinfo *pipe_info = &dev->pipe;
2111 pipe = usb_rcvbulkpipe(dev->udev, dev->read_endpoint);
2112 dprintk(dev, 2, "%s: IN %d\n", __func__, dev->read_endpoint);
2113 pipe_info->state = 1;
2114 pipe_info->err_count = 0;
2115 pipe_info->stream_urb = usb_alloc_urb(0, GFP_KERNEL);
2116 if (!pipe_info->stream_urb) {
2117 dev_err(&dev->udev->dev,
2118 "ReadStream: Unable to alloc URB\n");
2116 if (!pipe_info->stream_urb)
2119 return -ENOMEM;
2117 return -ENOMEM;
2120 }
2121 /* transfer buffer allocated in board_init */
2122 usb_fill_bulk_urb(pipe_info->stream_urb, dev->udev,
2123 pipe,
2124 pipe_info->transfer_buffer,
2125 pipe_info->cur_transfer_size,
2126 read_pipe_completion, pipe_info);
2127 retval = usb_submit_urb(pipe_info->stream_urb, GFP_KERNEL);
2128 if (retval) {

--- 156 unchanged lines hidden (view full) ---

2285 vc->dev = dev;
2286 init_waitqueue_head(&vc->wait_setmode);
2287 init_waitqueue_head(&vc->wait_vidstatus);
2288 spin_lock_init(&vc->qlock);
2289 mutex_init(&vc->vb_lock);
2290 }
2291
2292 dev->fw_data->fw_urb = usb_alloc_urb(0, GFP_KERNEL);
2118 /* transfer buffer allocated in board_init */
2119 usb_fill_bulk_urb(pipe_info->stream_urb, dev->udev,
2120 pipe,
2121 pipe_info->transfer_buffer,
2122 pipe_info->cur_transfer_size,
2123 read_pipe_completion, pipe_info);
2124 retval = usb_submit_urb(pipe_info->stream_urb, GFP_KERNEL);
2125 if (retval) {

--- 156 unchanged lines hidden (view full) ---

2282 vc->dev = dev;
2283 init_waitqueue_head(&vc->wait_setmode);
2284 init_waitqueue_head(&vc->wait_vidstatus);
2285 spin_lock_init(&vc->qlock);
2286 mutex_init(&vc->vb_lock);
2287 }
2288
2289 dev->fw_data->fw_urb = usb_alloc_urb(0, GFP_KERNEL);
2293 if (!dev->fw_data->fw_urb) {
2294 dev_err(&interface->dev, "out of memory!\n");
2290 if (!dev->fw_data->fw_urb)
2295 goto errorFWURB;
2291 goto errorFWURB;
2296 }
2297
2298 dev->fw_data->pfw_data = kzalloc(CHUNK_SIZE, GFP_KERNEL);
2299 if (!dev->fw_data->pfw_data) {
2300 dev_err(&interface->dev, "out of memory!\n");
2301 goto errorFWDATA2;
2302 }
2303 /* load the first chunk */
2304 if (request_firmware(&dev->fw_data->fw,

--- 101 unchanged lines hidden ---
2292
2293 dev->fw_data->pfw_data = kzalloc(CHUNK_SIZE, GFP_KERNEL);
2294 if (!dev->fw_data->pfw_data) {
2295 dev_err(&interface->dev, "out of memory!\n");
2296 goto errorFWDATA2;
2297 }
2298 /* load the first chunk */
2299 if (request_firmware(&dev->fw_data->fw,

--- 101 unchanged lines hidden ---