aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-streams.c
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2009-01-30 22:33:02 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:42:38 -0400
commit302df9702192a68578916ef922c33370cbba350d (patch)
treeeab3173a4b82ec26c89b82c50e9bfb0fe2477953 /drivers/media/video/cx18/cx18-streams.c
parent4325dff220918c2ced82d16c3475d9a5afb1cab3 (diff)
V4L/DVB (10439): cx18: Clean-up and enable sliced VBI handling
Removed legacy ivtv state variables, added comments, and cleaned up sliced VBI related code. Enabled sliced VBI. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18/cx18-streams.c')
-rw-r--r--drivers/media/video/cx18/cx18-streams.c45
1 files changed, 35 insertions, 10 deletions
diff --git a/drivers/media/video/cx18/cx18-streams.c b/drivers/media/video/cx18/cx18-streams.c
index abc3fe605f00..a89f7f840d95 100644
--- a/drivers/media/video/cx18/cx18-streams.c
+++ b/drivers/media/video/cx18/cx18-streams.c
@@ -349,10 +349,6 @@ static void cx18_vbi_setup(struct cx18_stream *s)
349 /* setup VBI registers */ 349 /* setup VBI registers */
350 cx18_av_cmd(cx, VIDIOC_S_FMT, &cx->vbi.in); 350 cx18_av_cmd(cx, VIDIOC_S_FMT, &cx->vbi.in);
351 351
352 /* determine number of lines and total number of VBI bytes.
353 A raw line takes 1444 bytes: 4 byte SAV code + 2 * 720
354 A sliced line takes 51 bytes: 4 byte frame header, 4 byte internal
355 header, 42 data bytes + checksum (to be confirmed) */
356 if (raw) { 352 if (raw) {
357 lines = cx->vbi.count * 2; 353 lines = cx->vbi.count * 2;
358 } else { 354 } else {
@@ -361,24 +357,53 @@ static void cx18_vbi_setup(struct cx18_stream *s)
361 lines += 2; 357 lines += 2;
362 } 358 }
363 359
364 cx->vbi.enc_size = lines *
365 (raw ? cx->vbi.raw_size : cx->vbi.sliced_size);
366
367 data[0] = s->handle; 360 data[0] = s->handle;
368 /* Lines per field */ 361 /* Lines per field */
369 data[1] = (lines / 2) | ((lines / 2) << 16); 362 data[1] = (lines / 2) | ((lines / 2) << 16);
370 /* bytes per line */ 363 /* bytes per line */
371 data[2] = (raw ? cx->vbi.raw_decoder_line_size 364 data[2] = (raw ? vbi_active_samples
372 : cx->vbi.sliced_decoder_line_size); 365 : (cx->is_60hz ? vbi_hblank_samples_60Hz
366 : vbi_hblank_samples_50Hz));
373 /* Every X number of frames a VBI interrupt arrives 367 /* Every X number of frames a VBI interrupt arrives
374 (frames as in 25 or 30 fps) */ 368 (frames as in 25 or 30 fps) */
375 data[3] = 1; 369 data[3] = 1;
376 /* Setup VBI for the cx25840 digitizer */ 370 /*
371 * Set the SAV/EAV RP codes to look for as start/stop points
372 * when in VIP-1.1 mode
373 */
377 if (raw) { 374 if (raw) {
375 /*
376 * Start codes for beginning of "active" line in vertical blank
377 * 0x20 ( VerticalBlank )
378 * 0x60 ( EvenField VerticalBlank )
379 */
378 data[4] = 0x20602060; 380 data[4] = 0x20602060;
381 /*
382 * End codes for end of "active" raw lines and regular lines
383 * 0x30 ( VerticalBlank HorizontalBlank)
384 * 0x70 ( EvenField VerticalBlank HorizontalBlank)
385 * 0x90 (Task HorizontalBlank)
386 * 0xd0 (Task EvenField HorizontalBlank)
387 */
379 data[5] = 0x307090d0; 388 data[5] = 0x307090d0;
380 } else { 389 } else {
390 /*
391 * End codes for active video, we want data in the hblank region
392 * 0xb0 (Task 0 VerticalBlank HorizontalBlank)
393 * 0xf0 (Task EvenField VerticalBlank HorizontalBlank)
394 *
395 * Since the V bit is only allowed to toggle in the EAV RP code,
396 * just before the first active region line, these two
397 * are problematic and we have to ignore them:
398 * 0x90 (Task HorizontalBlank)
399 * 0xd0 (Task EvenField HorizontalBlank)
400 */
381 data[4] = 0xB0F0B0F0; 401 data[4] = 0xB0F0B0F0;
402 /*
403 * Start codes for beginning of active line in vertical blank
404 * 0xa0 (Task VerticalBlank )
405 * 0xe0 (Task EvenField VerticalBlank )
406 */
382 data[5] = 0xA0E0A0E0; 407 data[5] = 0xA0E0A0E0;
383 } 408 }
384 409