| From: |
| Ricardo Ribalda <ribalda-AT-chromium.org> |
| To: |
| Laurent Pinchart <laurent.pinchart-AT-ideasonboard.com>, Mauro Carvalho Chehab <mchehab-AT-kernel.org>, Sakari Ailus <sakari.ailus-AT-linux.intel.com> |
| Subject: |
| [PATCH v4 0/7] media: uvcvideo: Implement the Privacy GPIO as a evdev |
| Date: |
| Mon, 25 Nov 2024 19:49:05 +0000 |
| Message-ID: |
| <20241125-uvc-subdev-v4-0-51e040599f1a@chromium.org> |
| Cc: |
| linux-kernel-AT-vger.kernel.org, linux-media-AT-vger.kernel.org, Yunke Cao <yunkec-AT-chromium.org>, Hans Verkuil <hverkuil-AT-xs4all.nl>, Hans de Goede <hdegoede-AT-redhat.com>, Ricardo Ribalda <ribalda-AT-chromium.org>, stable-AT-vger.kernel.org |
| Archive-link: |
| Article |
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 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/20241112-uvc-subdev-v3-0-0ea573...
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-85d8a0...
Changes in v2:
- Rebase on top of https://patchwork.linuxtv.org/project/linux-media/patch/2...
- 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-a68331...
---
Ricardo Ribalda (7):
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: 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 | 40 ++---------
drivers/media/usb/uvc/uvc_driver.c | 123 ++--------------------------------
drivers/media/usb/uvc/uvc_entity.c | 7 +-
drivers/media/usb/uvc/uvc_gpio.c | 134 +++++++++++++++++++++++++++++++++++++
drivers/media/usb/uvc/uvc_status.c | 13 +++-
drivers/media/usb/uvc/uvc_video.c | 4 ++
drivers/media/usb/uvc/uvcvideo.h | 43 +++++++-----
9 files changed, 195 insertions(+), 174 deletions(-)
---
base-commit: 72ad4ff638047bbbdf3232178fea4bec1f429319
change-id: 20241030-uvc-subdev-89f4467a00b5
Best regards,
--
Ricardo Ribalda <ribalda@chromium.org>