V4L/DVB (8994): Adjust MPEG initialization in cx24116
authorIgor M. Liplianin <liplianin@me.by>
Tue, 9 Sep 2008 16:57:47 +0000 (13:57 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 12 Oct 2008 11:37:04 +0000 (09:37 -0200)
Adjust MPEG initialization in cx24116 in order to accomodate different
MPEG CLK position and polarity in different cards.

Signed-off-by: Igor M. Liplianin <liplianin@me.by>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/dvb-usb/dw2102.c
drivers/media/dvb/frontends/cx24116.c
drivers/media/dvb/frontends/cx24116.h

index 0f3f962b35bf78fd9895ab6b50f62a79b3755ee2..ad3d6fca9ab8e39911a961b455ab263323e9f004 100644 (file)
@@ -284,7 +284,7 @@ static int dw2102_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
 
 static struct cx24116_config dw2104_config = {
        .demod_address = 0x55,
-       /*.mpg_clk_pos_pol = 0x01,*/
+       .mpg_clk_pos_pol = 0x01,
 };
 
 static int dw2104_frontend_attach(struct dvb_usb_adapter *d)
index 2ff9e20c595ffde54d0646d1d48dbc9b0d60d245..666a0d89e83c51ef657ffe2d45b42a68dcfb28fe 100644 (file)
@@ -478,7 +478,10 @@ static int cx24116_load_firmware (struct dvb_frontend* fe, const struct firmware
        cmd.args[0x01] = 0x01;
        cmd.args[0x02] = 0x75;
        cmd.args[0x03] = 0x00;
-       cmd.args[0x04] = 0x02;
+       if (state->config->mpg_clk_pos_pol)
+               cmd.args[0x04] = state->config->mpg_clk_pos_pol;
+       else
+               cmd.args[0x04] = 0x02;
        cmd.args[0x05] = 0x00;
        cmd.len= 0x06;
        ret = cx24116_cmd_execute(fe, &cmd);
index 27896725204ad145c54c3b1ce42d00aa48acf375..8dbcec268394eb7030b8dcae1c45c5f55d78dfed 100644 (file)
@@ -33,6 +33,9 @@ struct cx24116_config
 
        /* Need to reset device during firmware loading */
        int (*reset_device)(struct dvb_frontend* fe);
+
+       /* Need to set MPEG parameters */
+       u8 mpg_clk_pos_pol:0x02;
 };
 
 #if defined(CONFIG_DVB_CX24116) || defined(CONFIG_DVB_CX24116_MODULE)