diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-01-23 14:11:05 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2006-01-23 14:11:05 -0500 |
commit | 6ac48b458769059ee6147dd8bf2767e820407292 (patch) | |
tree | 1c83bdbbd5b3b8751b922d732d1d8d40c4c47a09 | |
parent | 3ad96835cedec7704b1b5a211b39262bb794adaf (diff) |
V4L/DVB (3408): Included new sliced VBI types to videodev2.h and tvp5150
- Added other sliced VBI types to videodev2.h
- tvp5150 now uses standard V4L2 API codes from videodev2.h
- Implemented VIDIOC_G_SLICED_VBI_CAP for tvp5150. This is
dynamically filled based on defined VDP C-RAM values filled
by the driver.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/video/cx25840/cx25840-vbi.c | 6 | ||||
-rw-r--r-- | drivers/media/video/saa7115.c | 6 | ||||
-rw-r--r-- | drivers/media/video/tvp5150.c | 161 | ||||
-rw-r--r-- | drivers/media/video/tvp5150_reg.h | 7 | ||||
-rw-r--r-- | include/linux/videodev2.h | 51 |
5 files changed, 161 insertions, 70 deletions
diff --git a/drivers/media/video/cx25840/cx25840-vbi.c b/drivers/media/video/cx25840/cx25840-vbi.c index 04d879da7d63..e96fd1f1d6dc 100644 --- a/drivers/media/video/cx25840/cx25840-vbi.c +++ b/drivers/media/video/cx25840/cx25840-vbi.c | |||
@@ -151,7 +151,7 @@ int cx25840_vbi(struct i2c_client *client, unsigned int cmd, void *arg) | |||
151 | case VIDIOC_G_FMT: | 151 | case VIDIOC_G_FMT: |
152 | { | 152 | { |
153 | static u16 lcr2vbi[] = { | 153 | static u16 lcr2vbi[] = { |
154 | 0, V4L2_SLICED_TELETEXT_B, 0, /* 1 */ | 154 | 0, V4L2_SLICED_TELETEXT_PAL_B, 0, /* 1 */ |
155 | 0, V4L2_SLICED_WSS_625, 0, /* 4 */ | 155 | 0, V4L2_SLICED_WSS_625, 0, /* 4 */ |
156 | V4L2_SLICED_CAPTION_525, /* 6 */ | 156 | V4L2_SLICED_CAPTION_525, /* 6 */ |
157 | 0, 0, V4L2_SLICED_VPS, 0, 0, /* 9 */ | 157 | 0, 0, V4L2_SLICED_VPS, 0, 0, /* 9 */ |
@@ -231,7 +231,7 @@ int cx25840_vbi(struct i2c_client *client, unsigned int cmd, void *arg) | |||
231 | for (i = 7; i <= 23; i++) { | 231 | for (i = 7; i <= 23; i++) { |
232 | for (x = 0; x <= 1; x++) { | 232 | for (x = 0; x <= 1; x++) { |
233 | switch (svbi->service_lines[1-x][i]) { | 233 | switch (svbi->service_lines[1-x][i]) { |
234 | case V4L2_SLICED_TELETEXT_B: | 234 | case V4L2_SLICED_TELETEXT_PAL_B: |
235 | lcr[i] |= 1 << (4 * x); | 235 | lcr[i] |= 1 << (4 * x); |
236 | break; | 236 | break; |
237 | case V4L2_SLICED_WSS_625: | 237 | case V4L2_SLICED_WSS_625: |
@@ -282,7 +282,7 @@ int cx25840_vbi(struct i2c_client *client, unsigned int cmd, void *arg) | |||
282 | 282 | ||
283 | switch (id2) { | 283 | switch (id2) { |
284 | case 1: | 284 | case 1: |
285 | id2 = V4L2_SLICED_TELETEXT_B; | 285 | id2 = V4L2_SLICED_TELETEXT_PAL_B; |
286 | break; | 286 | break; |
287 | case 4: | 287 | case 4: |
288 | id2 = V4L2_SLICED_WSS_625; | 288 | id2 = V4L2_SLICED_WSS_625; |
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index 048d000941c7..487a42970963 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c | |||
@@ -791,7 +791,7 @@ static void saa7115_set_lcr(struct i2c_client *client, struct v4l2_sliced_vbi_fo | |||
791 | case 0: | 791 | case 0: |
792 | lcr[i] |= 0xf << (4 * x); | 792 | lcr[i] |= 0xf << (4 * x); |
793 | break; | 793 | break; |
794 | case V4L2_SLICED_TELETEXT_B: | 794 | case V4L2_SLICED_TELETEXT_PAL_B: |
795 | lcr[i] |= 1 << (4 * x); | 795 | lcr[i] |= 1 << (4 * x); |
796 | break; | 796 | break; |
797 | case V4L2_SLICED_CAPTION_525: | 797 | case V4L2_SLICED_CAPTION_525: |
@@ -820,7 +820,7 @@ static void saa7115_set_lcr(struct i2c_client *client, struct v4l2_sliced_vbi_fo | |||
820 | static int saa7115_get_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt) | 820 | static int saa7115_get_v4lfmt(struct i2c_client *client, struct v4l2_format *fmt) |
821 | { | 821 | { |
822 | static u16 lcr2vbi[] = { | 822 | static u16 lcr2vbi[] = { |
823 | 0, V4L2_SLICED_TELETEXT_B, 0, /* 1 */ | 823 | 0, V4L2_SLICED_TELETEXT_PAL_B, 0, /* 1 */ |
824 | 0, V4L2_SLICED_CAPTION_525, /* 4 */ | 824 | 0, V4L2_SLICED_CAPTION_525, /* 4 */ |
825 | V4L2_SLICED_WSS_625, 0, /* 5 */ | 825 | V4L2_SLICED_WSS_625, 0, /* 5 */ |
826 | V4L2_SLICED_VPS, 0, 0, 0, 0, /* 7 */ | 826 | V4L2_SLICED_VPS, 0, 0, 0, 0, /* 7 */ |
@@ -985,7 +985,7 @@ static void saa7115_decode_vbi_line(struct i2c_client *client, | |||
985 | /* decode payloads */ | 985 | /* decode payloads */ |
986 | switch (id2) { | 986 | switch (id2) { |
987 | case 1: | 987 | case 1: |
988 | vbi->type = V4L2_SLICED_TELETEXT_B; | 988 | vbi->type = V4L2_SLICED_TELETEXT_PAL_B; |
989 | break; | 989 | break; |
990 | case 4: | 990 | case 4: |
991 | if (!saa7115_odd_parity(p[0]) || !saa7115_odd_parity(p[1])) | 991 | if (!saa7115_odd_parity(p[0]) || !saa7115_odd_parity(p[1])) |
diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c index f7fa93c64d11..17a8dd726912 100644 --- a/drivers/media/video/tvp5150.c +++ b/drivers/media/video/tvp5150.c | |||
@@ -1,8 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * tvp5150 - Texas Instruments TVP5150A(M) video decoder driver | 2 | * tvp5150 - Texas Instruments TVP5150A/AM1 video decoder driver |
3 | * | 3 | * |
4 | * Copyright (c) 2005 Mauro Carvalho Chehab (mchehab@brturbo.com.br) | 4 | * Copyright (c) 2005,2006 Mauro Carvalho Chehab (mchehab@infradead.org) |
5 | * This code is placed under the terms of the GNU General Public License | 5 | * This code is placed under the terms of the GNU General Public License v2 |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #include <linux/i2c.h> | 8 | #include <linux/i2c.h> |
@@ -13,10 +13,11 @@ | |||
13 | 13 | ||
14 | #include "tvp5150_reg.h" | 14 | #include "tvp5150_reg.h" |
15 | 15 | ||
16 | MODULE_DESCRIPTION("Texas Instruments TVP5150A video decoder driver"); /* standard i2c insmod options */ | 16 | MODULE_DESCRIPTION("Texas Instruments TVP5150A video decoder driver"); |
17 | MODULE_AUTHOR("Mauro Carvalho Chehab"); | 17 | MODULE_AUTHOR("Mauro Carvalho Chehab"); |
18 | MODULE_LICENSE("GPL"); | 18 | MODULE_LICENSE("GPL"); |
19 | 19 | ||
20 | /* standard i2c insmod options */ | ||
20 | static unsigned short normal_i2c[] = { | 21 | static unsigned short normal_i2c[] = { |
21 | 0xb8 >> 1, | 22 | 0xb8 >> 1, |
22 | 0xba >> 1, | 23 | 0xba >> 1, |
@@ -477,82 +478,101 @@ static const struct i2c_reg_value tvp5150_init_enable[] = { | |||
477 | } | 478 | } |
478 | }; | 479 | }; |
479 | 480 | ||
481 | struct tvp5150_vbi_type { | ||
482 | unsigned int vbi_type; | ||
483 | unsigned int ini_line; | ||
484 | unsigned int end_line; | ||
485 | unsigned int by_field :1; | ||
486 | }; | ||
487 | |||
480 | struct i2c_vbi_ram_value { | 488 | struct i2c_vbi_ram_value { |
481 | u16 reg; | 489 | u16 reg; |
482 | unsigned char values[26]; | 490 | struct tvp5150_vbi_type type; |
491 | unsigned char values[16]; | ||
483 | }; | 492 | }; |
484 | 493 | ||
485 | /* tvp5150_vbi_types should follow the same order as vbi_ram_default | 494 | /* This struct have the values for each supported VBI Standard |
495 | * by | ||
496 | tvp5150_vbi_types should follow the same order as vbi_ram_default | ||
486 | * value 0 means rom position 0x10, value 1 means rom position 0x30 | 497 | * value 0 means rom position 0x10, value 1 means rom position 0x30 |
487 | * and so on. There are 16 possible locations from 0 to 15. | 498 | * and so on. There are 16 possible locations from 0 to 15. |
488 | */ | 499 | */ |
489 | enum tvp5150_vbi_types { /* Video line number Description */ | ||
490 | VBI_WST_SECAM, /* 6-23 (field 1,2) Teletext, SECAM */ | ||
491 | VBI_WST_PAL_B, /* 6-22 (field 1,2) Teletext, PAL, System B */ | ||
492 | VBI_WST_PAL_C, /* 6-22 (field 1,2) Teletext, PAL, System C */ | ||
493 | VBI_WST_NTSC_B, /* 10-21 (field 1,2) Teletext, NTSC, System B */ | ||
494 | VBI_NABTS_NTSC_C, /* 10-21 (field 1,2) Teletext, NTSC, System C */ | ||
495 | VBI_NABTS_NTSC_D, /* 10-21 (field 1,2) Teletext, NTSC, System D */ | ||
496 | VBI_CC_PAL_SECAM, /* 22 (field 1,2) Closed Caption PAL/SECAM */ | ||
497 | VBI_CC_NTSC, /* 21 (field 1,2) Closed Caption NTSC */ | ||
498 | VBI_WSS_PAL_SECAM, /* 23 (field 1,2) Wide Screen Signal PAL/SECAM */ | ||
499 | VBI_WSS_NTSC, /* 20 (field 1,2) Wide Screen Signal NTSC */ | ||
500 | VBI_VITC_PAL_SECAM, /* 6-22 Vertical Interval Timecode PAL/SECAM */ | ||
501 | VBI_VITC_NTSC, /* 10-20 Vertical Interval Timecode NTSC */ | ||
502 | VBI_VPS_PAL, /* 16 Video Program System PAL */ | ||
503 | VBI_EPG_GEMSTAR, /* EPG/Gemstar Electronic program guide */ | ||
504 | VBI_RESERVED, /* not in use on vbi_ram_default table */ | ||
505 | VBI_FULL_FIELD /* Active video/Full Field */ | ||
506 | }; | ||
507 | 500 | ||
508 | static struct i2c_vbi_ram_value vbi_ram_default[] = | 501 | static struct i2c_vbi_ram_value vbi_ram_default[] = |
509 | { | 502 | { |
510 | {0x010, /* WST SECAM */ | 503 | {0x010, /* Teletext, SECAM, WST System A */ |
511 | { 0xaa, 0xaa, 0xff, 0xff , 0xe7, 0x2e, 0x20, 0x26, 0xe6, 0xb4, 0x0e, 0x0, 0x0, 0x0, 0x10, 0x0 } | 504 | {V4L2_SLICED_TELETEXT_SECAM,6,23,1}, |
505 | { 0xaa, 0xaa, 0xff, 0xff, 0xe7, 0x2e, 0x20, 0x26, | ||
506 | 0xe6, 0xb4, 0x0e, 0x00, 0x00, 0x00, 0x10, 0x00 } | ||
512 | }, | 507 | }, |
513 | {0x030, /* WST PAL B */ | 508 | {0x030, /* Teletext, PAL, WST System B */ |
514 | { 0xaa, 0xaa, 0xff, 0xff , 0x27, 0x2e, 0x20, 0x2b, 0xa6, 0x72, 0x10, 0x0, 0x0, 0x0, 0x10, 0x0 } | 509 | {V4L2_SLICED_TELETEXT_PAL_B,6,22,1}, |
510 | { 0xaa, 0xaa, 0xff, 0xff, 0x27, 0x2e, 0x20, 0x2b, | ||
511 | 0xa6, 0x72, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00 } | ||
515 | }, | 512 | }, |
516 | {0x050, /* WST PAL C */ | 513 | {0x050, /* Teletext, PAL, WST System C */ |
517 | { 0xaa, 0xaa, 0xff, 0xff , 0xe7, 0x2e, 0x20, 0x22, 0xa6, 0x98, 0x0d, 0x0, 0x0, 0x0, 0x10, 0x0 } | 514 | {V4L2_SLICED_TELETEXT_PAL_C,6,22,1}, |
515 | { 0xaa, 0xaa, 0xff, 0xff, 0xe7, 0x2e, 0x20, 0x22, | ||
516 | 0xa6, 0x98, 0x0d, 0x00, 0x00, 0x00, 0x10, 0x00 } | ||
518 | }, | 517 | }, |
519 | {0x070, /* WST NTSC B */ | 518 | {0x070, /* Teletext, NTSC, WST System B */ |
520 | { 0xaa, 0xaa, 0xff, 0xff , 0x27, 0x2e, 0x20, 0x23, 0x69, 0x93, 0x0d, 0x0, 0x0, 0x0, 0x10, 0x0 } | 519 | {V4L2_SLICED_TELETEXT_NTSC_B,10,21,1}, |
520 | { 0xaa, 0xaa, 0xff, 0xff, 0x27, 0x2e, 0x20, 0x23, | ||
521 | 0x69, 0x93, 0x0d, 0x00, 0x00, 0x00, 0x10, 0x00 } | ||
521 | }, | 522 | }, |
522 | {0x090, /* NABTS, NTSC */ | 523 | {0x090, /* Tetetext, NTSC NABTS System C */ |
523 | { 0xaa, 0xaa, 0xff, 0xff , 0xe7, 0x2e, 0x20, 0x22, 0x69, 0x93, 0x0d, 0x0, 0x0, 0x0, 0x15, 0x0 } | 524 | {V4L2_SLICED_TELETEXT_NTSC_C,10,21,1}, |
525 | { 0xaa, 0xaa, 0xff, 0xff, 0xe7, 0x2e, 0x20, 0x22, | ||
526 | 0x69, 0x93, 0x0d, 0x00, 0x00, 0x00, 0x15, 0x00 } | ||
524 | }, | 527 | }, |
525 | {0x0b0, /* NABTS, NTSC-J */ | 528 | {0x0b0, /* Teletext, NTSC-J, NABTS System D */ |
526 | { 0xaa, 0xaa, 0xff, 0xff , 0xa7, 0x2e, 0x20, 0x23, 0x69, 0x93, 0x0d, 0x0, 0x0, 0x0, 0x10, 0x0 } | 529 | {V4L2_SLICED_TELETEXT_NTSC_D,10,21,1}, |
530 | { 0xaa, 0xaa, 0xff, 0xff, 0xa7, 0x2e, 0x20, 0x23, | ||
531 | 0x69, 0x93, 0x0d, 0x00, 0x00, 0x00, 0x10, 0x00 } | ||
527 | }, | 532 | }, |
528 | {0x0d0, /* CC, PAL/SECAM */ | 533 | {0x0d0, /* Closed Caption, PAL/SECAM */ |
529 | { 0xaa, 0x2a, 0xff, 0x3f , 0x04, 0x51, 0x6e, 0x02, 0xa6, 0x7b, 0x09, 0x0, 0x0, 0x0, 0x27, 0x0 } | 534 | {V4L2_SLICED_CAPTION_625,22,22,1}, |
535 | { 0xaa, 0x2a, 0xff, 0x3f, 0x04, 0x51, 0x6e, 0x02, | ||
536 | 0xa6, 0x7b, 0x09, 0x00, 0x00, 0x00, 0x27, 0x00 } | ||
530 | }, | 537 | }, |
531 | {0x0f0, /* CC, NTSC */ | 538 | {0x0f0, /* Closed Caption, NTSC */ |
532 | { 0xaa, 0x2a, 0xff, 0x3f , 0x04, 0x51, 0x6e, 0x02, 0x69, 0x8c, 0x09, 0x0, 0x0, 0x0, 0x27, 0x0 } | 539 | {V4L2_SLICED_CAPTION_525,21,21,1}, |
540 | { 0xaa, 0x2a, 0xff, 0x3f, 0x04, 0x51, 0x6e, 0x02, | ||
541 | 0x69, 0x8c, 0x09, 0x00, 0x00, 0x00, 0x27, 0x00 } | ||
533 | }, | 542 | }, |
534 | {0x110, /* WSS, PAL/SECAM */ | 543 | {0x110, /* Wide Screen Signal, PAL/SECAM */ |
535 | { 0x5b, 0x55, 0xc5, 0xff , 0x0, 0x71, 0x6e, 0x42, 0xa6, 0xcd, 0x0f, 0x0, 0x0, 0x0, 0x3a, 0x0 } | 544 | {V4L2_SLICED_WSS_625,20,21,1}, |
545 | { 0x5b, 0x55, 0xc5, 0xff, 0x00, 0x71, 0x6e, 0x42, | ||
546 | 0xa6, 0xcd, 0x0f, 0x00, 0x00, 0x00, 0x3a, 0x00 } | ||
536 | }, | 547 | }, |
537 | {0x130, /* WSS, NTSC C */ | 548 | {0x130, /* Wide Screen Signal, NTSC C */ |
538 | { 0x38, 0x00, 0x3f, 0x00 , 0x0, 0x71, 0x6e, 0x43, 0x69, 0x7c, 0x08, 0x0, 0x0, 0x0, 0x39, 0x0 } | 549 | {V4L2_SLICED_WSS_525,20,20,1}, |
550 | { 0x38, 0x00, 0x3f, 0x00, 0x00, 0x71, 0x6e, 0x43, | ||
551 | 0x69, 0x7c, 0x08, 0x00, 0x00, 0x00, 0x39, 0x00 } | ||
539 | }, | 552 | }, |
540 | {0x150, /* VITC, PAL/SECAM */ | 553 | {0x150, /* Vertical Interval Timecode (VITC), PAL/SECAM */ |
541 | { 0x0, 0x0, 0x0, 0x0 , 0x0, 0x8f, 0x6d, 0x49, 0xa6, 0x85, 0x08, 0x0, 0x0, 0x0, 0x4c, 0x0 } | 554 | {V4l2_SLICED_VITC_625,6,22,0}, |
555 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x8f, 0x6d, 0x49, | ||
556 | 0xa6, 0x85, 0x08, 0x00, 0x00, 0x00, 0x4c, 0x00 } | ||
542 | }, | 557 | }, |
543 | {0x170, /* VITC, NTSC */ | 558 | {0x170, /* Vertical Interval Timecode (VITC), NTSC */ |
544 | { 0x0, 0x0, 0x0, 0x0 , 0x0, 0x8f, 0x6d, 0x49, 0x69, 0x94, 0x08, 0x0, 0x0, 0x0, 0x4c, 0x0 } | 559 | {V4l2_SLICED_VITC_525,10,20,0}, |
560 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x8f, 0x6d, 0x49, | ||
561 | 0x69, 0x94, 0x08, 0x00, 0x00, 0x00, 0x4c, 0x00 } | ||
545 | }, | 562 | }, |
546 | {0x190, /* VPS, PAL */ | 563 | {0x190, /* Video Program System (VPS), PAL */ |
547 | { 0xaa, 0xaa, 0xff, 0xff, 0xba, 0xce, 0x2b, 0x0d, 0xa6, 0xda, 0x0b, 0x0, 0x0, 0x0, 0x60, 0x0 } | 564 | {V4L2_SLICED_VPS,16,16,0}, |
548 | }, | 565 | { 0xaa, 0xaa, 0xff, 0xff, 0xba, 0xce, 0x2b, 0x0d, |
549 | {0x1b0, /* Gemstar Custom 1 */ | 566 | 0xa6, 0xda, 0x0b, 0x00, 0x00, 0x00, 0x60, 0x00 } |
550 | { 0xcc, 0xcc, 0xff, 0xff, 0x05, 0x51, 0x6e, 0x05, 0x69, 0x19, 0x13, 0x0, 0x0, 0x0, 0x60, 0x0 } | ||
551 | }, | 567 | }, |
568 | /* 0x1d0 User programmable */ | ||
569 | |||
570 | /* End of struct */ | ||
571 | { (u16)-1 } | ||
552 | }; | 572 | }; |
553 | 573 | ||
554 | static int tvp5150_write_inittab(struct i2c_client *c, | 574 | static int tvp5150_write_inittab(struct i2c_client *c, |
555 | const struct i2c_reg_value *regs) | 575 | const struct i2c_reg_value *regs) |
556 | { | 576 | { |
557 | while (regs->reg != 0xff) { | 577 | while (regs->reg != 0xff) { |
558 | tvp5150_write(c, regs->reg, regs->value); | 578 | tvp5150_write(c, regs->reg, regs->value); |
@@ -562,7 +582,7 @@ static int tvp5150_write_inittab(struct i2c_client *c, | |||
562 | } | 582 | } |
563 | 583 | ||
564 | static int tvp5150_vdp_init(struct i2c_client *c, | 584 | static int tvp5150_vdp_init(struct i2c_client *c, |
565 | const struct i2c_vbi_ram_value *regs) | 585 | const struct i2c_vbi_ram_value *regs) |
566 | { | 586 | { |
567 | unsigned int i; | 587 | unsigned int i; |
568 | 588 | ||
@@ -586,6 +606,24 @@ static int tvp5150_vdp_init(struct i2c_client *c, | |||
586 | return 0; | 606 | return 0; |
587 | } | 607 | } |
588 | 608 | ||
609 | /* Fills VBI capabilities based on i2c_vbi_ram_value struct */ | ||
610 | static void tvp5150_vbi_get_cap(const struct i2c_vbi_ram_value *regs, | ||
611 | struct v4l2_sliced_vbi_cap *cap) | ||
612 | { | ||
613 | int line; | ||
614 | |||
615 | memset(cap, 0, sizeof *cap); | ||
616 | |||
617 | while (regs->reg != (u16)-1 ) { | ||
618 | for (line=regs->type.ini_line;line<=regs->type.end_line;line++) { | ||
619 | cap->service_lines[0][line] |= regs->type.vbi_type; | ||
620 | } | ||
621 | cap->service_set |= regs->type.vbi_type; | ||
622 | |||
623 | regs++; | ||
624 | } | ||
625 | } | ||
626 | |||
589 | /* Set vbi processing | 627 | /* Set vbi processing |
590 | * type - one of tvp5150_vbi_types | 628 | * type - one of tvp5150_vbi_types |
591 | * line - line to gather data | 629 | * line - line to gather data |
@@ -599,7 +637,7 @@ static int tvp5150_vdp_init(struct i2c_client *c, | |||
599 | * LSB = field1 | 637 | * LSB = field1 |
600 | * MSB = field2 | 638 | * MSB = field2 |
601 | */ | 639 | */ |
602 | static int tvp5150_set_vbi(struct i2c_client *c, enum tvp5150_vbi_types type, | 640 | static int tvp5150_set_vbi(struct i2c_client *c, unsigned int type, |
603 | u8 flags, int line, const int fields) | 641 | u8 flags, int line, const int fields) |
604 | { | 642 | { |
605 | struct tvp5150 *decoder = i2c_get_clientdata(c); | 643 | struct tvp5150 *decoder = i2c_get_clientdata(c); |
@@ -775,6 +813,15 @@ static int tvp5150_command(struct i2c_client *c, | |||
775 | *(v4l2_std_id *)arg = decoder->norm; | 813 | *(v4l2_std_id *)arg = decoder->norm; |
776 | break; | 814 | break; |
777 | 815 | ||
816 | case VIDIOC_G_SLICED_VBI_CAP: | ||
817 | { | ||
818 | struct v4l2_sliced_vbi_cap *cap = arg; | ||
819 | tvp5150_dbg(1, "VIDIOC_G_SLICED_VBI_CAP\n"); | ||
820 | |||
821 | tvp5150_vbi_get_cap(vbi_ram_default, cap); | ||
822 | break; | ||
823 | } | ||
824 | |||
778 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 825 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
779 | case VIDIOC_INT_G_REGISTER: | 826 | case VIDIOC_INT_G_REGISTER: |
780 | { | 827 | { |
@@ -1021,7 +1068,7 @@ static int tvp5150_detect_client(struct i2c_adapter *adapter, | |||
1021 | return rv; | 1068 | return rv; |
1022 | } | 1069 | } |
1023 | 1070 | ||
1024 | if (debug > 1) | 1071 | // if (debug > 1) |
1025 | dump_reg(c); | 1072 | dump_reg(c); |
1026 | return 0; | 1073 | return 0; |
1027 | } | 1074 | } |
diff --git a/drivers/media/video/tvp5150_reg.h b/drivers/media/video/tvp5150_reg.h index c81587e06e37..4240043c0b2a 100644 --- a/drivers/media/video/tvp5150_reg.h +++ b/drivers/media/video/tvp5150_reg.h | |||
@@ -1,3 +1,10 @@ | |||
1 | /* | ||
2 | * tvp5150 - Texas Instruments TVP5150A/AM1 video decoder registers | ||
3 | * | ||
4 | * Copyright (c) 2005,2006 Mauro Carvalho Chehab (mchehab@infradead.org) | ||
5 | * This code is placed under the terms of the GNU General Public License v2 | ||
6 | */ | ||
7 | |||
1 | #define TVP5150_VD_IN_SRC_SEL_1 0x00 /* Video input source selection #1 */ | 8 | #define TVP5150_VD_IN_SRC_SEL_1 0x00 /* Video input source selection #1 */ |
2 | #define TVP5150_ANAL_CHL_CTL 0x01 /* Analog channel controls */ | 9 | #define TVP5150_ANAL_CHL_CTL 0x01 /* Analog channel controls */ |
3 | #define TVP5150_OP_MODE_CTL 0x02 /* Operation mode controls */ | 10 | #define TVP5150_OP_MODE_CTL 0x02 /* Operation mode controls */ |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index ce40675324bd..27ae3d679cbe 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -949,13 +949,50 @@ struct v4l2_sliced_vbi_format | |||
949 | __u32 reserved[2]; /* must be zero */ | 949 | __u32 reserved[2]; /* must be zero */ |
950 | }; | 950 | }; |
951 | 951 | ||
952 | #define V4L2_SLICED_TELETEXT_B (0x0001) | 952 | /* Teletext WST, defined on ITU-R BT.653-2 */ |
953 | #define V4L2_SLICED_VPS (0x0400) | 953 | #define V4L2_SLICED_TELETEXT_PAL_B (0x000001) |
954 | #define V4L2_SLICED_CAPTION_525 (0x1000) | 954 | #define V4L2_SLICED_TELETEXT_PAL_C (0x000002) |
955 | #define V4L2_SLICED_WSS_625 (0x4000) | 955 | #define V4L2_SLICED_TELETEXT_NTSC_B (0x000010) |
956 | 956 | #define V4L2_SLICED_TELETEXT_SECAM (0x000020) | |
957 | #define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525) | 957 | |
958 | #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625) | 958 | /* Teletext NABTS, defined on ITU-R BT.653-2 */ |
959 | #define V4L2_SLICED_TELETEXT_NTSC_C (0x000040) | ||
960 | #define V4L2_SLICED_TELETEXT_NTSC_D (0x000080) | ||
961 | |||
962 | /* Video Program System, defined on ETS 300 231*/ | ||
963 | #define V4L2_SLICED_VPS (0x000400) | ||
964 | |||
965 | /* Closed Caption, defined on EIA-608 */ | ||
966 | #define V4L2_SLICED_CAPTION_525 (0x001000) | ||
967 | #define V4L2_SLICED_CAPTION_625 (0x002000) | ||
968 | |||
969 | /* Wide Screen System, defined on ITU-R BT1119.1 */ | ||
970 | #define V4L2_SLICED_WSS_625 (0x004000) | ||
971 | |||
972 | /* Wide Screen System, defined on IEC 61880 */ | ||
973 | #define V4L2_SLICED_WSS_525 (0x008000) | ||
974 | |||
975 | /* Vertical Interval Timecode (VITC), defined on SMPTE 12M */ | ||
976 | #define V4l2_SLICED_VITC_625 (0x010000) | ||
977 | #define V4l2_SLICED_VITC_525 (0x020000) | ||
978 | |||
979 | /* Compat macro - Should be removed for 2.6.18 */ | ||
980 | #define V4L2_SLICED_TELETEXT_B V4L2_SLICED_TELETEXT_PAL_B | ||
981 | |||
982 | #define V4L2_SLICED_VBI_525 (V4L2_SLICED_TELETEXT_NTSC_B |\ | ||
983 | V4L2_SLICED_TELETEXT_NTSC_C |\ | ||
984 | V4L2_SLICED_TELETEXT_NTSC_D |\ | ||
985 | V4L2_SLICED_CAPTION_525 |\ | ||
986 | V4L2_SLICED_WSS_525 |\ | ||
987 | V4l2_SLICED_VITC_525) | ||
988 | |||
989 | #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_PAL_B |\ | ||
990 | V4L2_SLICED_TELETEXT_PAL_C |\ | ||
991 | V4L2_SLICED_TELETEXT_SECAM |\ | ||
992 | V4L2_SLICED_VPS |\ | ||
993 | V4L2_SLICED_CAPTION_625 |\ | ||
994 | V4L2_SLICED_WSS_625 |\ | ||
995 | V4l2_SLICED_VITC_625) | ||
959 | 996 | ||
960 | struct v4l2_sliced_vbi_cap | 997 | struct v4l2_sliced_vbi_cap |
961 | { | 998 | { |