On Thu, 6 Mar 2003, Holger Waechtler wrote: > can somebody of you please extract the relevant part of this patch? > > It's ways too big and does ways too many things at once to get applied > to the CVS repository.
Yes, it's time to get this cleaned up. The patch below includes the essentials. I have not received complaints of my patch not working, but who knows, there might be someone with a card that needs the current CVS version and does not work with the patch. We just cannot know until we break them, do we? Some points: - Disables zigzag for everything except DVB-s. This is from Metzler driver. Maybe someone with DVB-t needs it? In that case change the "!= FE_QPSK" to "== FE_QAM". - The IF of 35937500 might be better to be 36000000. This might be what the card designer meant. My card shows the AFC fine tuning offset to be closest to zero with 35937500 (one step below 36MHz). Some other cards might be different. I have not heard of any complaints about my patch not working for someone in this respect. - Has anyone ever tested this auto inversion thing? DVB-c is far too slow to tune and lock for this auto inversion code to work. Therefore you need to manually set it. - QAM registers have been tweaked to non-specification values. I do not know if someone has counterexamples, but this works for a lot of people. (This is also at http://www.iki.fi/hyvatti/dvb/ now.) I am leaving for a vacation for a couple of weeks shortly, so I will not be working on this for a while. Anyway, this patch has essentially been in use in my system since October. Jaakko Index: driver/dvb_frontend.c =================================================================== RCS file: /cvs/linuxtv/DVB/driver/dvb_frontend.c,v retrieving revision 1.43 diff -u -r1.43 dvb_frontend.c --- driver/dvb_frontend.c 20 Feb 2003 14:56:29 -0000 1.43 +++ driver/dvb_frontend.c 6 Mar 2003 22:23:23 -0000 @@ -384,6 +384,9 @@ } #endif + if (fe->info->type != FE_QPSK) + return; + /** * let's start a zigzag scan to compensate LNB drift... */ Index: driver/frontends/ves1820.c =================================================================== RCS file: /cvs/linuxtv/DVB/driver/frontends/ves1820.c,v retrieving revision 1.15 diff -u -r1.15 ves1820.c --- driver/frontends/ves1820.c 27 Nov 2002 11:24:20 -0000 1.15 +++ driver/frontends/ves1820.c 6 Mar 2003 22:23:23 -0000 @@ -180,7 +180,7 @@ if (tuner_type == 0xff) /* PLL not reachable over i2c ... */ return 0; - div = (freq + 36250000 + 31250) / 62500; + div = (freq + 35937500 + 31250) / 62500; buf[0] = (div >> 8) & 0x7f; buf[1] = div & 0xff; buf[2] = byte3[tuner_type]; @@ -199,9 +199,15 @@ static -int ves1820_setup_reg0 (struct dvb_frontend *fe, u8 reg0) +int ves1820_setup_reg0 (struct dvb_frontend *fe, u8 reg0, + fe_spectral_inversion_t inversion) { reg0 |= GET_REG0(fe->data) & 0x62; + + if (INVERSION_ON == inversion) + reg0 &= ~0x20; + else if (INVERSION_OFF == inversion) + reg0 |= 0x20; ves1820_writereg (fe, 0x00, reg0 & 0xfe); ves1820_writereg (fe, 0x00, reg0 | 0x01); @@ -209,7 +232,7 @@ /** * check lock and toggle inversion bit if required... */ - if (!(ves1820_readreg (fe, 0x11) & 0x08)) { + if (INVERSION_AUTO == inversion && !(ves1820_readreg (fe, 0x11) & 0x08)) { ddelay(1); if (!(ves1820_readreg (fe, 0x11) & 0x08)) { reg0 ^= 0x20; @@ -306,7 +312,7 @@ struct dvb_frontend_parameters *p) { static const u8 reg0x00 [] = { 0x00, 0x04, 0x08, 0x0c, 0x10 }; - static const u8 reg0x01 [] = { 140, 140, 106, 120, 92 }; + static const u8 reg0x01 [] = { 140, 140, 106, 100, 92 }; static const u8 reg0x05 [] = { 135, 100, 70, 54, 38 }; static const u8 reg0x08 [] = { 162, 116, 67, 52, 35 }; static const u8 reg0x09 [] = { 145, 150, 106, 126, 107 }; @@ -324,7 +330,7 @@ ves1820_writereg (fe, 0x08, reg0x08[real_qam]); ves1820_writereg (fe, 0x09, reg0x09[real_qam]); - ves1820_setup_reg0 (fe, reg0x00[real_qam]); + ves1820_setup_reg0 (fe, reg0x00[real_qam], p->inversion); return 0; } -- Foreca Ltd [EMAIL PROTECTED] Pursimiehenkatu 29-31 B, FIN-00150 Helsinki, Finland http://www.foreca.com -- Info: To unsubscribe send a mail to [EMAIL PROTECTED] with "unsubscribe linux-dvb" as subject.
