Andrew de Quincey schrieb:

-       ves1x93_writereg(i2c, 0x00, 0x11);
+//     ves1x93_writereg(i2c, 0x00, 0x11);
         ret = i2c->xfer (i2c, &msg, 1);
-       ves1x93_writereg(i2c, 0x00, 0x01);
+//     ves1x93_writereg(i2c, 0x00, 0x01);


^^^ this diff makes no difference


The attached diff is working. I think it was ves-fix-3


Alfred
--- ves1x93.c.orig      Thu Mar 11 20:11:18 2004
+++ ves1x93.c   Sat Mar 13 21:42:31 2004
@@ -68,10 +68,10 @@
  */
 
 static u8 init_1893_tab [] = {
-       0x01, 0xa4, 0x35, 0x80, 0x2a, 0x0b, 0x55, 0xc4,
+       0x01, 0xa4, 0x35, 0x81, 0x2a, 0x0d, 0x55, 0xc4,
        0x09, 0x69, 0x00, 0x86, 0x4c, 0x28, 0x7f, 0x00,
        0x00, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x80, 0x00, 0x21, 0xb0, 0x14, 0x00, 0xdc, 0x00,
+       0x80, 0x00, 0x31, 0xb0, 0x14, 0x00, 0xdc, 0x20,
        0x81, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x55, 0x00, 0x00, 0x7f, 0x00
@@ -110,6 +110,13 @@
        1,1,1,0,1,1,1,1, 1,1,1,1,1
 };
 
+#pragma pack(1)
+struct ves1x93_state {
+            u8 inversion:2;
+};
+#pragma pack()
+
+
 
 static int ves1x93_writereg (struct dvb_i2c_bus *i2c, u8 reg, u8 data)
 {
@@ -278,16 +285,13 @@
                val = 0x80;
                break;
        case INVERSION_AUTO:
-               val = 0x00;
+               val = 0x40;
                break;
        default:
                return -EINVAL;
        }
 
-       /* needs to be saved for FE_GET_FRONTEND */
-       init_1x93_tab[0x0c] = (init_1x93_tab[0x0c] & 0x3f) | val;
-
-       return ves1x93_writereg (i2c, 0x0c, init_1x93_tab[0x0c]);
+       return ves1x93_writereg (i2c, 0x0c, (init_1x93_tab[0x0c] & 0x3f) | val);
 }
 
 
@@ -452,6 +456,7 @@
 static int ves1x93_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
 {
        struct dvb_i2c_bus *i2c = fe->i2c;
+        struct ves1x93_state *state = (struct ves1x93_state *) &(fe->data);
 
         switch (cmd) {
         case FE_GET_INFO:
@@ -529,6 +534,7 @@
                ves1x93_set_fec (i2c, p->u.qpsk.fec_inner);
                ves1x93_set_symbolrate (i2c, p->u.qpsk.symbol_rate);
                ves1x93_afc (i2c, p->frequency, p->u.qpsk.symbol_rate);     
+               state->inversion = p->inversion;
                 break;
         }
 
@@ -546,9 +552,9 @@
                 * inversion indicator is only valid
                 * if auto inversion was used
                 */
-               if (!(init_1x93_tab[0x0c] & 0x80))
+               if (state->inversion == INVERSION_AUTO)
                        p->inversion = (ves1x93_readreg (i2c, 0x0f) & 2) ? 
-                                       INVERSION_OFF : INVERSION_ON;
+                                       INVERSION_ON : INVERSION_OFF;
                p->u.qpsk.fec_inner = ves1x93_get_fec (i2c);
        /*  XXX FIXME: timing offset !! */
                break;
@@ -581,6 +587,7 @@
 static int ves1x93_attach (struct dvb_i2c_bus *i2c, void **data)
 {
        u8 identity = ves1x93_readreg(i2c, 0x1e);
+        struct ves1x93_state state;
 
        switch (identity) {
        case 0xdc: /* VES1893A rev1 */
@@ -597,7 +604,8 @@
                return -ENODEV;
        }
 
-       return dvb_register_frontend (ves1x93_ioctl, i2c, NULL, &ves1x93_info);
+        state.inversion = INVERSION_OFF;
+       return dvb_register_frontend (ves1x93_ioctl, i2c, (void *)(*((u32*) &state)), 
&ves1x93_info);
 }
 
 

Reply via email to