V4L/DVB (9174): Allow custom inittab for ST STV0288 demodulator.
authorIgor M. Liplianin <liplianin@me.by>
Sun, 5 Oct 2008 11:52:18 +0000 (08:52 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 13 Oct 2008 14:26:01 +0000 (12:26 -0200)
Allow custom inittab for ST STV0288 demodulator,
as it is needed for DvbWorld USB card.

Signed-off-by: Igor M. Liplianin <liplianin@me.by>
Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/frontends/stv0288.c
drivers/media/dvb/frontends/stv0288.h

index 90e72e771a042f38298e415f19b1c1a826f69777..ff1194de34c0cf176f655329af5213754b1f4fab 100644 (file)
@@ -328,16 +328,28 @@ static int stv0288_init(struct dvb_frontend *fe)
 {
        struct stv0288_state *state = fe->demodulator_priv;
        int i;
+       u8 reg;
+       u8 val;
 
        dprintk("stv0288: init chip\n");
        stv0288_writeregI(state, 0x41, 0x04);
        msleep(50);
 
-       for (i = 0; !(stv0288_inittab[i] == 0xff &&
+       /* we have default inittab */
+       if (state->config->inittab == NULL) {
+               for (i = 0; !(stv0288_inittab[i] == 0xff &&
                                stv0288_inittab[i + 1] == 0xff); i += 2)
-               stv0288_writeregI(state, stv0288_inittab[i],
-                                               stv0288_inittab[i + 1]);
-
+                       stv0288_writeregI(state, stv0288_inittab[i],
+                                       stv0288_inittab[i + 1]);
+       } else {
+               for (i = 0; ; i += 2)  {
+                       reg = state->config->inittab[i];
+                       val = state->config->inittab[i+1];
+                       if (reg == 0xff && val == 0xff)
+                               break;
+                       stv0288_writeregI(state, reg, val);
+               }
+       }
        return 0;
 }
 
index aa0cdd27304061646a1780f8536b15c99332ddfd..f2b53db0606da0807ad657fae5235fed2585406c 100644 (file)
@@ -34,6 +34,8 @@ struct stv0288_config {
        /* the demodulator's i2c address */
        u8 demod_address;
 
+       u8* inittab;
+
        /* minimum delay before retuning */
        int min_delay_ms;