]> www.infradead.org Git - users/jedix/linux-maple.git/commit
media: subdev: Add checks for subdev features
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Wed, 24 Apr 2024 15:39:06 +0000 (18:39 +0300)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Tue, 4 Jun 2024 06:31:24 +0000 (08:31 +0200)
commite003fd9c1e3883a96451d24174dc5bad2c248341
tree86542f193b018039c37f7a6ec910da2d3f7c187e
parent68e36241b74683e36533b0089966881d0b7d866b
media: subdev: Add checks for subdev features

Add some checks to verify that the subdev driver implements required
features.

A subdevice that supports streams (V4L2_SUBDEV_FL_STREAMS) must do one
of the following:

- Implement neither .enable/disable_streams() nor .s_stream(), if the
  subdev is part of a video driver that uses an internal method to
  enable the subdev.
- Implement only .enable/disable_streams(), if support for legacy
  sink-side subdevices is not needed.
- Implement .enable/disable_streams() and .s_stream(), if support for
  legacy sink-side subdevices is needed.

At the moment the framework doesn't check this requirement. Add the
check.

Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/v4l2-core/v4l2-subdev.c