diff options
author | Dmitry Belimov <d.belimov@gmail.com> | 2008-08-26 13:44:40 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-12 09:36:55 -0200 |
commit | f03813e4d1900b619d4cb133506b130e535614f0 (patch) | |
tree | 3803072475bafcc341d82feb0ce257be29a566f0 /drivers/media/video/saa7134/saa6752hs.c | |
parent | 9d95af9d09d537d287eea9914c0d1ca4cfa0ec7f (diff) |
V4L/DVB (8795): saa7134-empress: insert leading null bytes for Beholder M6 empress cards
Additional code to improve the init sequence and add board type tests
were done by Hans Verkuil.
Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7134/saa6752hs.c')
-rw-r--r-- | drivers/media/video/saa7134/saa6752hs.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/media/video/saa7134/saa6752hs.c b/drivers/media/video/saa7134/saa6752hs.c index 28499e59192..f40cb0b479b 100644 --- a/drivers/media/video/saa7134/saa6752hs.c +++ b/drivers/media/video/saa7134/saa6752hs.c @@ -653,7 +653,7 @@ static int saa6752hs_qmenu(struct saa6752hs_state *h, return v4l2_ctrl_query_menu(qmenu, &qctrl, NULL); } -static int saa6752hs_init(struct i2c_client* client) +static int saa6752hs_init(struct i2c_client *client, u32 leading_null_bytes) { unsigned char buf[9], buf2[4]; struct saa6752hs_state *h; @@ -705,6 +705,12 @@ static int saa6752hs_init(struct i2c_client* client) buf[1] = 0x05; i2c_master_send(client,buf,2); + /* Set leading null byte for TS */ + buf[0] = 0xF6; + buf[1] = (leading_null_bytes >> 8) & 0xff; + buf[2] = leading_null_bytes & 0xff; + i2c_master_send(client, buf, 3); + /* compute PAT */ memcpy(localPAT, PAT, sizeof(PAT)); localPAT[17] = 0xe0 | ((h->params.ts_pid_pmt >> 8) & 0x0f); @@ -812,14 +818,13 @@ saa6752hs_command(struct i2c_client *client, unsigned int cmd, void *arg) int i; switch (cmd) { + case VIDIOC_INT_INIT: + /* apply settings and start encoder */ + saa6752hs_init(client, *(u32 *)arg); + break; case VIDIOC_S_EXT_CTRLS: if (ctrls->ctrl_class != V4L2_CTRL_CLASS_MPEG) return -EINVAL; - if (ctrls->count == 0) { - /* apply settings and start encoder */ - saa6752hs_init(client); - break; - } /* fall through */ case VIDIOC_TRY_EXT_CTRLS: case VIDIOC_G_EXT_CTRLS: |