diff options
Diffstat (limited to 'drivers/media/video/videodev.c')
-rw-r--r-- | drivers/media/video/videodev.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c index edd7b83c3464..479a0675cf60 100644 --- a/drivers/media/video/videodev.c +++ b/drivers/media/video/videodev.c | |||
@@ -739,13 +739,13 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, | |||
739 | case VIDIOC_DQBUF: | 739 | case VIDIOC_DQBUF: |
740 | { | 740 | { |
741 | struct v4l2_buffer *p=arg; | 741 | struct v4l2_buffer *p=arg; |
742 | if (!vfd->vidioc_qbuf) | 742 | if (!vfd->vidioc_dqbuf) |
743 | break; | 743 | break; |
744 | ret = check_fmt (vfd, p->type); | 744 | ret = check_fmt (vfd, p->type); |
745 | if (ret) | 745 | if (ret) |
746 | break; | 746 | break; |
747 | 747 | ||
748 | ret=vfd->vidioc_qbuf(file, fh, p); | 748 | ret=vfd->vidioc_dqbuf(file, fh, p); |
749 | if (!ret) | 749 | if (!ret) |
750 | dbgbuf(cmd,vfd,p); | 750 | dbgbuf(cmd,vfd,p); |
751 | break; | 751 | break; |
@@ -836,7 +836,7 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, | |||
836 | break; | 836 | break; |
837 | } | 837 | } |
838 | 838 | ||
839 | if (index < 0 || index >= vfd->tvnormsize) { | 839 | if (index<0 || index >= vfd->tvnormsize) { |
840 | ret=-EINVAL; | 840 | ret=-EINVAL; |
841 | break; | 841 | break; |
842 | } | 842 | } |
@@ -1283,9 +1283,29 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, | |||
1283 | case VIDIOC_G_PARM: | 1283 | case VIDIOC_G_PARM: |
1284 | { | 1284 | { |
1285 | struct v4l2_streamparm *p=arg; | 1285 | struct v4l2_streamparm *p=arg; |
1286 | if (!vfd->vidioc_g_parm) | 1286 | if (vfd->vidioc_g_parm) { |
1287 | break; | 1287 | ret=vfd->vidioc_g_parm(file, fh, p); |
1288 | ret=vfd->vidioc_g_parm(file, fh, p); | 1288 | } else { |
1289 | struct v4l2_standard s; | ||
1290 | |||
1291 | if (!vfd->tvnormsize) { | ||
1292 | printk (KERN_WARNING "%s: no TV norms defined!\n", | ||
1293 | vfd->name); | ||
1294 | break; | ||
1295 | } | ||
1296 | |||
1297 | if (p->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) | ||
1298 | return -EINVAL; | ||
1299 | |||
1300 | v4l2_video_std_construct(&s, vfd->tvnorms[vfd->current_norm].id, | ||
1301 | vfd->tvnorms[vfd->current_norm].name); | ||
1302 | |||
1303 | memset(p,0,sizeof(*p)); | ||
1304 | |||
1305 | p->parm.capture.timeperframe = s.frameperiod; | ||
1306 | ret=0; | ||
1307 | } | ||
1308 | |||
1289 | dbgarg (cmd, "type=%d\n", p->type); | 1309 | dbgarg (cmd, "type=%d\n", p->type); |
1290 | break; | 1310 | break; |
1291 | } | 1311 | } |