Commit b2de2313 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

V4L/DVB (7947): videodev: add vidioc_g_std callback.

The default videodev behavior for VIDIOC_G_STD is not correct for all devices.
Add a new callback that drivers can use instead.
Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 7bb846af
...@@ -1206,11 +1206,15 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, ...@@ -1206,11 +1206,15 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
{ {
v4l2_std_id *id = arg; v4l2_std_id *id = arg;
*id = vfd->current_norm; ret = 0;
/* Calls the specific handler */
dbgarg (cmd, "value=%08Lx\n", (long long unsigned) *id); if (vfd->vidioc_g_std)
ret = vfd->vidioc_g_std(file, fh, id);
else
*id = vfd->current_norm;
ret=0; if (!ret)
dbgarg(cmd, "value=%08Lx\n", (long long unsigned)*id);
break; break;
} }
case VIDIOC_S_STD: case VIDIOC_S_STD:
......
...@@ -212,8 +212,9 @@ struct video_device ...@@ -212,8 +212,9 @@ struct video_device
int (*vidioc_streamoff)(struct file *file, void *fh, enum v4l2_buf_type i); int (*vidioc_streamoff)(struct file *file, void *fh, enum v4l2_buf_type i);
/* Standard handling /* Standard handling
G_STD and ENUMSTD are handled by videodev.c ENUMSTD is handled by videodev.c
*/ */
int (*vidioc_g_std) (struct file *file, void *fh, v4l2_std_id *norm);
int (*vidioc_s_std) (struct file *file, void *fh, v4l2_std_id *norm); int (*vidioc_s_std) (struct file *file, void *fh, v4l2_std_id *norm);
int (*vidioc_querystd) (struct file *file, void *fh, v4l2_std_id *a); int (*vidioc_querystd) (struct file *file, void *fh, v4l2_std_id *a);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment