Mailing List archive

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

[linux-dvb] [PATCH] ves1820 inversion



hi,

i would like to commit this patch at least to dvb-kernel. the software
auto inversion hack does not work. so i removed it. imho inversion
handling should be left to the application. this way it works fine on a
nokia dbox2-c. any complaints?

another issue is, that since i and q are swapped on the pci cable cards,
inversion on/off are swapped, too. how about adding a flag for that and
do something like if ((inv != INVERSION_AUTO) && (flag)) inv = !inv? 

regards,
andreas
--- /home/obi/cvs/dvb-kernel/linux/drivers/media/dvb/frontends/ves1820.c	2003-05-23 03:27:57.000000000 +0200
+++ ves1820.c	2003-05-26 01:19:08.000000000 +0200
@@ -88,7 +88,7 @@
 #endif
 	.caps = FE_CAN_QAM_16 | FE_CAN_QAM_32 | FE_CAN_QAM_64 |
 		FE_CAN_QAM_128 | FE_CAN_QAM_256 | 
-		FE_CAN_FEC_AUTO | FE_CAN_INVERSION_AUTO |
+		FE_CAN_FEC_AUTO |
 		FE_CAN_CLEAN_SETUP | FE_CAN_RECOVER
 };
 
@@ -209,26 +209,21 @@
 {
 	reg0 |= GET_REG0(fe->data) & 0x62;
 
-	if (INVERSION_ON == inversion)
+	switch (inversion) {
+	case INVERSION_ON:
 		reg0 &= ~0x20;
-	else if (INVERSION_OFF == inversion)
+		break;
+	case INVERSION_OFF:
 		reg0 |= 0x20;
-	
-	ves1820_writereg (fe, 0x00, reg0 & 0xfe);
-        ves1820_writereg (fe, 0x00, reg0 | 0x01);
-
-	/**
-	 *  check lock and toggle inversion bit if required...
-	 */
-	if (INVERSION_AUTO == inversion && !(ves1820_readreg (fe, 0x11) & 0x08)) {
-		dvb_delay(10);
-		if (!(ves1820_readreg (fe, 0x11) & 0x08)) {
-			reg0 ^= 0x20;
-			ves1820_writereg (fe, 0x00, reg0 & 0xfe);
-        		ves1820_writereg (fe, 0x00, reg0 | 0x01);
-		}
+		break;
+	case INVERSION_AUTO:
+	default:
+		return -EINVAL;
 	}
 
+	ves1820_writereg (fe, 0x00, reg0 & 0xfe);
+	ves1820_writereg (fe, 0x00, reg0 | 0x01);
+
 	SET_REG0(fe->data, reg0);
 
 	return 0;

Home | Main Index | Thread Index