Skip to content

Commit

Permalink
V4L/DVB (7947): videodev: add vidioc_g_std callback.
Browse files Browse the repository at this point in the history
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: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Jul 20, 2008
1 parent 7bb846a commit b2de231
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 8 additions & 4 deletions drivers/media/video/videodev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1206,11 +1206,15 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
{
v4l2_std_id *id = arg;

*id = vfd->current_norm;

dbgarg (cmd, "value=%08Lx\n", (long long unsigned) *id);
ret = 0;
/* Calls the specific handler */
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;
}
case VIDIOC_S_STD:
Expand Down
3 changes: 2 additions & 1 deletion include/media/v4l2-dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,9 @@ struct video_device
int (*vidioc_streamoff)(struct file *file, void *fh, enum v4l2_buf_type i);

/* 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_querystd) (struct file *file, void *fh, v4l2_std_id *a);

Expand Down

0 comments on commit b2de231

Please sign in to comment.