summaryrefslogtreecommitdiff
path: root/drivers/media/v4l2-core/v4l2-async.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2023-01-27 23:37:25 +0300
committerHans de Goede <hdegoede@redhat.com>2023-02-03 12:22:34 +0300
commitb6e10ff6c23deb7f01d342875f7a69bae067c3c8 (patch)
treee667cbb632bf0562f14b9d0ef795223749bac20e /drivers/media/v4l2-core/v4l2-async.c
parent39f09320500c74a9777fc274d15acd3f0bac41ae (diff)
downloadlinux-b6e10ff6c23deb7f01d342875f7a69bae067c3c8.tar.xz
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 <sakari.ailus@linux.intel.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Link: https://lore.kernel.org/r/20230127203729.10205-2-hdegoede@redhat.com
Diffstat (limited to 'drivers/media/v4l2-core/v4l2-async.c')
-rw-r--r--drivers/media/v4l2-core/v4l2-async.c4
1 files changed, 4 insertions, 0 deletions
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 <media/v4l2-fwnode.h>
#include <media/v4l2-subdev.h>
+#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);