aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2010-03-14 09:54:47 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 11:58:48 -0400
commit1dbf85397a686488b4be412af1cc069ae63a5ecc (patch)
tree6a59c95b58e20a11b7cb81a2863790b09f174475 /drivers
parent1585927de689a3ca033b98ab5df709e0bf2c3ccc (diff)
V4L/DVB: saa7127: support new vbi ops to set/get VBI format
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/saa7127.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/media/video/saa7127.c b/drivers/media/video/saa7127.c
index 32e11fc9c85c..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
628static int saa7127_g_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt) 628static 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
648static 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
651static int saa7127_s_vbi_data(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_data *data) 655static 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) {
@@ -735,6 +739,7 @@ static const struct v4l2_subdev_video_ops saa7127_video_ops = {
735 739
736static const struct v4l2_subdev_vbi_ops saa7127_vbi_ops = { 740static const struct v4l2_subdev_vbi_ops saa7127_vbi_ops = {
737 .s_vbi_data = saa7127_s_vbi_data, 741 .s_vbi_data = saa7127_s_vbi_data,
742 .g_sliced_fmt = saa7127_g_sliced_fmt,
738}; 743};
739 744
740static const struct v4l2_subdev_ops saa7127_ops = { 745static const struct v4l2_subdev_ops saa7127_ops = {