mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 16:13:19 +09:00
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
This commit is contained in:
@@ -38,6 +38,7 @@ struct v4l2_subdev;
|
||||
struct v4l2_subdev_fh;
|
||||
struct tuner_setup;
|
||||
struct v4l2_mbus_frame_desc;
|
||||
struct led_classdev;
|
||||
|
||||
/**
|
||||
* struct v4l2_decode_vbi_line - used to decode_vbi_line
|
||||
@@ -941,6 +942,7 @@ struct v4l2_subdev_platform_data {
|
||||
* @state_lock: A pointer to a lock used for all the subdev's states, set by the
|
||||
* driver. This is optional. If NULL, each state instance will get
|
||||
* a lock of its own.
|
||||
* @privacy_led: Optional pointer to a LED classdev for the privacy LED for sensors.
|
||||
* @active_state: Active state for the subdev (NULL for subdevs tracking the
|
||||
* state internally). Initialized by calling
|
||||
* v4l2_subdev_init_finalize().
|
||||
@@ -982,6 +984,8 @@ struct v4l2_subdev {
|
||||
* appropriate functions.
|
||||
*/
|
||||
|
||||
struct led_classdev *privacy_led;
|
||||
|
||||
/*
|
||||
* TODO: active_state should most likely be changed from a pointer to an
|
||||
* embedded field. For the time being it's kept as a pointer to more
|
||||
|
||||
Reference in New Issue
Block a user