diff options
Diffstat (limited to 'linux/drivers/media/dvb/frontends')
-rw-r--r-- | linux/drivers/media/dvb/frontends/ves1820.c | 18 |
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"); - |