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 20:02, Alfred Zastrow wrote:
> Alfred Zastrow schrieb:
> > No, ves-fix-4.patch also doesn't work properly. Sometimes I get a
> > picture after > 30 seconds, but mostly the sreen stays black.
>
> The femon-plugin show me a STR of 10%, normaly this value has about 60
> to 70 %
>
> But it also states LOCK, SIGNAL, CARRIER, VITERBI, SYNC on RTL
> Television, which is black.

Hmm, weird... if the DISEQC isn't working, it might be locking on to some 
other unrelated channel though. 

OK, this patch has the other setting changed, so it theoretically should work 
with this one... unless both changes are necessary.

BTW: thanks very much for trying out all this stuff!
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 20:03:41 -0000
@@ -68,10 +68,10 @@
  */
 
 static u8 init_1893_tab [] = {
-	0x01, 0xa4, 0x35, 0x80, 0x2a, 0x0b, 0x55, 0xc4,
+	0x01, 0xa4, 0x35, 0x81, 0x2a, 0x0b, 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, 0x00,
 	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,11 @@
 	1,1,1,0,1,1,1,1, 1,1,1,1,1
 };
 
+struct ves1x93_state {
+        fe_spectral_inversion_t inversion;
+};
+
+
 
 static int ves1x93_writereg (struct dvb_i2c_bus *i2c, u8 reg, u8 data)
 {
@@ -214,7 +219,7 @@
 		init_1x93_wtab = init_1893_wtab;
 		size = sizeof(init_1893_tab);
 		if (board_type == BOARD_NOKIA_DBOX2)
-			init_1x93_tab[0x05] |= 0x20; /* invert PWM */
+			init_1x93_tab[0x05] |= 0x22; /* invert PWM */
 		break;
 
 	case DEMOD_VES1993:
@@ -284,10 +289,7 @@
 		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 +454,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 +532,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 +550,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 +585,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,12 +602,19 @@
 		return -ENODEV;
 	}
 
-	return dvb_register_frontend (ves1x93_ioctl, i2c, NULL, &ves1x93_info);
+        if ((state = kmalloc(sizeof(struct ves1x93_state), GFP_KERNEL)) == NULL) {
+	        return -ENOMEM;
+	}
+        state->inversion = INVERSION_OFF;
+        *data = state;
+
+	return dvb_register_frontend (ves1x93_ioctl, i2c, (void*) state, &ves1x93_info);
 }
 
 
 static void ves1x93_detach (struct dvb_i2c_bus *i2c, void *data)
 {
+        kfree(data);
 	dvb_unregister_frontend (ves1x93_ioctl, i2c);
 }
 

Home | Main Index | Thread Index