diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2023-09-18 15:48:38 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-06-12 12:12:37 +0300 |
commit | 35556d0e1c61a25c737b9fc791a98add25464a8e (patch) | |
tree | 2fd47aa9b89adeea9ddc3168bd85a04ef9d050c5 /include/media | |
parent | 4031c57f024a5d2ee9982ad15dc845dbcce8337a (diff) | |
download | linux-35556d0e1c61a25c737b9fc791a98add25464a8e.tar.xz |
media: v4l2-subdev: Document and enforce .s_stream() requirements
[ Upstream commit 009905ec50433259c05f474251000b040098564e ]
The subdev .s_stream() operation must not be called to start an already
started subdev, or stop an already stopped one. This requirement has
never been formally documented. Fix it, and catch possible offenders
with a WARN_ON() in the call_s_stream() wrapper.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Stable-dep-of: f2bf6cd8f447 ("media: v4l: Don't turn on privacy LED if streamon fails")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/v4l2-subdev.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index d9fca929c10b..ab2a7ef61d42 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -446,7 +446,9 @@ enum v4l2_subdev_pre_streamon_flags { * @s_stream: start (enabled == 1) or stop (enabled == 0) streaming on the * sub-device. Failure on stop will remove any resources acquired in * streaming start, while the error code is still returned by the driver. - * Also see call_s_stream wrapper in v4l2-subdev.c. + * The caller shall track the subdev state, and shall not start or stop an + * already started or stopped subdev. Also see call_s_stream wrapper in + * v4l2-subdev.c. * * @g_pixelaspect: callback to return the pixelaspect ratio. * |