mirror of
https://github.com/torvalds/linux.git
synced 2026-05-22 22:22:08 +02:00
media: uvcvideo: Make power management granular
Now that every ioctl takes care of their power management we can remove the "global" power management. Despite its size, this is a relatively big change. We hope that there are no size effects of it. If there are some specific devices that miss-behave, we can add a small quirk for them. This patch introduces a behavioral change for the uvc "trigger" button. Before the "trigger" button would work as long as userspace has opened /dev/videoX. Now it only works when the camera is actually streaming. We consider that this the most common (if not the only) usecase and therefore we do not think of this as a regression. Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Message-ID: <20250327-uvc-granpower-ng-v6-4-35a2357ff348@chromium.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
This commit is contained in:
parent
10acb91013
commit
a32d9c41bd
|
|
@ -658,7 +658,6 @@ static int uvc_v4l2_open(struct file *file)
|
|||
{
|
||||
struct uvc_streaming *stream;
|
||||
struct uvc_fh *handle;
|
||||
int ret = 0;
|
||||
|
||||
stream = video_drvdata(file);
|
||||
uvc_dbg(stream->dev, CALLS, "%s\n", __func__);
|
||||
|
|
@ -668,12 +667,6 @@ static int uvc_v4l2_open(struct file *file)
|
|||
if (!handle)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = uvc_pm_get(stream->dev);
|
||||
if (ret) {
|
||||
kfree(handle);
|
||||
return ret;
|
||||
}
|
||||
|
||||
v4l2_fh_init(&handle->vfh, &stream->vdev);
|
||||
v4l2_fh_add(&handle->vfh);
|
||||
handle->chain = stream->chain;
|
||||
|
|
@ -707,7 +700,6 @@ static int uvc_v4l2_release(struct file *file)
|
|||
kfree(handle);
|
||||
file->private_data = NULL;
|
||||
|
||||
uvc_pm_put(stream->dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user