diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2007-02-03 04:35:07 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-02-21 10:35:14 -0500 |
commit | faeb4ab38f6fec62d50a023e1778d13e73a0b088 (patch) | |
tree | c608a80635bb9975735c8506eed8f84ba4de1933 /drivers/media/video/saa7115.c | |
parent | 2675f7a88f73bc3131b817c118fbffa5cfed8868 (diff) |
V4L/DVB (5183): Fix CC handling in VIDIOC_INT_G_VBI_DATA
When capturing a 60 Hz input the internal field ID is inverted. The
VIDIOC_INT_G_VBI_DATA didn't take that into account and so returned
XDS instead of CC and vice versa.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/saa7115.c')
-rw-r--r-- | drivers/media/video/saa7115.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index 71777216b607..c4f066d6668e 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c | |||
@@ -1388,6 +1388,9 @@ static int saa711x_command(struct i2c_client *client, unsigned int cmd, void *ar | |||
1388 | { | 1388 | { |
1389 | struct v4l2_sliced_vbi_data *data = arg; | 1389 | struct v4l2_sliced_vbi_data *data = arg; |
1390 | 1390 | ||
1391 | /* Note: the internal field ID is inverted for NTSC, | ||
1392 | so data->field 0 maps to the saa7115 even field, | ||
1393 | whereas for PAL it maps to the saa7115 odd field. */ | ||
1391 | switch (data->id) { | 1394 | switch (data->id) { |
1392 | case V4L2_SLICED_WSS_625: | 1395 | case V4L2_SLICED_WSS_625: |
1393 | if (saa711x_read(client, 0x6b) & 0xc0) | 1396 | if (saa711x_read(client, 0x6b) & 0xc0) |
@@ -1398,17 +1401,17 @@ static int saa711x_command(struct i2c_client *client, unsigned int cmd, void *ar | |||
1398 | case V4L2_SLICED_CAPTION_525: | 1401 | case V4L2_SLICED_CAPTION_525: |
1399 | if (data->field == 0) { | 1402 | if (data->field == 0) { |
1400 | /* CC */ | 1403 | /* CC */ |
1401 | if (saa711x_read(client, 0x66) & 0xc0) | 1404 | if (saa711x_read(client, 0x66) & 0x30) |
1402 | return -EIO; | 1405 | return -EIO; |
1403 | data->data[0] = saa711x_read(client, 0x67); | 1406 | data->data[0] = saa711x_read(client, 0x69); |
1404 | data->data[1] = saa711x_read(client, 0x68); | 1407 | data->data[1] = saa711x_read(client, 0x6a); |
1405 | return 0; | 1408 | return 0; |
1406 | } | 1409 | } |
1407 | /* XDS */ | 1410 | /* XDS */ |
1408 | if (saa711x_read(client, 0x66) & 0x30) | 1411 | if (saa711x_read(client, 0x66) & 0xc0) |
1409 | return -EIO; | 1412 | return -EIO; |
1410 | data->data[0] = saa711x_read(client, 0x69); | 1413 | data->data[0] = saa711x_read(client, 0x67); |
1411 | data->data[1] = saa711x_read(client, 0x6a); | 1414 | data->data[1] = saa711x_read(client, 0x68); |
1412 | return 0; | 1415 | return 0; |
1413 | default: | 1416 | default: |
1414 | return -EINVAL; | 1417 | return -EINVAL; |