From b6e10ff6c23deb7f01d342875f7a69bae067c3c8 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Fri, 27 Jan 2023 21:37:25 +0100 Subject: media: v4l2-core: Make the v4l2-core code enable/disable the privacy LED if present Make v4l2_async_register_subdev_sensor() try to get a privacy LED associated with the sensor and extend the call_s_stream() wrapper to enable/disable the privacy LED if found. This makes the core handle privacy LED control, rather then having to duplicate this code in all the sensor drivers. Suggested-by: Sakari Ailus Acked-by: Linus Walleij Signed-off-by: Hans de Goede Acked-by: Sakari Ailus Link: https://lore.kernel.org/r/20230127203729.10205-2-hdegoede@redhat.com --- drivers/media/v4l2-core/v4l2-async.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/media/v4l2-core/v4l2-async.c') diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c index 2f1b718a9189..d7e9ffc7aa23 100644 --- a/drivers/media/v4l2-core/v4l2-async.c +++ b/drivers/media/v4l2-core/v4l2-async.c @@ -24,6 +24,8 @@ #include #include +#include "v4l2-subdev-priv.h" + static int v4l2_async_nf_call_bound(struct v4l2_async_notifier *n, struct v4l2_subdev *subdev, struct v4l2_async_subdev *asd) @@ -822,6 +824,8 @@ void v4l2_async_unregister_subdev(struct v4l2_subdev *sd) if (!sd->async_list.next) return; + v4l2_subdev_put_privacy_led(sd); + mutex_lock(&list_lock); __v4l2_async_nf_unregister(sd->subdev_notifier); -- cgit