diff options
Diffstat (limited to 'linux/drivers/media/dvb/frontends/ves1820.c')
-rw-r--r-- | linux/drivers/media/dvb/frontends/ves1820.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/linux/drivers/media/dvb/frontends/ves1820.c b/linux/drivers/media/dvb/frontends/ves1820.c index f68ec68bb..24223d583 100644 --- a/linux/drivers/media/dvb/frontends/ves1820.c +++ b/linux/drivers/media/dvb/frontends/ves1820.c @@ -170,7 +170,7 @@ int tuner_write (struct dvb_i2c_bus *i2c, u8 addr, u8 data [4]) static int tuner_set_tv_freq (struct dvb_frontend *fe, u32 freq) { - u32 div; + u32 div, ifreq; static u8 addr [] = { 0x61, 0x62 }; static u8 byte3 [] = { 0x8e, 0x85 }; int tuner_type = GET_TUNER(fe->data); @@ -179,8 +179,13 @@ 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 + 35937500 + 31250) / 62500; /* works better for finland and sweden */ + if (strstr (fe->i2c->adapter->name, "Technotrend")) + ifreq = 35937500; + else + ifreq = 36125000; + + div = (freq + ifreq + 31250) / 62500; + buf[0] = (div >> 8) & 0x7f; buf[1] = div & 0xff; buf[2] = byte3[tuner_type]; |