summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/frontends
diff options
context:
space:
mode:
authorJohannes Stezenbach <devnull@localhost>2003-05-13 12:55:21 +0000
committerJohannes Stezenbach <devnull@localhost>2003-05-13 12:55:21 +0000
commit061758a4f8633f46f492e5d03bce979055fc86de (patch)
tree16956659580aed0da3041f61d751a85e9ae733a3 /linux/drivers/media/dvb/frontends
parent2bb15bfae8e796c26f62000c27490c90a25161eb (diff)
downloadmediapointer-dvb-s2-061758a4f8633f46f492e5d03bce979055fc86de.tar.gz
mediapointer-dvb-s2-061758a4f8633f46f492e5d03bce979055fc86de.tar.bz2
patch from Jaakko Hyvatti http://hyvatti.iki.fi/~jaakko/dvb/dvb6.diff:
- Makes zigzag to not change frequency for DVB-c at all. It only resets the parameters over and over again. - 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. Maybe zigzag changes above allow the auto inversion to work. - 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.
Diffstat (limited to 'linux/drivers/media/dvb/frontends')
-rw-r--r--linux/drivers/media/dvb/frontends/ves1820.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/linux/drivers/media/dvb/frontends/ves1820.c b/linux/drivers/media/dvb/frontends/ves1820.c
index 12dcfd8eb..f68ec68bb 100644
--- a/linux/drivers/media/dvb/frontends/ves1820.c
+++ b/linux/drivers/media/dvb/frontends/ves1820.c
@@ -179,7 +179,8 @@ int tuner_set_tv_freq (struct dvb_frontend *fe, u32 freq)
if (tuner_type == 0xff) /* PLL not reachable over i2c ... */
return 0;
- div = (freq + 36125000 + 31250) / 62500;
+ /* div = (freq + 36125000 + 31250) / 62500; */
+ div = (freq + 35937500 + 31250) / 62500; /* works better for finland and sweden */
buf[0] = (div >> 8) & 0x7f;
buf[1] = div & 0xff;
buf[2] = byte3[tuner_type];
@@ -198,9 +199,15 @@ int tuner_set_tv_freq (struct dvb_frontend *fe, u32 freq)
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);
@@ -208,7 +215,7 @@ int ves1820_setup_reg0 (struct dvb_frontend *fe, u8 reg0)
/**
* check lock and toggle inversion bit if required...
*/
- if (!(ves1820_readreg (fe, 0x11) & 0x08)) {
+ if (INVERSION_AUTO == inversion && !(ves1820_readreg (fe, 0x11) & 0x08)) {
dvb_delay(10);
if (!(ves1820_readreg (fe, 0x11) & 0x08)) {
reg0 ^= 0x20;
@@ -302,7 +309,7 @@ int ves1820_set_parameters (struct dvb_frontend *fe,
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 };
@@ -320,7 +327,7 @@ int ves1820_set_parameters (struct dvb_frontend *fe,
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;
}
@@ -539,4 +546,3 @@ module_exit(exit_ves1820);
MODULE_DESCRIPTION("VES1820 DVB-C frontend driver");
MODULE_AUTHOR("Ralph Metzler, Holger Waechtler");
MODULE_LICENSE("GPL");
-