diff options
author | Michael Schimek <mschimek@nusurf.at> | 2005-06-24 01:04:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-24 03:06:37 -0400 |
commit | f246a8172a9e403b78c34568f766990f1506a0ab (patch) | |
tree | 30f25ba91d7c8d7dbe293f5283e0a10de349104b /drivers/media/video/saa7134/saa7134-video.c | |
parent | 93b43f13b5bfeac09ef5743edf39eeeee3f4eeae (diff) |
[PATCH] v4l: saa7134 ntsc vbi fix
This patch fixes NTSC VBI capturing in the saa7134 driver.
Signed-off-by: Michael H. Schimek <mschimek@gmx.at>
Cc: <video4linux-list@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-video.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-video.c | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c index 5d66060026ff..72f86736a795 100644 --- a/drivers/media/video/saa7134/saa7134-video.c +++ b/drivers/media/video/saa7134/saa7134-video.c | |||
@@ -158,18 +158,20 @@ static struct saa7134_format formats[] = { | |||
158 | .h_stop = 719, \ | 158 | .h_stop = 719, \ |
159 | .video_v_start = 24, \ | 159 | .video_v_start = 24, \ |
160 | .video_v_stop = 311, \ | 160 | .video_v_stop = 311, \ |
161 | .vbi_v_start = 7, \ | 161 | .vbi_v_start_0 = 7, \ |
162 | .vbi_v_stop = 22, \ | 162 | .vbi_v_stop_0 = 22, \ |
163 | .vbi_v_start_1 = 319, \ | ||
163 | .src_timing = 4 | 164 | .src_timing = 4 |
164 | 165 | ||
165 | #define NORM_525_60 \ | 166 | #define NORM_525_60 \ |
166 | .h_start = 0, \ | 167 | .h_start = 0, \ |
167 | .h_stop = 703, \ | 168 | .h_stop = 703, \ |
168 | .video_v_start = 22, \ | 169 | .video_v_start = 23, \ |
169 | .video_v_stop = 22+239, \ | 170 | .video_v_stop = 262, \ |
170 | .vbi_v_start = 10, /* FIXME */ \ | 171 | .vbi_v_start_0 = 10, \ |
171 | .vbi_v_stop = 21, /* FIXME */ \ | 172 | .vbi_v_stop_0 = 21, \ |
172 | .src_timing = 1 | 173 | .vbi_v_start_1 = 273, \ |
174 | .src_timing = 7 | ||
173 | 175 | ||
174 | static struct saa7134_tvnorm tvnorms[] = { | 176 | static struct saa7134_tvnorm tvnorms[] = { |
175 | { | 177 | { |
@@ -274,11 +276,12 @@ static struct saa7134_tvnorm tvnorms[] = { | |||
274 | 276 | ||
275 | .h_start = 0, | 277 | .h_start = 0, |
276 | .h_stop = 719, | 278 | .h_stop = 719, |
277 | .video_v_start = 22, | 279 | .video_v_start = 23, |
278 | .video_v_stop = 22+239, | 280 | .video_v_stop = 262, |
279 | .vbi_v_start = 10, /* FIXME */ | 281 | .vbi_v_start_0 = 10, |
280 | .vbi_v_stop = 21, /* FIXME */ | 282 | .vbi_v_stop_0 = 21, |
281 | .src_timing = 1, | 283 | .vbi_v_start_1 = 273, |
284 | .src_timing = 7, | ||
282 | 285 | ||
283 | .sync_control = 0x18, | 286 | .sync_control = 0x18, |
284 | .luma_control = 0x40, | 287 | .luma_control = 0x40, |
@@ -335,8 +338,8 @@ static const struct v4l2_queryctrl video_ctrls[] = { | |||
335 | .default_value = 0, | 338 | .default_value = 0, |
336 | .type = V4L2_CTRL_TYPE_INTEGER, | 339 | .type = V4L2_CTRL_TYPE_INTEGER, |
337 | },{ | 340 | },{ |
338 | .id = V4L2_CID_VFLIP, | 341 | .id = V4L2_CID_HFLIP, |
339 | .name = "vertical flip", | 342 | .name = "Mirror", |
340 | .minimum = 0, | 343 | .minimum = 0, |
341 | .maximum = 1, | 344 | .maximum = 1, |
342 | .type = V4L2_CTRL_TYPE_BOOLEAN, | 345 | .type = V4L2_CTRL_TYPE_BOOLEAN, |
@@ -482,7 +485,7 @@ static void set_tvnorm(struct saa7134_dev *dev, struct saa7134_tvnorm *norm) | |||
482 | dev->crop_bounds.width = norm->h_stop - norm->h_start +1; | 485 | dev->crop_bounds.width = norm->h_stop - norm->h_start +1; |
483 | dev->crop_defrect.width = norm->h_stop - norm->h_start +1; | 486 | dev->crop_defrect.width = norm->h_stop - norm->h_start +1; |
484 | 487 | ||
485 | dev->crop_bounds.top = (norm->vbi_v_stop+1)*2; | 488 | dev->crop_bounds.top = (norm->vbi_v_stop_0+1)*2; |
486 | dev->crop_defrect.top = norm->video_v_start*2; | 489 | dev->crop_defrect.top = norm->video_v_start*2; |
487 | dev->crop_bounds.height = ((norm->id & V4L2_STD_525_60) ? 524 : 624) | 490 | dev->crop_bounds.height = ((norm->id & V4L2_STD_525_60) ? 524 : 624) |
488 | - dev->crop_bounds.top; | 491 | - dev->crop_bounds.top; |
@@ -1064,7 +1067,7 @@ static int get_control(struct saa7134_dev *dev, struct v4l2_control *c) | |||
1064 | case V4L2_CID_PRIVATE_INVERT: | 1067 | case V4L2_CID_PRIVATE_INVERT: |
1065 | c->value = dev->ctl_invert; | 1068 | c->value = dev->ctl_invert; |
1066 | break; | 1069 | break; |
1067 | case V4L2_CID_VFLIP: | 1070 | case V4L2_CID_HFLIP: |
1068 | c->value = dev->ctl_mirror; | 1071 | c->value = dev->ctl_mirror; |
1069 | break; | 1072 | break; |
1070 | case V4L2_CID_PRIVATE_Y_EVEN: | 1073 | case V4L2_CID_PRIVATE_Y_EVEN: |
@@ -1139,7 +1142,7 @@ static int set_control(struct saa7134_dev *dev, struct saa7134_fh *fh, | |||
1139 | saa_writeb(SAA7134_DEC_CHROMA_SATURATION, | 1142 | saa_writeb(SAA7134_DEC_CHROMA_SATURATION, |
1140 | dev->ctl_invert ? -dev->ctl_saturation : dev->ctl_saturation); | 1143 | dev->ctl_invert ? -dev->ctl_saturation : dev->ctl_saturation); |
1141 | break; | 1144 | break; |
1142 | case V4L2_CID_VFLIP: | 1145 | case V4L2_CID_HFLIP: |
1143 | dev->ctl_mirror = c->value; | 1146 | dev->ctl_mirror = c->value; |
1144 | restart_overlay = 1; | 1147 | restart_overlay = 1; |
1145 | break; | 1148 | break; |
@@ -1407,9 +1410,9 @@ static void saa7134_vbi_fmt(struct saa7134_dev *dev, struct v4l2_format *f) | |||
1407 | f->fmt.vbi.samples_per_line = 2048 /* VBI_LINE_LENGTH */; | 1410 | f->fmt.vbi.samples_per_line = 2048 /* VBI_LINE_LENGTH */; |
1408 | f->fmt.vbi.sample_format = V4L2_PIX_FMT_GREY; | 1411 | f->fmt.vbi.sample_format = V4L2_PIX_FMT_GREY; |
1409 | f->fmt.vbi.offset = 64 * 4; | 1412 | f->fmt.vbi.offset = 64 * 4; |
1410 | f->fmt.vbi.start[0] = norm->vbi_v_start; | 1413 | f->fmt.vbi.start[0] = norm->vbi_v_start_0; |
1411 | f->fmt.vbi.count[0] = norm->vbi_v_stop - norm->vbi_v_start +1; | 1414 | f->fmt.vbi.count[0] = norm->vbi_v_stop_0 - norm->vbi_v_start_0 +1; |
1412 | f->fmt.vbi.start[1] = norm->video_v_stop + norm->vbi_v_start +1; | 1415 | f->fmt.vbi.start[1] = norm->vbi_v_start_1; |
1413 | f->fmt.vbi.count[1] = f->fmt.vbi.count[0]; | 1416 | f->fmt.vbi.count[1] = f->fmt.vbi.count[0]; |
1414 | f->fmt.vbi.flags = 0; /* VBI_UNSYNC VBI_INTERLACED */ | 1417 | f->fmt.vbi.flags = 0; /* VBI_UNSYNC VBI_INTERLACED */ |
1415 | 1418 | ||