| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * uvc_queue.c -- USB Video Class driver - Buffers management |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2005-2010 |
|---|
| 5 | 6 | * Laurent Pinchart (laurent.pinchart@ideasonboard.com) |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 8 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 9 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 10 | | - * (at your option) any later version. |
|---|
| 11 | | - * |
|---|
| 12 | 7 | */ |
|---|
| 13 | 8 | |
|---|
| 14 | 9 | #include <linux/atomic.h> |
|---|
| .. | .. |
|---|
| 84 | 79 | |
|---|
| 85 | 80 | switch (vq->type) { |
|---|
| 86 | 81 | case V4L2_BUF_TYPE_META_CAPTURE: |
|---|
| 87 | | - size = UVC_METATADA_BUF_SIZE; |
|---|
| 82 | + size = UVC_METADATA_BUF_SIZE; |
|---|
| 88 | 83 | break; |
|---|
| 89 | 84 | |
|---|
| 90 | 85 | default: |
|---|
| .. | .. |
|---|
| 176 | 171 | |
|---|
| 177 | 172 | queue->buf_used = 0; |
|---|
| 178 | 173 | |
|---|
| 179 | | - ret = uvc_video_enable(stream, 1); |
|---|
| 174 | + ret = uvc_video_start_streaming(stream); |
|---|
| 180 | 175 | if (ret == 0) |
|---|
| 181 | 176 | return 0; |
|---|
| 182 | 177 | |
|---|
| .. | .. |
|---|
| 194 | 189 | lockdep_assert_irqs_enabled(); |
|---|
| 195 | 190 | |
|---|
| 196 | 191 | if (vq->type != V4L2_BUF_TYPE_META_CAPTURE) |
|---|
| 197 | | - uvc_video_enable(uvc_queue_to_stream(queue), 0); |
|---|
| 192 | + uvc_video_stop_streaming(uvc_queue_to_stream(queue)); |
|---|
| 198 | 193 | |
|---|
| 199 | 194 | spin_lock_irq(&queue->irqlock); |
|---|
| 200 | 195 | uvc_queue_return_buffers(queue, UVC_BUF_STATE_ERROR); |
|---|
| .. | .. |
|---|
| 303 | 298 | return ret; |
|---|
| 304 | 299 | } |
|---|
| 305 | 300 | |
|---|
| 306 | | -int uvc_queue_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf) |
|---|
| 301 | +int uvc_queue_buffer(struct uvc_video_queue *queue, |
|---|
| 302 | + struct media_device *mdev, struct v4l2_buffer *buf) |
|---|
| 307 | 303 | { |
|---|
| 308 | 304 | int ret; |
|---|
| 309 | 305 | |
|---|
| 310 | 306 | mutex_lock(&queue->mutex); |
|---|
| 311 | | - ret = vb2_qbuf(&queue->queue, buf); |
|---|
| 307 | + ret = vb2_qbuf(&queue->queue, mdev, buf); |
|---|
| 312 | 308 | mutex_unlock(&queue->mutex); |
|---|
| 313 | 309 | |
|---|
| 314 | 310 | return ret; |
|---|