OSDN Git Service

media: v4l2-core: Make the v4l2-core code enable/disable the privacy LED if present
authorHans de Goede <hdegoede@redhat.com>
Fri, 27 Jan 2023 20:37:25 +0000 (21:37 +0100)
committerHans de Goede <hdegoede@redhat.com>
Fri, 3 Feb 2023 09:22:34 +0000 (10:22 +0100)
commitb6e10ff6c23deb7f01d342875f7a69bae067c3c8
treee667cbb632bf0562f14b9d0ef795223749bac20e
parent39f09320500c74a9777fc274d15acd3f0bac41ae
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
drivers/media/v4l2-core/v4l2-async.c
drivers/media/v4l2-core/v4l2-fwnode.c
drivers/media/v4l2-core/v4l2-subdev-priv.h [new file with mode: 0644]
drivers/media/v4l2-core/v4l2-subdev.c
include/media/v4l2-subdev.h