]> git.ipfire.org Git - thirdparty/linux.git/commit
media: v4l2-subdev: Refactor events
authorTommaso Merciai <tomm.merciai@gmail.com>
Sun, 20 Oct 2024 16:35:32 +0000 (18:35 +0200)
committerHans Verkuil <hverkuil@xs4all.nl>
Thu, 7 Nov 2024 08:05:57 +0000 (09:05 +0100)
commite7724e23196ab1b4bc843aa60e917967d95697e4
treed5387580e95d051165027875efaca6a8601f445a
parent3bb5080293a3c96a41dd707db64ab8c7d8c471ae
media: v4l2-subdev: Refactor events

Controls can be exposed to userspace via a v4l-subdevX device, and
userspace has to be able to subscribe to control events so that it is
notified when the control changes value. If a control handler is set for
the subdev then set the HAS_EVENTS flag automatically into
v4l2_subdev_init_finalize() and use v4l2_ctrl_subdev_subscribe_event() and
v4l2_event_subdev_unsubscribe() as default if subdev don't have
.(un)subscribe control operations. This simplifies subdev drivers by
avoiding the need to set the V4L2_SUBDEV_FL_HAS_EVENTS flag and plug the
event handlers, and ensures consistency of the API exposed to userspace.

Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com>
Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/v4l2-core/v4l2-subdev.c