diff options
author | Hartmut Hackmann <hartmut.hackmann@t-online.de> | 2008-04-14 00:41:19 +0200 |
---|---|---|
committer | Hartmut Hackmann <hartmut.hackmann@t-online.de> | 2008-04-14 00:41:19 +0200 |
commit | 04ffa4a245250db7c6a07158f8873bcf019ecbec (patch) | |
tree | 632358845ea01cf26b61fe67a14a046d02479a54 /linux/drivers/media/dvb/frontends | |
parent | 36fde2edf527dfa881a65ba2db337636bc435f9f (diff) | |
download | mediapointer-dvb-s2-04ffa4a245250db7c6a07158f8873bcf019ecbec.tar.gz mediapointer-dvb-s2-04ffa4a245250db7c6a07158f8873bcf019ecbec.tar.bz2 |
tda826x: Calculate cut off fequency from symbol rate
From: Hartmut Hackmann <hartmut.hackmann@t-online.de>
This patch makes the tuner work with transonders providing higher
symbol rates.
It was contributed by Oliver Endriss
Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Diffstat (limited to 'linux/drivers/media/dvb/frontends')
-rw-r--r-- | linux/drivers/media/dvb/frontends/tda826x.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/linux/drivers/media/dvb/frontends/tda826x.c b/linux/drivers/media/dvb/frontends/tda826x.c index a6540e7a2..596fc4275 100644 --- a/linux/drivers/media/dvb/frontends/tda826x.c +++ b/linux/drivers/media/dvb/frontends/tda826x.c @@ -76,6 +76,8 @@ static int tda826x_set_params(struct dvb_frontend *fe, struct dvb_frontend_param struct tda826x_priv *priv = fe->tuner_priv; int ret; u32 div; + u32 ksyms; + u32 bandwidth; u8 buf [11]; struct i2c_msg msg = { .addr = priv->i2c_address, .flags = 0, .buf = buf, .len = 11 }; @@ -83,6 +85,15 @@ static int tda826x_set_params(struct dvb_frontend *fe, struct dvb_frontend_param div = (params->frequency + (1000-1)) / 1000; + /* BW = ((1 + RO) * SR/2 + 5) * 1.3 [SR in MSPS, BW in MHz] */ + /* with R0 = 0.35 and some transformations: */ + ksyms = params->u.qpsk.symbol_rate / 1000; + bandwidth = (878 * ksyms + 6500000) / 1000000 + 1; + if (bandwidth < 5) + bandwidth = 5; + else if (bandwidth > 36) + bandwidth = 36; + buf[0] = 0x00; // subaddress buf[1] = 0x09; // powerdown RSSI + the magic value 1 if (!priv->has_loopthrough) @@ -90,7 +101,7 @@ static int tda826x_set_params(struct dvb_frontend *fe, struct dvb_frontend_param buf[2] = (1<<5) | 0x0b; // 1Mhz + 0.45 VCO buf[3] = div >> 7; buf[4] = div << 1; - buf[5] = 0x77; // baseband cut-off 19 MHz + buf[5] = ((bandwidth - 5) << 3) | 7; /* baseband cut-off */ buf[6] = 0xfe; // baseband gain 9 db + no RF attenuation buf[7] = 0x83; // charge pumps at high, tests off buf[8] = 0x80; // recommended value 4 for AMPVCO + disable ports. |