diff mbox series

[16/16] omap3isp: set device_caps in struct video_device

Message ID 20190626074421.38739-17-hverkuil-cisco@xs4all.nl (mailing list archive)
State New, archived
Headers show
Series media/platform: set device_caps in struct video_device | expand

Commit Message

Hans Verkuil June 26, 2019, 7:44 a.m. UTC
Instead of filling in the struct v4l2_capability device_caps
field, fill in the struct video_device device_caps field.

That way the V4L2 core knows what the capabilities of the
video device are.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/platform/omap3isp/ispvideo.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

Comments

Laurent Pinchart June 26, 2019, 9:25 a.m. UTC | #1
Hi Hans,

Thank you for the patch.

On Wed, Jun 26, 2019 at 09:44:21AM +0200, Hans Verkuil wrote:
> Instead of filling in the struct v4l2_capability device_caps
> field, fill in the struct video_device device_caps field.
> 
> That way the V4L2 core knows what the capabilities of the
> video device are.
> 
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  drivers/media/platform/omap3isp/ispvideo.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/platform/omap3isp/ispvideo.c b/drivers/media/platform/omap3isp/ispvideo.c
> index 175bbed9a235..d98b8c3ec0b2 100644
> --- a/drivers/media/platform/omap3isp/ispvideo.c
> +++ b/drivers/media/platform/omap3isp/ispvideo.c
> @@ -660,12 +660,6 @@ isp_video_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
>  
>  	cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT
>  		| V4L2_CAP_STREAMING | V4L2_CAP_DEVICE_CAPS;
> -
> -	if (video->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
> -		cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
> -	else
> -		cap->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
> -

Could you please keep this blank line ?

>  	return 0;
>  }
>  
> @@ -1463,6 +1457,13 @@ int omap3isp_video_init(struct isp_video *video, const char *name)
>  	video->video.vfl_type = VFL_TYPE_GRABBER;
>  	video->video.release = video_device_release_empty;
>  	video->video.ioctl_ops = &isp_video_ioctl_ops;
> +	if (video->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
> +		video->video.device_caps =
> +			V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
> +	else
> +		video->video.device_caps =
> +			V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;

Based on the coding style of the driver, this should be

	if (video->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
		video->video.device_caps = V4L2_CAP_VIDEO_CAPTURE
					 | V4L2_CAP_STREAMING;
	else
		video->video.device_caps = V4L2_CAP_VIDEO_OUTPUT
					 | V4L2_CAP_STREAMING;

With those minor issues fixed,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Please feel free to merge this patch as part of the whole series.

>  	video->pipe.stream_state = ISP_PIPELINE_STREAM_STOPPED;
>  
>  	video_set_drvdata(&video->video, video);
diff mbox series

Patch

diff --git a/drivers/media/platform/omap3isp/ispvideo.c b/drivers/media/platform/omap3isp/ispvideo.c
index 175bbed9a235..d98b8c3ec0b2 100644
--- a/drivers/media/platform/omap3isp/ispvideo.c
+++ b/drivers/media/platform/omap3isp/ispvideo.c
@@ -660,12 +660,6 @@  isp_video_querycap(struct file *file, void *fh, struct v4l2_capability *cap)
 
 	cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT
 		| V4L2_CAP_STREAMING | V4L2_CAP_DEVICE_CAPS;
-
-	if (video->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
-		cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
-	else
-		cap->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
-
 	return 0;
 }
 
@@ -1463,6 +1457,13 @@  int omap3isp_video_init(struct isp_video *video, const char *name)
 	video->video.vfl_type = VFL_TYPE_GRABBER;
 	video->video.release = video_device_release_empty;
 	video->video.ioctl_ops = &isp_video_ioctl_ops;
+	if (video->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
+		video->video.device_caps =
+			V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
+	else
+		video->video.device_caps =
+			V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
+
 	video->pipe.stream_state = ISP_PIPELINE_STREAM_STOPPED;
 
 	video_set_drvdata(&video->video, video);