diff options
Diffstat (limited to 'drivers/media/video/saa7127.c')
-rw-r--r-- | drivers/media/video/saa7127.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/drivers/media/video/saa7127.c b/drivers/media/video/saa7127.c index 250ef84cf5ca..87986ad62f86 100644 --- a/drivers/media/video/saa7127.c +++ b/drivers/media/video/saa7127.c | |||
@@ -625,29 +625,33 @@ static int saa7127_s_stream(struct v4l2_subdev *sd, int enable) | |||
625 | return saa7127_set_video_enable(sd, enable); | 625 | return saa7127_set_video_enable(sd, enable); |
626 | } | 626 | } |
627 | 627 | ||
628 | static int saa7127_g_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt) | 628 | static int saa7127_g_sliced_fmt(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format *fmt) |
629 | { | 629 | { |
630 | struct saa7127_state *state = to_state(sd); | 630 | struct saa7127_state *state = to_state(sd); |
631 | 631 | ||
632 | if (fmt->type != V4L2_BUF_TYPE_SLICED_VBI_CAPTURE) | 632 | memset(fmt, 0, sizeof(*fmt)); |
633 | return -EINVAL; | ||
634 | |||
635 | memset(&fmt->fmt.sliced, 0, sizeof(fmt->fmt.sliced)); | ||
636 | if (state->vps_enable) | 633 | if (state->vps_enable) |
637 | fmt->fmt.sliced.service_lines[0][16] = V4L2_SLICED_VPS; | 634 | fmt->service_lines[0][16] = V4L2_SLICED_VPS; |
638 | if (state->wss_enable) | 635 | if (state->wss_enable) |
639 | fmt->fmt.sliced.service_lines[0][23] = V4L2_SLICED_WSS_625; | 636 | fmt->service_lines[0][23] = V4L2_SLICED_WSS_625; |
640 | if (state->cc_enable) { | 637 | if (state->cc_enable) { |
641 | fmt->fmt.sliced.service_lines[0][21] = V4L2_SLICED_CAPTION_525; | 638 | fmt->service_lines[0][21] = V4L2_SLICED_CAPTION_525; |
642 | fmt->fmt.sliced.service_lines[1][21] = V4L2_SLICED_CAPTION_525; | 639 | fmt->service_lines[1][21] = V4L2_SLICED_CAPTION_525; |
643 | } | 640 | } |
644 | fmt->fmt.sliced.service_set = | 641 | fmt->service_set = |
645 | (state->vps_enable ? V4L2_SLICED_VPS : 0) | | 642 | (state->vps_enable ? V4L2_SLICED_VPS : 0) | |
646 | (state->wss_enable ? V4L2_SLICED_WSS_625 : 0) | | 643 | (state->wss_enable ? V4L2_SLICED_WSS_625 : 0) | |
647 | (state->cc_enable ? V4L2_SLICED_CAPTION_525 : 0); | 644 | (state->cc_enable ? V4L2_SLICED_CAPTION_525 : 0); |
648 | return 0; | 645 | return 0; |
649 | } | 646 | } |
650 | 647 | ||
648 | static int saa7127_g_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt) | ||
649 | { | ||
650 | if (fmt->type != V4L2_BUF_TYPE_SLICED_VBI_CAPTURE) | ||
651 | return -EINVAL; | ||
652 | return saa7127_g_sliced_fmt(sd, &fmt->fmt.sliced); | ||
653 | } | ||
654 | |||
651 | static int saa7127_s_vbi_data(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_data *data) | 655 | static int saa7127_s_vbi_data(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_data *data) |
652 | { | 656 | { |
653 | switch (data->id) { | 657 | switch (data->id) { |
@@ -727,16 +731,21 @@ static const struct v4l2_subdev_core_ops saa7127_core_ops = { | |||
727 | }; | 731 | }; |
728 | 732 | ||
729 | static const struct v4l2_subdev_video_ops saa7127_video_ops = { | 733 | static const struct v4l2_subdev_video_ops saa7127_video_ops = { |
730 | .s_vbi_data = saa7127_s_vbi_data, | ||
731 | .g_fmt = saa7127_g_fmt, | 734 | .g_fmt = saa7127_g_fmt, |
732 | .s_std_output = saa7127_s_std_output, | 735 | .s_std_output = saa7127_s_std_output, |
733 | .s_routing = saa7127_s_routing, | 736 | .s_routing = saa7127_s_routing, |
734 | .s_stream = saa7127_s_stream, | 737 | .s_stream = saa7127_s_stream, |
735 | }; | 738 | }; |
736 | 739 | ||
740 | static const struct v4l2_subdev_vbi_ops saa7127_vbi_ops = { | ||
741 | .s_vbi_data = saa7127_s_vbi_data, | ||
742 | .g_sliced_fmt = saa7127_g_sliced_fmt, | ||
743 | }; | ||
744 | |||
737 | static const struct v4l2_subdev_ops saa7127_ops = { | 745 | static const struct v4l2_subdev_ops saa7127_ops = { |
738 | .core = &saa7127_core_ops, | 746 | .core = &saa7127_core_ops, |
739 | .video = &saa7127_video_ops, | 747 | .video = &saa7127_video_ops, |
748 | .vbi = &saa7127_vbi_ops, | ||
740 | }; | 749 | }; |
741 | 750 | ||
742 | /* ----------------------------------------------------------------------- */ | 751 | /* ----------------------------------------------------------------------- */ |