[PATCH v6 0/5] media: uvcvideo: Implement Granular Power Saving
From: Ricardo Ribalda
Date: Thu Mar 27 2025 - 17:05:41 EST
Right now we power-up the device when a user open() the device and we
power it off when the last user close() the first video node.
This behaviour affects the power consumption of the device is multiple
use cases, such as:
- Polling the privacy gpio
- udev probing the device
This patchset introduces a more granular power saving behaviour where
the camera is only awaken when needed. It is compatible with
asynchronous controls.
Signed-off-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
---
Changes in v6:
- Improve error handling
- Use __free instead of guards()
- Rename uvc_v4l2_unlocked_ioctl
- Link to v5: https://lore.kernel.org/r/20250303-uvc-granpower-ng-v5-0-a3dfbe29fe91@xxxxxxxxxxxx
Changes in v5:
- Improve "media: uvcvideo: Make power management granular" commit
message.
- Link to v4: https://lore.kernel.org/r/20250226-uvc-granpower-ng-v4-0-3ec9be906048@xxxxxxxxxxxx
Changes in v4:
- CodeStyle
- Create uvc_pm_ functions
- Link to v3: https://lore.kernel.org/r/20250206-uvc-granpower-ng-v3-0-32d0d7b0c5d8@xxxxxxxxxxxx
Changes in v3:
- Fix build error on sh4.
- Link to v2: https://lore.kernel.org/r/20250203-uvc-granpower-ng-v2-0-bef4b55e7b67@xxxxxxxxxxxx
Changes in v2:
- Add missing semicolon.
- Rebase on top of media-committers/next
- Link to v1: https://lore.kernel.org/r/20241126-uvc-granpower-ng-v1-0-6312bf26549c@xxxxxxxxxxxx
---
Ricardo Ribalda (5):
media: uvcvideo: Keep streaming state in the file handle
media: uvcvideo: Create uvc_pm_(get|put) functions
media: uvcvideo: Increase/decrease the PM counter per IOCTL
media: uvcvideo: Make power management granular
media: uvcvideo: Do not turn on the camera for some ioctls
drivers/media/usb/uvc/uvc_ctrl.c | 37 +++++++++----
drivers/media/usb/uvc/uvc_v4l2.c | 115 +++++++++++++++++++++++++++++++--------
drivers/media/usb/uvc/uvcvideo.h | 5 ++
3 files changed, 123 insertions(+), 34 deletions(-)
---
base-commit: f2151613e040973c868d28c8b00885dfab69eb75
change-id: 20241126-uvc-granpower-ng-069185a6d474
Best regards,
--
Ricardo Ribalda <ribalda@xxxxxxxxxxxx>