]> www.infradead.org Git - users/jedix/linux-maple.git/commit
media: uvcvideo: Increase/decrease the PM counter per IOCTL
authorRicardo Ribalda <ribalda@chromium.org>
Thu, 27 Mar 2025 21:05:29 +0000 (21:05 +0000)
committerHans Verkuil <hverkuil@xs4all.nl>
Fri, 9 May 2025 13:29:12 +0000 (15:29 +0200)
commit10acb9101355484c3e4f2625003cd1b6c203cfe4
tree019d87c3d3f7a16b23a72b3d118e1ee7980b8a57
parent2f101572c0a3ae4630f2a57c8033b78ee84ac5a6
media: uvcvideo: Increase/decrease the PM counter per IOCTL

Now we call uvc_pm_get/put from the device open/close. This low
level of granularity might leave the camera powered on in situations
where it is not needed.

Increase the granularity by increasing and decreasing the Power
Management counter per ioctl. There are two special cases where the
power management outlives the ioctl: async controls and streamon. Handle
those cases as well.

In a future patch, we will remove the uvc_pm_get/put from open/close.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Message-ID: <20250327-uvc-granpower-ng-v6-3-35a2357ff348@chromium.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/usb/uvc/uvc_ctrl.c
drivers/media/usb/uvc/uvc_v4l2.c