summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx25840/cx25840-vbi.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2006-05-24 15:16:45 +0200
committerHans Verkuil <hverkuil@xs4all.nl>2006-05-24 15:16:45 +0200
commitf42c88e0f6e08ebe2df7e03c4d5e8e0070120342 (patch)
tree8e02fecbd31557ce2c2dacfdc07760b56595ef85 /linux/drivers/media/video/cx25840/cx25840-vbi.c
parent86021ed118e9bc956640ce9155683f3356ad50cb (diff)
downloadmediapointer-dvb-s2-f42c88e0f6e08ebe2df7e03c4d5e8e0070120342.tar.gz
mediapointer-dvb-s2-f42c88e0f6e08ebe2df7e03c4d5e8e0070120342.tar.bz2
Add NTSC sliced VBI support to the cx25840 module.
From: Christopher Neufeld <television@cneufeld.ca> NTSC sliced VBI support by Christopher Neufeld <television@cneufeld.ca> with additional fixes by Hans Verkuil <hverkuil@xs4all.nl>. Signed-off-by: Christopher Neufeld <television@cneufeld.ca> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media/video/cx25840/cx25840-vbi.c')
-rw-r--r--linux/drivers/media/video/cx25840/cx25840-vbi.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/linux/drivers/media/video/cx25840/cx25840-vbi.c b/linux/drivers/media/video/cx25840/cx25840-vbi.c
index 658fcb260..a998760c8 100644
--- a/linux/drivers/media/video/cx25840/cx25840-vbi.c
+++ b/linux/drivers/media/video/cx25840/cx25840-vbi.c
@@ -85,6 +85,7 @@ static int decode_vps(u8 * dst, u8 * p)
void cx25840_vbi_setup(struct i2c_client *client)
{
+ struct cx25840_state *state = i2c_get_clientdata(client);
v4l2_std_id std = cx25840_get_v4lstd(client);
if (std & ~V4L2_STD_NTSC) {
@@ -118,6 +119,7 @@ void cx25840_vbi_setup(struct i2c_client *client)
cx25840_write(client, 0x47e, 0x0a);
cx25840_write(client, 0x47f, 0x01);
+ state->vbi_line_offset = 5;
} else {
/* datasheet startup, step 8d */
cx25840_write(client, 0x49f, 0x14);
@@ -141,11 +143,13 @@ void cx25840_vbi_setup(struct i2c_client *client)
cx25840_write(client, 0x47d, 0x7c);
cx25840_write(client, 0x47e, 0x08);
cx25840_write(client, 0x47f, 0x00);
+ state->vbi_line_offset = 8;
}
}
int cx25840_vbi(struct i2c_client *client, unsigned int cmd, void *arg)
{
+ struct cx25840_state *state = i2c_get_clientdata(client);
struct v4l2_format *fmt;
struct v4l2_sliced_vbi_format *svbi;
@@ -212,7 +216,7 @@ int cx25840_vbi(struct i2c_client *client, unsigned int cmd, void *arg)
cx25840_vbi_setup(client);
/* Sliced VBI */
- cx25840_write(client, 0x404, 0x36); /* Ancillery data */
+ cx25840_write(client, 0x404, 0x32); /* Ancillary data */
cx25840_write(client, 0x406, 0x13);
cx25840_write(client, 0x47f, vbi_offset);
@@ -249,8 +253,18 @@ int cx25840_vbi(struct i2c_client *client, unsigned int cmd, void *arg)
}
}
- for (x = 1, i = 0x424; i <= 0x434; i++, x++) {
- cx25840_write(client, i, lcr[6 + x]);
+ if (is_pal) {
+ for (x = 1, i = 0x424; i <= 0x434; i++, x++) {
+ cx25840_write(client, i, lcr[6 + x]);
+ }
+ }
+ else {
+ for (x = 1, i = 0x424; i <= 0x430; i++, x++) {
+ cx25840_write(client, i, lcr[9 + x]);
+ }
+ for (i = 0x431; i <= 0x434; i++) {
+ cx25840_write(client, i, 0);
+ }
}
cx25840_write(client, 0x43c, 0x16);
@@ -258,7 +272,7 @@ int cx25840_vbi(struct i2c_client *client, unsigned int cmd, void *arg)
if (is_pal) {
cx25840_write(client, 0x474, 0x2a);
} else {
- cx25840_write(client, 0x474, 0x1a + 6);
+ cx25840_write(client, 0x474, 0x22);
}
break;
}
@@ -279,7 +293,7 @@ int cx25840_vbi(struct i2c_client *client, unsigned int cmd, void *arg)
id1 = p[-1];
id2 = p[0] & 0xf;
l = p[2] & 0x3f;
- l += 5;
+ l += state->vbi_line_offset;
p += 4;
switch (id2) {