summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorAndrew de Quincy <devnull@localhost>2005-07-20 01:12:50 +0000
committerAndrew de Quincy <devnull@localhost>2005-07-20 01:12:50 +0000
commitad6a8233b626fb8d79568aab0e19f09bbaec699c (patch)
tree3cc8acb243de3262a81e9a7c85b0f7697bb492e0 /linux
parent00151d80417c178cc9a11438811f8a77c7319279 (diff)
downloadmediapointer-dvb-s2-ad6a8233b626fb8d79568aab0e19f09bbaec699c.tar.gz
mediapointer-dvb-s2-ad6a8233b626fb8d79568aab0e19f09bbaec699c.tar.bz2
Got the frontend tuning - needs more work though.
Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/dvb/frontends/s5h1420.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/linux/drivers/media/dvb/frontends/s5h1420.c b/linux/drivers/media/dvb/frontends/s5h1420.c
index 4f396ac8d..f572d4dbf 100644
--- a/linux/drivers/media/dvb/frontends/s5h1420.c
+++ b/linux/drivers/media/dvb/frontends/s5h1420.c
@@ -400,7 +400,7 @@ static void s5h1420_setsymbolrate(struct s5h1420_state* state, struct dvb_fronte
{
u64 val;
- val = (p->u.qpsk.symbol_rate / 1000) * (1<<24);
+ val = ((u64) p->u.qpsk.symbol_rate / 1000ULL) * (1ULL<<24);
if (p->u.qpsk.symbol_rate <= 21000000) {
val *= 2;
}
@@ -415,7 +415,7 @@ static void s5h1420_setsymbolrate(struct s5h1420_state* state, struct dvb_fronte
static u32 s5h1420_getsymbolrate(struct s5h1420_state* state)
{
- u64 val;
+ u64 val = 0;
int sampling = 2;
if (s5h1420_readreg(state, 0x05) & 0x2)
@@ -427,10 +427,10 @@ static u32 s5h1420_getsymbolrate(struct s5h1420_state* state)
val |= s5h1420_readreg(state, 0x13);
s5h1420_writereg(state, 0x06, s5h1420_readreg(state, 0x06) & 0xf7);
- val *= (state->fclk / 1000);
+ val *= (state->fclk / 1000ULL);
do_div(val, ((1<<24) * sampling));
- return (u32) (val * 1000);
+ return (u32) (val * 1000ULL);
}
static void s5h1420_setfreqoffset(struct s5h1420_state* state, int freqoffset)
@@ -463,7 +463,7 @@ static int s5h1420_getfreqoffset(struct s5h1420_state* state)
/* remember freqoffset is in kHz, but the chip wants the offset in Hz, so
* divide fclk by 1000000 to get the correct value. */
- val = - ((val * (state->fclk/1000000)) / (1<<24));
+ val = (((-val) * (state->fclk/1000000)) / (1<<24));
return val;
}
@@ -546,7 +546,7 @@ static void s5h1420_setinversion(struct s5h1420_state* state, struct dvb_fronten
tmp |= 0x10;
if (p->inversion == INVERSION_ON)
- tmp |= 0x80;
+ tmp |= 0x08;
s5h1420_writereg(state, 0x31, tmp);
}
@@ -610,7 +610,7 @@ static int s5h1420_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
/* set misc registers */
s5h1420_writereg(state, 0x02, 0x00);
s5h1420_writereg(state, 0x07, 0xb0);
- s5h1420_writereg(state, 0x0a, 0x67);
+ s5h1420_writereg(state, 0x0a, 0xe7);
s5h1420_writereg(state, 0x0b, 0x78);
s5h1420_writereg(state, 0x0c, 0x48);
s5h1420_writereg(state, 0x0d, 0x6b);
@@ -626,8 +626,8 @@ static int s5h1420_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
/* start QPSK */
s5h1420_writereg(state, 0x05, s5h1420_readreg(state, 0x05) | 1);
- /* set the frequency offset to adjust for PLL inaccuracy */
- s5h1420_setfreqoffset(state, p->frequency - state->tunedfreq);
+ /* frequency offset must be 0 initially */
+ s5h1420_setfreqoffset(state, 0);
/* set the reset of the parameters */
s5h1420_setsymbolrate(state, p);