summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb
diff options
context:
space:
mode:
authorHolger Waechtler <devnull@localhost>2003-03-28 14:02:43 +0000
committerHolger Waechtler <devnull@localhost>2003-03-28 14:02:43 +0000
commitfb74f961ab068c4db2f72b886517a9606b74a0e8 (patch)
tree49b1d42da5e5e8440b2f043b732e852340513671 /linux/drivers/media/dvb
parent5ddaad9b78587a2e9b06771c9956926ccacc202d (diff)
downloadmediapointer-dvb-s2-fb74f961ab068c4db2f72b886517a9606b74a0e8.tar.gz
mediapointer-dvb-s2-fb74f961ab068c4db2f72b886517a9606b74a0e8.tar.bz2
optimized PLL code
Diffstat (limited to 'linux/drivers/media/dvb')
-rw-r--r--linux/drivers/media/dvb/frontends/grundig_29504-401.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/linux/drivers/media/dvb/frontends/grundig_29504-401.c b/linux/drivers/media/dvb/frontends/grundig_29504-401.c
index eef107bc9..eb1eda396 100644
--- a/linux/drivers/media/dvb/frontends/grundig_29504-401.c
+++ b/linux/drivers/media/dvb/frontends/grundig_29504-401.c
@@ -29,6 +29,7 @@
#include <linux/string.h>
#include <linux/slab.h>
+#include "compat.h"
#include "dvb_frontend.h"
static int debug = 0;
@@ -101,27 +102,33 @@ int tsa5060_write (struct dvb_i2c_bus *i2c, u8 data [4])
/**
* set up the downconverter frequency divisor for a
* reference clock comparision frequency of 166666 Hz.
- * frequency offset is 36000000 Hz.
+ * frequency offset is 36125000 Hz.
*/
static
int tsa5060_set_tv_freq (struct dvb_i2c_bus *i2c, u32 freq)
{
u32 div;
u8 buf [4];
- u8 cfg;
+ u8 cfg, cpump, band_select;
- div = (36000000 + freq) / 166666;
+ div = (36125000 + freq) / 166666;
cfg = 0x88;
+ cpump = div < 175000 ? 2 : div < 390000 ? 1 :
+ div < 470000 ? 2 : div < 750000 ? 1 : 3;
+
+ band_select = div < 175000 ? 0x0e : div < 470000 ? 0x05 : 0x03;
+
buf [0] = (div >> 8) & 0x7f;
buf [1] = div & 0xff;
buf [2] = ((div >> 10) & 0x60) | cfg;
- buf [3] = 0xc0;
+ buf [3] = cpump | band_select;
- return tsa5060_write (i2c, buf);
+ return tsa5060_write(i2c, buf);
}
+
static
void apply_tps (struct dvb_i2c_bus *i2c)
{