Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: Full featured card summary



On Saturday 13 March 2004 18:29, Alfred Zastrow wrote:
> Andrew de Quincey schrieb:
> > Can someone try the attached patch (against CVS HEAD). It returns most of
> > the values to how they were previously. There are a few left changed, but
> > I don't want to go too fast.
>
> I test your changes and they also doesn't work for me.
> Black screen on every channel.

Argh :( Thanks for testing

OK, this new version has all the parameters set back to what they were.

(I've not changed the kmalloc thing yet; want to find the problem out first)
Index: linux/drivers/media/dvb/frontends/ves1x93.c
===================================================================
RCS file: /cvs/linuxtv/dvb-kernel/linux/drivers/media/dvb/frontends/ves1x93.c,v
retrieving revision 1.6
diff -u -r1.6 ves1x93.c
--- linux/drivers/media/dvb/frontends/ves1x93.c	11 Mar 2004 18:44:19 -0000	1.6
+++ linux/drivers/media/dvb/frontends/ves1x93.c	13 Mar 2004 18:49:20 -0000
@@ -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);
 }
 
 

Home | Main Index | Thread Index