public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/8] media: uvcvideo: Implement the Privacy GPIO as a evdev
@ 2024-11-12 17:30 Ricardo Ribalda
  2024-11-12 17:30 ` [PATCH v3 1/8] media: uvcvideo: Fix crash during unbind if gpio unit is in use Ricardo Ribalda
                   ` (8 more replies)
  0 siblings, 9 replies; 29+ messages in thread
From: Ricardo Ribalda @ 2024-11-12 17:30 UTC (permalink / raw)
  To: Laurent Pinchart, Mauro Carvalho Chehab, Sakari Ailus
  Cc: linux-kernel, linux-media, Yunke Cao, Hans Verkuil, Hans de Goede,
	Ricardo Ribalda, stable, Sergey Senozhatsky

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 tried to fix the power-up issues implementing "granular power
saving" but it has been more complicated than anticipated...

This patchset implements the Privacy GPIO as a evdev.

The first patch of this set is already in Laurent's tree... but I
include it to get some CI coverage.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
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/20241108-uvc-subdev-v2-0-85d8a051a3d3@chromium.org

Changes in v2:
- Rebase on top of https://patchwork.linuxtv.org/project/linux-media/patch/20241106-uvc-crashrmmod-v6-1-fbf9781c6e83@chromium.org/
- 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/20241031-uvc-subdev-v1-0-a68331cedd72@chromium.org

---
Ricardo Ribalda (8):
      media: uvcvideo: Fix crash during unbind if gpio unit is in use
      media: uvcvideo: Factor out gpio functions to its own file
      media: uvcvideo: Re-implement privacy GPIO as an input device
      Revert "media: uvcvideo: Allow entity-defined get_info and get_cur"
      media: uvcvideo: Create ancillary link for GPIO subdevice
      media: v4l2-core: Add new MEDIA_ENT_F_GPIO
      media: uvcvideo: Use MEDIA_ENT_F_GPIO for the GPIO entity
      media: uvcvideo: Introduce UVC_QUIRK_PRIVACY_DURING_STREAM

 .../userspace-api/media/mediactl/media-types.rst   |   4 +
 drivers/media/usb/uvc/Kconfig                      |   2 +-
 drivers/media/usb/uvc/Makefile                     |   3 +
 drivers/media/usb/uvc/uvc_ctrl.c                   |  40 +-----
 drivers/media/usb/uvc/uvc_driver.c                 | 112 +---------------
 drivers/media/usb/uvc/uvc_entity.c                 |  21 ++-
 drivers/media/usb/uvc/uvc_gpio.c                   | 144 +++++++++++++++++++++
 drivers/media/usb/uvc/uvc_status.c                 |  13 +-
 drivers/media/usb/uvc/uvc_video.c                  |   4 +
 drivers/media/usb/uvc/uvcvideo.h                   |  31 +++--
 drivers/media/v4l2-core/v4l2-async.c               |   3 +-
 include/uapi/linux/media.h                         |   1 +
 12 files changed, 223 insertions(+), 155 deletions(-)
---
base-commit: 1b3bb4d69f20be5931abc18a6dbc24ff687fa780
change-id: 20241030-uvc-subdev-89f4467a00b5

Best regards,
-- 
Ricardo Ribalda <ribalda@chromium.org>


^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2024-12-02 12:08 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-12 17:30 [PATCH v3 0/8] media: uvcvideo: Implement the Privacy GPIO as a evdev Ricardo Ribalda
2024-11-12 17:30 ` [PATCH v3 1/8] media: uvcvideo: Fix crash during unbind if gpio unit is in use Ricardo Ribalda
2024-11-12 17:30 ` [PATCH v3 2/8] media: uvcvideo: Factor out gpio functions to its own file Ricardo Ribalda
2024-11-25 14:45   ` Hans de Goede
2024-11-25 15:10     ` Ricardo Ribalda
2024-11-25 15:46       ` Hans de Goede
2024-11-25 21:45     ` Laurent Pinchart
2024-11-12 17:30 ` [PATCH v3 3/8] media: uvcvideo: Re-implement privacy GPIO as an input device Ricardo Ribalda
2024-11-12 17:30 ` [PATCH v3 4/8] Revert "media: uvcvideo: Allow entity-defined get_info and get_cur" Ricardo Ribalda
2024-11-12 17:30 ` [PATCH v3 5/8] media: uvcvideo: Create ancillary link for GPIO subdevice Ricardo Ribalda
2024-11-12 17:30 ` [PATCH v3 6/8] media: v4l2-core: Add new MEDIA_ENT_F_GPIO Ricardo Ribalda
2024-11-12 17:30 ` [PATCH v3 7/8] media: uvcvideo: Use MEDIA_ENT_F_GPIO for the GPIO entity Ricardo Ribalda
2024-11-12 17:30 ` [PATCH v3 8/8] media: uvcvideo: Introduce UVC_QUIRK_PRIVACY_DURING_STREAM Ricardo Ribalda
2024-11-13 17:57 ` [PATCH v3 0/8] media: uvcvideo: Implement the Privacy GPIO as a evdev Hans de Goede
2024-11-14 19:21   ` Ricardo Ribalda
2024-11-14 23:06     ` Laurent Pinchart
2024-11-15  8:20       ` Ricardo Ribalda
2024-11-18 15:43         ` Hans de Goede
2024-11-18 16:47           ` Ricardo Ribalda
2024-11-25 12:01             ` Hans de Goede
2024-11-25 13:14               ` Laurent Pinchart
2024-11-25 14:41                 ` Hans de Goede
2024-11-25 21:35                   ` Laurent Pinchart
2024-11-26 16:27                     ` Ricardo Ribalda
2024-11-26 16:50                       ` Laurent Pinchart
2024-11-26 17:12                         ` Ricardo Ribalda
2024-11-26 17:25                           ` Laurent Pinchart
2024-12-02 12:08                           ` Hans de Goede
2024-11-25 15:05               ` Ricardo Ribalda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox