diff options
Diffstat (limited to 'drivers/media/video/videodev.c')
-rw-r--r-- | drivers/media/video/videodev.c | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c index 011938fb7e0e..80ac5f86d9e5 100644 --- a/drivers/media/video/videodev.c +++ b/drivers/media/video/videodev.c | |||
@@ -318,6 +318,7 @@ static char *v4l2_type_names_FIXME[] = { | |||
318 | [V4L2_BUF_TYPE_VBI_OUTPUT] = "vbi-out", | 318 | [V4L2_BUF_TYPE_VBI_OUTPUT] = "vbi-out", |
319 | [V4L2_BUF_TYPE_SLICED_VBI_OUTPUT] = "sliced-vbi-out", | 319 | [V4L2_BUF_TYPE_SLICED_VBI_OUTPUT] = "sliced-vbi-out", |
320 | [V4L2_BUF_TYPE_SLICED_VBI_CAPTURE] = "sliced-vbi-capture", | 320 | [V4L2_BUF_TYPE_SLICED_VBI_CAPTURE] = "sliced-vbi-capture", |
321 | [V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY] = "video-out-over", | ||
321 | [V4L2_BUF_TYPE_PRIVATE] = "private", | 322 | [V4L2_BUF_TYPE_PRIVATE] = "private", |
322 | }; | 323 | }; |
323 | 324 | ||
@@ -330,6 +331,8 @@ static char *v4l2_field_names_FIXME[] = { | |||
330 | [V4L2_FIELD_SEQ_TB] = "seq-tb", | 331 | [V4L2_FIELD_SEQ_TB] = "seq-tb", |
331 | [V4L2_FIELD_SEQ_BT] = "seq-bt", | 332 | [V4L2_FIELD_SEQ_BT] = "seq-bt", |
332 | [V4L2_FIELD_ALTERNATE] = "alternate", | 333 | [V4L2_FIELD_ALTERNATE] = "alternate", |
334 | [V4L2_FIELD_INTERLACED_TB] = "interlaced-tb", | ||
335 | [V4L2_FIELD_INTERLACED_BT] = "interlaced-bt", | ||
333 | }; | 336 | }; |
334 | 337 | ||
335 | #define prt_names(a,arr) (((a)>=0)&&((a)<ARRAY_SIZE(arr)))?arr[a]:"unknown" | 338 | #define prt_names(a,arr) (((a)>=0)&&((a)<ARRAY_SIZE(arr)))?arr[a]:"unknown" |
@@ -411,6 +414,10 @@ static int check_fmt (struct video_device *vfd, enum v4l2_buf_type type) | |||
411 | if (vfd->vidioc_try_fmt_vbi_output) | 414 | if (vfd->vidioc_try_fmt_vbi_output) |
412 | return (0); | 415 | return (0); |
413 | break; | 416 | break; |
417 | case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: | ||
418 | if (vfd->vidioc_try_fmt_output_overlay) | ||
419 | return (0); | ||
420 | break; | ||
414 | case V4L2_BUF_TYPE_PRIVATE: | 421 | case V4L2_BUF_TYPE_PRIVATE: |
415 | if (vfd->vidioc_try_fmt_type_private) | 422 | if (vfd->vidioc_try_fmt_type_private) |
416 | return (0); | 423 | return (0); |
@@ -525,6 +532,10 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, | |||
525 | ret=vfd->vidioc_enum_fmt_vbi_output(file, | 532 | ret=vfd->vidioc_enum_fmt_vbi_output(file, |
526 | fh, f); | 533 | fh, f); |
527 | break; | 534 | break; |
535 | case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: | ||
536 | if (vfd->vidioc_enum_fmt_output_overlay) | ||
537 | ret=vfd->vidioc_enum_fmt_output_overlay(file, fh, f); | ||
538 | break; | ||
528 | case V4L2_BUF_TYPE_PRIVATE: | 539 | case V4L2_BUF_TYPE_PRIVATE: |
529 | if (vfd->vidioc_enum_fmt_type_private) | 540 | if (vfd->vidioc_enum_fmt_type_private) |
530 | ret=vfd->vidioc_enum_fmt_type_private(file, | 541 | ret=vfd->vidioc_enum_fmt_type_private(file, |
@@ -582,6 +593,10 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, | |||
582 | ret=vfd->vidioc_g_fmt_video_output(file, | 593 | ret=vfd->vidioc_g_fmt_video_output(file, |
583 | fh, f); | 594 | fh, f); |
584 | break; | 595 | break; |
596 | case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: | ||
597 | if (vfd->vidioc_g_fmt_output_overlay) | ||
598 | ret=vfd->vidioc_g_fmt_output_overlay(file, fh, f); | ||
599 | break; | ||
585 | case V4L2_BUF_TYPE_VBI_OUTPUT: | 600 | case V4L2_BUF_TYPE_VBI_OUTPUT: |
586 | if (vfd->vidioc_g_fmt_vbi_output) | 601 | if (vfd->vidioc_g_fmt_vbi_output) |
587 | ret=vfd->vidioc_g_fmt_vbi_output(file, fh, f); | 602 | ret=vfd->vidioc_g_fmt_vbi_output(file, fh, f); |
@@ -630,6 +645,10 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, | |||
630 | ret=vfd->vidioc_s_fmt_video_output(file, | 645 | ret=vfd->vidioc_s_fmt_video_output(file, |
631 | fh, f); | 646 | fh, f); |
632 | break; | 647 | break; |
648 | case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: | ||
649 | if (vfd->vidioc_s_fmt_output_overlay) | ||
650 | ret=vfd->vidioc_s_fmt_output_overlay(file, fh, f); | ||
651 | break; | ||
633 | case V4L2_BUF_TYPE_VBI_OUTPUT: | 652 | case V4L2_BUF_TYPE_VBI_OUTPUT: |
634 | if (vfd->vidioc_s_fmt_vbi_output) | 653 | if (vfd->vidioc_s_fmt_vbi_output) |
635 | ret=vfd->vidioc_s_fmt_vbi_output(file, | 654 | ret=vfd->vidioc_s_fmt_vbi_output(file, |
@@ -680,6 +699,10 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, | |||
680 | ret=vfd->vidioc_try_fmt_video_output(file, | 699 | ret=vfd->vidioc_try_fmt_video_output(file, |
681 | fh, f); | 700 | fh, f); |
682 | break; | 701 | break; |
702 | case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: | ||
703 | if (vfd->vidioc_try_fmt_output_overlay) | ||
704 | ret=vfd->vidioc_try_fmt_output_overlay(file, fh, f); | ||
705 | break; | ||
683 | case V4L2_BUF_TYPE_VBI_OUTPUT: | 706 | case V4L2_BUF_TYPE_VBI_OUTPUT: |
684 | if (vfd->vidioc_try_fmt_vbi_output) | 707 | if (vfd->vidioc_try_fmt_vbi_output) |
685 | ret=vfd->vidioc_try_fmt_vbi_output(file, | 708 | ret=vfd->vidioc_try_fmt_vbi_output(file, |
@@ -1381,6 +1404,11 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, | |||
1381 | case VIDIOC_G_PARM: | 1404 | case VIDIOC_G_PARM: |
1382 | { | 1405 | { |
1383 | struct v4l2_streamparm *p=arg; | 1406 | struct v4l2_streamparm *p=arg; |
1407 | __u32 type=p->type; | ||
1408 | |||
1409 | memset(p,0,sizeof(*p)); | ||
1410 | p->type=type; | ||
1411 | |||
1384 | if (vfd->vidioc_g_parm) { | 1412 | if (vfd->vidioc_g_parm) { |
1385 | ret=vfd->vidioc_g_parm(file, fh, p); | 1413 | ret=vfd->vidioc_g_parm(file, fh, p); |
1386 | } else { | 1414 | } else { |
@@ -1392,8 +1420,6 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, | |||
1392 | v4l2_video_std_construct(&s, vfd->current_norm, | 1420 | v4l2_video_std_construct(&s, vfd->current_norm, |
1393 | v4l2_norm_to_name(vfd->current_norm)); | 1421 | v4l2_norm_to_name(vfd->current_norm)); |
1394 | 1422 | ||
1395 | memset(p,0,sizeof(*p)); | ||
1396 | |||
1397 | p->parm.capture.timeperframe = s.frameperiod; | 1423 | p->parm.capture.timeperframe = s.frameperiod; |
1398 | ret=0; | 1424 | ret=0; |
1399 | } | 1425 | } |
@@ -1509,6 +1535,16 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, | |||
1509 | break; | 1535 | break; |
1510 | } | 1536 | } |
1511 | #endif | 1537 | #endif |
1538 | case VIDIOC_G_CHIP_IDENT: | ||
1539 | { | ||
1540 | struct v4l2_chip_ident *p=arg; | ||
1541 | if (!vfd->vidioc_g_chip_ident) | ||
1542 | break; | ||
1543 | ret=vfd->vidioc_g_chip_ident(file, fh, p); | ||
1544 | if (!ret) | ||
1545 | dbgarg (cmd, "chip_ident=%u, revision=0x%x\n", p->ident, p->revision); | ||
1546 | break; | ||
1547 | } | ||
1512 | } /* switch */ | 1548 | } /* switch */ |
1513 | 1549 | ||
1514 | if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) { | 1550 | if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) { |