Skip to content

media: uvcvideo: Implement the Privacy GPIO as a evdev

Ricardo Ribalda linux-gpio linux-media linux-usb lkml 5 versions – New

Get series with b4
b4 am [email protected] change-id 20241030-uvc-subdev-89f4467a00b5

Versions newest first

  1. v5 Latest5 patches 0 repliesNew
  2. v47 patches 0 repliesSuperseded
  3. v38 patches 20 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v26 patches39 repliesSuperseded
v17 patches1 replySuperseded

Changes in v5 from the cover letter

- Drop UVC_GUID_EXT_GPIO_CONTROLLER
- Remove merged patches and patches that will conflict with uvc-rotation
- Rebase
- Link to v4: https://lore.kernel.org/r/[email protected]

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5media: uvcvideo: Factor out gpio functions to its own filedrivers/media/usb/uvc/Makefile drivers/media/usb/uvc/uvc_driver.c drivers/media/usb/uvc/uvc_gpio.c +1 more+133 -1200 replies
2/5media: uvcvideo: Re-implement privacy GPIO as an input devicedrivers/media/usb/uvc/Kconfig drivers/media/usb/uvc/Makefile drivers/media/usb/uvc/uvc_ctrl.c +4 more+51 -800 replies
3/5media: uvcvideo: Introduce UVC_QUIRK_PRIVACY_DURING_STREAMdrivers/media/usb/uvc/uvc_gpio.c drivers/media/usb/uvc/uvc_video.c drivers/media/usb/uvc/uvcvideo.h+62 -40 replies
4/5media: uvcvideo: Make gpio_unit entity-lessdrivers/media/usb/uvc/uvc_driver.c drivers/media/usb/uvc/uvc_gpio.c drivers/media/usb/uvc/uvc_status.c +1 more+18 -340 replies
5/5media: uvcvideo: Remove UVC_EXT_GPIO entitydrivers/media/usb/uvc/uvc_driver.c drivers/media/usb/uvc/uvc_entity.c drivers/media/usb/uvc/uvcvideo.h +1 more+7 -210 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [PATCH v5 0/5] media: uvcvideo: Implement the Privacy GPIO as a evdev

Some notebooks have a button to disable the camera (not to be mistaken with the mechanical cover). This is a standard GPIO linked to the camera via the ACPI table.

4 years ago we added support for this button in UVC via the Privacy control. This has three issues:
- If the camera has its own privacy control, it will be masked.
- We need to power-up the camera to read the privacy control gpio.
- Other drivers have not followed this approach and have used evdev.

We fixed the power-up isses with "granular power saving", but the other issues are still open.

This patchset implements the Privacy GPIO as a evdev.

---
Changes in v5:
- Drop UVC_GUID_EXT_GPIO_CONTROLLER
- Remove merged patches and patches that will conflict with uvc-rotation
- Rebase
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- Remove gpio entity, it is not needed.
- Use unit->gpio.irq in free_irq to make smatch happy.
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- CodeStyle (Thanks Sakari)
- Re-implement as input device
- Make the code depend on UVC_INPUT_EVDEV
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Rebase on top of https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/
- Create uvc_gpio_cleanup and uvc_gpio_deinit
- Refactor quirk: do not disable irq
- Change define number for MEDIA_ENT_F_GPIO
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Ricardo Ribalda (5):
media: uvcvideo: Factor out gpio functions to its own file
media: uvcvideo: Re-implement privacy GPIO as an input device
media: uvcvideo: Introduce UVC_QUIRK_PRIVACY_DURING_STREAM
media: uvcvideo: Make gpio_unit entity-less
media: uvcvideo: Remove UVC_EXT_GPIO entity

 drivers/media/usb/uvc/Kconfig      |   2 +-
 drivers/media/usb/uvc/Makefile     |   3 +
 drivers/media/usb/uvc/uvc_ctrl.c   |  20 ------
 drivers/media/usb/uvc/uvc_driver.c | 135 ++---------------------------------
 drivers/media/usb/uvc/uvc_entity.c |   1 -
 drivers/media/usb/uvc/uvc_gpio.c   | 139 +++++++++++++++++++++++++++++++++++++
 drivers/media/usb/uvc/uvc_status.c |  13 +++-
 drivers/media/usb/uvc/uvc_video.c  |   4 ++
 drivers/media/usb/uvc/uvcvideo.h   |  38 ++++++----
 include/linux/usb/uvc.h            |   3 -
 10 files changed, 185 insertions(+), 173 deletions(-)

---
base-commit: d968e50b5c26642754492dea23cbd3592bde62d8
change-id: 20241030-uvc-subdev-89f4467a00b5

Best regards,

Signature · 1 line
Ricardo Ribalda <[email protected]>