summaryrefslogtreecommitdiff
path: root/drivers/media/usb/uvc/uvc_queue.c
diff options
context:
space:
mode:
authorRicardo Ribalda <ribalda@chromium.org>2025-06-16 18:24:41 +0300
committerHans Verkuil <hverkuil@xs4all.nl>2025-07-11 20:27:28 +0300
commit7dd56c47784a466b03df62ca766207f483353cdc (patch)
tree6807913e5a228001b5fb8581e6d524650fbca860 /drivers/media/usb/uvc/uvc_queue.c
parent54828c0d4f909bd706e15cfaa29758f2c1d59212 (diff)
downloadlinux-7dd56c47784a466b03df62ca766207f483353cdc.tar.xz
media: uvcvideo: Remove stream->is_streaming field
The is_streaming field is used by modular PM to know if the device is currently streaming or not. With the transition to vb2 and fop helpers, we can use vb2 functions for the same functionality. The great benefit is that vb2 already tracks the streaming state for us. Reviewed-by: Hans de Goede <hansg@kernel.org> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Link: https://lore.kernel.org/r/20250616-uvc-fop-v4-4-250286570ee7@chromium.org Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans de Goede <hansg@kernel.org> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'drivers/media/usb/uvc/uvc_queue.c')
-rw-r--r--drivers/media/usb/uvc/uvc_queue.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/usb/uvc/uvc_queue.c b/drivers/media/usb/uvc/uvc_queue.c
index b11f56d62ec0..790184c9843d 100644
--- a/drivers/media/usb/uvc/uvc_queue.c
+++ b/drivers/media/usb/uvc/uvc_queue.c
@@ -175,12 +175,18 @@ static int uvc_start_streaming_video(struct vb2_queue *vq, unsigned int count)
lockdep_assert_irqs_enabled();
+ ret = uvc_pm_get(stream->dev);
+ if (ret)
+ return ret;
+
queue->buf_used = 0;
ret = uvc_video_start_streaming(stream);
if (ret == 0)
return 0;
+ uvc_pm_put(stream->dev);
+
uvc_queue_return_buffers(queue, UVC_BUF_STATE_QUEUED);
return ret;
@@ -189,11 +195,14 @@ static int uvc_start_streaming_video(struct vb2_queue *vq, unsigned int count)
static void uvc_stop_streaming_video(struct vb2_queue *vq)
{
struct uvc_video_queue *queue = vb2_get_drv_priv(vq);
+ struct uvc_streaming *stream = uvc_queue_to_stream(queue);
lockdep_assert_irqs_enabled();
uvc_video_stop_streaming(uvc_queue_to_stream(queue));
+ uvc_pm_put(stream->dev);
+
uvc_queue_return_buffers(queue, UVC_BUF_STATE_ERROR);
}